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

Input variable to exit if failed #175

Open
LecrisUT opened this issue Apr 19, 2024 · 3 comments
Open

Input variable to exit if failed #175

LecrisUT opened this issue Apr 19, 2024 · 3 comments

Comments

@LecrisUT
Copy link
Contributor

I am considering running some tests with beakerlib inside a spec file. The issue is the tests will always pass because it has exit 0. I could add a check for BEAKERLIB_DIR, but it would be nice to have an alternative to return an exit code if failed.

@sopos
Copy link
Member

sopos commented Apr 19, 2024

Right. There's no exit code as beakerlib basically cannot control how the test itself exits. For that purpose it generates the $BEAKERLIB_DIR/TestResults file which is bash-sourceable. Inside it you can find TESTRESULT_RESULT_ECODE which reflects the test state. If the TESTRESULT_STATE=="complete" && TESTRESULT_RESULT_ECODE == "0", you can consider the test as passed.
May be some simple wrapper as a dummy executor could help here to translate it to the real exit code.

@LecrisUT
Copy link
Contributor Author

I have tried to write something as:

source $(pwd)/tests_results_${mpi:-serial}/TestResults
[ "${TESTRESULT_RESULT_STRING}" == "FAIL" ] && exit 1

But this didn't actually pass: https://src.fedoraproject.org/rpms/cp2k/pull-request/6

It is rather weird

@sopos
Copy link
Member

sopos commented May 2, 2024

No idea here. It would be good to consul someone more familiar with the build process.

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

No branches or pull requests

2 participants