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

Report test module failures via exit codes #2419

Merged

Conversation

josegomezr
Copy link
Contributor

  • Introduced a --exit-status-from-test-results / -e flag to isotovideo.

    It'll inspect the test results after a full run and compute the exit code from them.

    If:

    • no test results exist: exit code = 100
    • failed test results results exist: exit code = 101 (failed result => anything different than ok) else
    • exit code = 0
  • Documented the flags in the perl pod section.

  • Unit tested with an empty distribution & a fail module distribution.

Complements poo#138416

isotovideo Outdated Show resolved Hide resolved
isotovideo Outdated Show resolved Hide resolved
t/data/empty_test_distribution/main.pm Outdated Show resolved Hide resolved
t/data/empty_test_distribution/needles/.gitkeep Outdated Show resolved Hide resolved
t/14-isotovideo.t Outdated Show resolved Hide resolved
isotovideo Outdated Show resolved Hide resolved
isotovideo Outdated Show resolved Hide resolved
isotovideo Outdated Show resolved Hide resolved
isotovideo Outdated Show resolved Hide resolved
isotovideo Outdated Show resolved Hide resolved
isotovideo Outdated Show resolved Hide resolved
isotovideo Outdated Show resolved Hide resolved
isotovideo Outdated Show resolved Hide resolved
@josegomezr josegomezr force-pushed the add_exit_on_failed_test_module branch 2 times, most recently from 0df7e17 to a3847c7 Compare December 20, 2023 20:01
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bd10c5a) 95.12% compared to head (5eb5dfb) 95.13%.
Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2419      +/-   ##
==========================================
+ Coverage   95.12%   95.13%   +0.01%     
==========================================
  Files         155      156       +1     
  Lines       15443    15519      +76     
==========================================
+ Hits        14690    14764      +74     
- Misses        753      755       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

t/14-isotovideo.t Outdated Show resolved Hide resolved
t/14-isotovideo.t Outdated Show resolved Hide resolved
t/14-isotovideo.t Outdated Show resolved Hide resolved
t/14-isotovideo.t Outdated Show resolved Hide resolved
t/data/tests/tests/soft_failed_test.pm Outdated Show resolved Hide resolved
t/data/tests/tests/soft_failed_test.pm Outdated Show resolved Hide resolved
t/data/tests/tests/soft_failed_test.pm Outdated Show resolved Hide resolved
isotovideo Outdated Show resolved Hide resolved
t/14-isotovideo.t Outdated Show resolved Hide resolved
t/14-isotovideo.t Outdated Show resolved Hide resolved
t/14-isotovideo.t Outdated Show resolved Hide resolved
t/14-isotovideo.t Outdated Show resolved Hide resolved
@josegomezr
Copy link
Contributor Author

josegomezr commented Jan 4, 2024 via email

@kalikiana
Copy link
Member

There are two ways here: - do I remove the comment anole? - do I make the dummy driver create the serial0 file? Please advise.

Either is fine by me. You're already deleting the file. Feel free to leave that and just get rid of the comment.

@josegomezr josegomezr force-pushed the add_exit_on_failed_test_module branch from 26fc3d6 to 2ab2c57 Compare January 5, 2024 09:31
@perlpunk
Copy link
Contributor

perlpunk commented Jan 5, 2024

isotovideo Outdated Show resolved Hide resolved
@josegomezr josegomezr closed this Jan 5, 2024
@josegomezr josegomezr reopened this Jan 5, 2024
@josegomezr
Copy link
Contributor Author

That's a surprising error, why would openqa (a consumer) block a change to os-autoinst?

@kalikiana
Copy link
Member

That's a surprising error, why would openqa (a consumer) block a change to os-autoinst?

To spot accidental changes in the ABI. If openQA can't process isotovideo result all kinds of problems will occur.

@perlpunk
Copy link
Contributor

perlpunk commented Jan 5, 2024

The workflow could be adjusted here by just stripping the version numbers from ci-packages.txt I guess, so that it would always install the latest.

t/14-isotovideo.t Outdated Show resolved Hide resolved
@josegomezr josegomezr force-pushed the add_exit_on_failed_test_module branch from b4802c6 to 267cb9d Compare January 5, 2024 20:27
@josegomezr
Copy link
Contributor Author

Applied suggestions & squashed commits.

@josegomezr josegomezr force-pushed the add_exit_on_failed_test_module branch from 267cb9d to f7072f6 Compare January 5, 2024 20:58
@josegomezr
Copy link
Contributor Author

Ping (?)

isotovideo Outdated Show resolved Hide resolved
- Introduced a `--exit-status-from-test-results` / `-e` flag to
  `isotovideo`.

  It'll inspect the test results after a full run and compute the exit
  code from them.

  If:
  - no test results exist: exit code = 100
  - failed test results results exist: exit code = 101
    (failed result => anything different than ok or softfail)
  else
  - exit code = 0

- Documented the flags in the perl pod section.

- Unit tested with an empty distribution, a fail module distribution and
  a soft failure.

- X-mas gift: Uppercase `$return_code` to follow perl practices.

Co-authored-by: Oliver Kurz <okurz@suse.de>
Co-authored-by: Martchus <martchus@gmx.net>
@josegomezr josegomezr force-pushed the add_exit_on_failed_test_module branch from 2ba161c to 5eb5dfb Compare January 9, 2024 16:31
@josegomezr josegomezr requested a review from okurz January 9, 2024 17:02
@mergify mergify bot merged commit e3cee62 into os-autoinst:master Jan 10, 2024
15 checks passed
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 this pull request may close these issues.

None yet

6 participants