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

False Positives: Tests Should Fail if Build Fails #87

Closed
ax3l opened this issue Oct 12, 2021 · 5 comments · Fixed by #89
Closed

False Positives: Tests Should Fail if Build Fails #87

ax3l opened this issue Oct 12, 2021 · 5 comments · Fixed by #89

Comments

@ax3l
Copy link
Member

ax3l commented Oct 12, 2021

When build steps fail, e.g., for tools

building tools...
   building particle_compare...
   make -j2 AMREX_HOME=/tmp/ci-31YWhskdkz/amrex/   DEBUG=FALSE USE_MPI=FALSE  COMP=g++ TEST=TRUE USE_ASSERTION=TRUE WarpxBinDir= 
   WARNING: build failed
   unable to continue, tools not able to be built
Finishing: Build & test

Then the overall return status should be non-zero.
Otherwise, CI using the regression testing scripts silently passes (permanent false negative).

Seen today by @RemiLehe and @EZoni on WarpX CI.

@ax3l
Copy link
Member Author

ax3l commented Oct 25, 2021

Seen again today, disabling our tests with an always false-ok:

building tools...
   building particle_compare...
   make -j2 AMREX_HOME=/tmp/ci-kXuvJgn5SL/amrex/   DEBUG=FALSE USE_MPI=FALSE  COMP=g++ TEST=TRUE USE_ASSERTION=TRUE WarpxBinDir= 
   WARNING: build failed
   unable to continue, tools not able to be built
Finishing: Build & test

x-ref: ECP-WarpX#17

@ax3l ax3l changed the title Tests Should Fail if Build Fails False Positives: Tests Should Fail if Build Fails Oct 25, 2021
@WeiqunZhang
Copy link
Member

https://github.com/AMReX-Codes/regression_testing/blob/main/suite.py#L1009

This particular issue was fixed 2 years ago. But warpx's regression testing repo was not updated.

@ax3l
Copy link
Member Author

ax3l commented Oct 26, 2021

Thanks! Wuhu! Same as ECP-WarpX#17 indeed!

I leave this issue open since we still need to implement error handling in case any of the build steps fail. Currently they write an error and return a zero error code, letting CI pass. (The rc in your link needs to be propagated in some way, I think.)

@WeiqunZhang
Copy link
Member

https://github.com/AMReX-Codes/regression_testing/blob/main/test_util.py#L242

Seem that we just need to make this return an error code sys.exit(1) instead of the default 0.

@ax3l
Copy link
Member Author

ax3l commented Oct 26, 2021

Yes!
Huh, I did not expect that the logger also exits - should have checked. Will PR that in, great idea!

WeiqunZhang added a commit that referenced this issue Oct 26, 2021
Return a non-zero exit code on failed tests/builds/etc.
This avoids that CI returns success in commonly automated settings.

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

Successfully merging a pull request may close this issue.

2 participants