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

A hash character at the beginning of Output line causes test to be marked as failed #52

Merged
merged 3 commits into from
May 31, 2023

Conversation

JackuB
Copy link
Contributor

@JackuB JackuB commented May 29, 2023

I noticed that when an output line starts with #, it's matched against tokenizer regex for Packages:

{
regexp.MustCompile(`^# (?P<Package>.*)$`),
stateInit,
ActionPackage,
stateBetweenTests,
},
{
regexp.MustCompile(`^# (?P<Package>.*)$`),
stateBetweenTests,
ActionPackage,
stateBetweenTests,
},

This manifest as the output lines with # like:

{"Time":"2023-05-26T14:52:41.180732Z","Action":"output","Package":"code-intelligence.com/cifuzz/integration-tests/other","Test":"TestIntegration_Other_RunCoverage","Output":"# The FUZZ_TEST_CXXFLAGS and FUZZ_TEST_LDFLAGS environment variables\n"}
{"Time":"2023-05-26T14:52:41.185726Z","Action":"output","Package":"code-intelligence.com/cifuzz/integration-tests/other","Test":"TestIntegration_Other_RunCoverage","Output":"# are set by cifuzz when it executes the build command. Those must\n"}
{"Time":"2023-05-26T14:52:41.190079Z","Action":"output","Package":"code-intelligence.com/cifuzz/integration-tests/other","Test":"TestIntegration_Other_RunCoverage","Output":"# be passed to the compiler and linker (compiling and linking is\n"}
{"Time":"2023-05-26T14:52:41.194327Z","Action":"output","Package":"code-intelligence.com/cifuzz/integration-tests/other","Test":"TestIntegration_Other_RunCoverage","Output":"# done in a single invocation here, so we pass both to XX here).\n"}

are printed instead of the package/test name and exit code is non-zero:
Screenshot 2023-05-29 at 15 29 19

This PR matches the "action" regex only against non-JSON lines.

@JackuB JackuB marked this pull request as ready for review May 29, 2023 13:55
@ghost
Copy link

ghost commented May 30, 2023

@engelmi I've reviewed these, look good, could you take a look too please?

@engelmi
Copy link
Member

engelmi commented May 31, 2023

@engelmi I've reviewed these, look good, could you take a look too please?

Looks good to me, too ✔️

@engelmi engelmi merged commit b870aff into GoTestTools:main May 31, 2023
@JackuB JackuB deleted the fix/lines-with-hash branch May 31, 2023 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants