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

Fix generation of failures.csv when there are only non-outcome failures #154

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

gilles-peskine-arm
Copy link
Contributor

Fix a corner case from #144 that prevents the upload of outcomes.csv when there are failed jobs but no failed test cases (e.g. all tests that compile are passing, but there are configurations where the compilation fails).

Test run:

  • development, release job (with Windows-2015 failing and causing the problem): OpenCI
  • 2.28, release job (all passing): OpenCI

If there are failed builds but no failures recorded in
outcomes.csv (for example, because all tests that can be built are
passing, but some configurations fail to compile), `grep ';FAIL;'`
returns 1. We still want to upload `outcomes.csv` in that case.

Upload an empty failures.csv file in this case. An empty file isn't
useful in itself, but having it makes looking at failed jobs a little
more uniform.

Signed-off-by: Gilles Peskine <[email protected]>
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@@ -246,7 +246,7 @@ def process_outcomes() {
// as test description or test suite was "FAIL".
if (gen_jobs.failed_builds) {
sh '''\
LC_ALL=C grep ';FAIL;' outcomes.csv >"failures.csv"
LC_ALL=C grep ';FAIL;' outcomes.csv >"failures.csv" || [ $? -eq 1 ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nice. I'd have written || true but this is more precise, it only ignores the expected error where grep returns 1 for "no match". Learned something about robust sh scripting today :)

@tom-cosgrove-arm tom-cosgrove-arm added approved Approved in review. May need additional CI. and removed needs: review needs: reviewer labels Jan 23, 2024
@mpg
Copy link
Contributor

mpg commented Jan 24, 2024

I checked the CI results and they look good: the development run has an empty failures.csv and a non-empty outcomes.csv.xz as expected.

@mpg mpg removed the needs: ci label Jan 24, 2024
@mpg mpg merged commit b490f84 into master Jan 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved in review. May need additional CI. bug Something isn't working priority-high
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants