Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code coverage via trace files in txt format #144

Open
abhi-malhotra opened this issue Jan 13, 2022 · 4 comments
Open

Code coverage via trace files in txt format #144

abhi-malhotra opened this issue Jan 13, 2022 · 4 comments
Assignees

Comments

@abhi-malhotra
Copy link

With App Connect Enterprise 11 onwards, user trace is generated as plain text format instead of xml. Plugin currently ingests trace in xml format for code coverage.

From App Connect Enterprise infocenter:
When trace is active, information is recorded in the user trace log files in plain text format.

https://www.ibm.com/docs/en/app-connect/11.0.0?topic=trace-user

Are there any plans to ingest traces in the new format?

@abhi-malhotra abhi-malhotra changed the title Code coverage for trace files in txt format Code coverage via trace files in txt format Jan 13, 2022
@ThomasPohl
Copy link
Member

There are no plans, yet.

First I need to analyse the new format and see how we can find out what ESQL code has been executed.

@abhi-malhotra
Copy link
Author

@ThomasPohl, I was looking into the new trace format and was able to parse it with below changes.

In file TraceFileReader, changed PATTERN_REGEX to ".* at \((.), (\w+)\.\w+\).".

Next change was in readLine function for identifying begin and end statement.

int statementBegin = line.indexOf("'", line.indexOf("'", (line.indexOf("'") + 1) +1) + 1);
int statementEnd = line.lastIndexOf("'", line.indexOf(" at "));

These 3 changes allowed the new format to be parsed. Attaching the trace file generated by App Connect Enterprise v12.

Is there a way to incorporate these changes keeping the plugin backward compatible.

integration_server.intserver.userTrace.0.txt

ThomasPohl added a commit that referenced this issue Jul 23, 2022
@ThomasPohl
Copy link
Member

@abhi-malhotra Thanks for your suggestions. I made the regex a little more general. Now it should work for both plain text formats.

@ThomasPohl ThomasPohl self-assigned this Jul 25, 2022
@ThomasPohl
Copy link
Member

@abhi-malhotra Parsing oof the new coverage-format is part of the current release candidate. It would be great if you could check, if it works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants