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

Use test-tag crate for tagging Miri tests #711

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

d-e-s-o
Copy link
Collaborator

@d-e-s-o d-e-s-o commented Jun 5, 2024

The way we specify the tests to run under Miri is error-prone at best. Basically, we roughly group eligible tests into modules or hard code function names of suitable functions inside the CI configuration. This is prone to result in missed tests (if somebody renames a test and forgets to adjust the CI script). It is also non-obvious from the code what is happening and that makes it much less likely that new tests are onboarded to run there. Lastly, because we establish a grouping by module (to minimize maintenance burden of naming dozens of tests in the CI configuration), we end up with attributes such as #[cfg_attr(miri, ignore)] for opting out.
With this change we switch over to using the test-tag crate for tagging Miri tests as such, which will make it much easier to onboard new tests and reduces the maintenance burden down the line, because the source of truth is a single declarative attribute on the eligible tests.

The way we specify the tests to run under Miri is error-prone at best.
Basically, we roughly group eligible tests into modules or hard code
function names of suitable functions inside the CI configuration. This
is prone to result in missed tests (if somebody renames a test and
forgets to adjust the CI script). It is also non-obvious from the code
what is happening and that makes it much less likely that new tests are
onboarded to run there. Lastly, because we establish a grouping by
module (to minimize maintenance burden of naming dozens of tests in the
CI configuration), we end up with attributes such as #[cfg_attr(miri,
ignore)] for opting out.
With this change we switch over to using the test-tag crate for tagging
Miri tests as such, which will make it much easier to onboard new tests
and reduces the maintenance burden down the line, because the source of
truth is a single declarative attribute on the eligible tests.

Signed-off-by: Daniel Müller <deso@posteo.net>
Copy link

codecov bot commented Jun 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.73%. Comparing base (49b67f5) to head (c2c2928).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #711      +/-   ##
==========================================
- Coverage   94.83%   94.73%   -0.10%     
==========================================
  Files          49       49              
  Lines        9946     9730     -216     
==========================================
- Hits         9432     9218     -214     
+ Misses        514      512       -2     

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

@d-e-s-o
Copy link
Collaborator Author

d-e-s-o commented Jun 5, 2024

Before this PR, from the most recent main run:
https://github.com/libbpf/blazesym/actions/runs/9358754055/job/25761181688

main crate:

running 17 tests

(one of which is actually ignored)

capi:

running 4 tests


With this pull request:
https://github.com/libbpf/blazesym/actions/runs/9386502581/job/25847260423

main crate:

running 16 tests

capi:

running 4 tests

I verified it's the same set.

@d-e-s-o d-e-s-o merged commit 1f34797 into libbpf:main Jun 5, 2024
33 checks passed
@d-e-s-o d-e-s-o deleted the topic/test-tag branch June 5, 2024 15:06
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.

1 participant