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

sanitycheck: support 'skipped' in 'passed' field in sanitycheck.csv #22950

Closed

Conversation

galak
Copy link
Collaborator

@galak galak commented Feb 19, 2020

Currently the passed field is either 'True' or 'False'. However when we
run tests we also have the option of skipping tests for various reasons.
Currently we treat 'skipped' tests as 'True'.

There are a few cases in which we load sanitycheck.csv to determine
which tests to run:

  1. --only-failed
  2. --load-tests
  3. --test-only

For the --test-only case the fact that we don't track 'skipped' ends up
causing usage errors. One would expect the following to be equivalent:

sanitycheck -p qemu_cortex_m0 -T samples/

vs

sanitycheck --build-only -p qemu_cortex_m0 -T samples/
sanitycheck --test-only -p qemu_cortex_m0 -T samples/

But the second will fail in --test-only since various jobs that are
meant to be skipped are re-tried.

So we can easily fix the situation by adding 'skipped' as an option in
the 'passed' field in the csv. We change --only-failed to load tests
based on the 'passed' field being 'False'. We change --load-tests and
--test-only to skip tests with the passed field being 'skipped'.

Fixes #22948

Signed-off-by: Kumar Gala kumar.gala@linaro.org

Currently the passed field is either 'True' or 'False'.  However when we
run tests we also have the option of skipping tests for various reasons.
Currently we treat 'skipped' tests as 'True'.

There are a few cases in which we load sanitycheck.csv to determine
which tests to run:

1. --only-failed
2. --load-tests
3. --test-only

For the --test-only case the fact that we don't track 'skipped' ends up
causing usage errors.  One would expect the following to be equivalent:

   sanitycheck -p qemu_cortex_m0 -T samples/

vs

   sanitycheck --build-only -p qemu_cortex_m0 -T samples/
   sanitycheck --test-only -p qemu_cortex_m0 -T samples/

But the second will fail in --test-only since various jobs that are
meant to be skipped are re-tried.

So we can easily fix the situation by adding 'skipped' as an option in
the 'passed' field in the csv.  We change --only-failed to load tests
based on the 'passed' field being 'False'.  We change --load-tests and
--test-only to skip tests with the passed field being 'skipped'.

Fixes zephyrproject-rtos#22948

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
@galak galak requested a review from nashif as a code owner February 19, 2020 18:00
@galak galak added this to the v2.2.0 milestone Feb 19, 2020
@galak galak added area: Sanitycheck Sanitycheck has been renamed to Twister bug The issue is a bug, or the PR is fixing a bug labels Feb 19, 2020
@@ -2688,6 +2688,8 @@ class TestSuite:
for row in cr:
if row["arch"] == "arch":
continue
if row["passed"] == "skipped":
Copy link
Member

Choose a reason for hiding this comment

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

it is not a good idea to have boolean values mixed with literals. I do not like the binary column called passed, I'd rather change this column completely and call it status (we have that already) and put the right status in it. Let me spend some time and clean this up for real. I thought I fixed this already, because it did annoy me at some point, seems like I missed it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good. I'd prefer to rename the field to status as well!

@jhedberg jhedberg modified the milestones: v2.2.0, v2.3.0 Mar 10, 2020
@nashif
Copy link
Member

nashif commented Mar 10, 2020

Fix available in #23374

@nashif
Copy link
Member

nashif commented Mar 10, 2020

closing, obsoleted by #23374

@nashif nashif closed this Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Sanitycheck Sanitycheck has been renamed to Twister bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sanitycheck --build-only followed by --test-only fails
3 participants