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

ci: setup miri #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ci: setup miri #74

wants to merge 1 commit into from

Conversation

seqre
Copy link
Contributor

@seqre seqre commented Nov 20, 2024

db and password_hash tests would not finish, investigating why can be a future endeavor

@seqre seqre requested review from m4tx and Iipin November 20, 2024 08:53
@seqre seqre self-assigned this Nov 20, 2024
@seqre seqre force-pushed the miri branch 3 times, most recently from 584e681 to 6f57813 Compare November 20, 2024 09:05
@seqre seqre linked an issue Nov 20, 2024 that may be closed by this pull request
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Flag Coverage Δ
rust 82.65% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
flareon-cli/tests/migration_generator.rs 100.00% <ø> (ø)
flareon-macros/src/dbtest.rs 90.24% <100.00%> (+0.24%) ⬆️
flareon-macros/tests/compile_tests.rs 100.00% <ø> (ø)
flareon/src/lib.rs 57.00% <ø> (ø)
flareon/src/static_files.rs 95.26% <ø> (ø)
flareon/tests/flareon_project.rs 89.47% <ø> (ø)
flareon/tests/router.rs 93.61% <ø> (ø)

🚨 Try these New Features:

run: cargo miri setup

- name: Miri test
run: cargo miri nextest run -E 'not (test(db) | test(password_hash))' --no-fail-fast --all-features
Copy link
Contributor

@m4tx m4tx Nov 20, 2024

Choose a reason for hiding this comment

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

Why are we handling this differently than other tests? We could just add #![cfg_attr(miri, ignore)] at the top of db.rs and annotate the password_hash* tests with #[cfg_attr(miri, ignore)]. This will make it easier for people wanting to run Miri tests locally instead of using the CI.

As about why password_hash tests do not work on Miri, my guess is they're just super slow. They can easily take 500ms+ on a normal debug build without Miri, so with Miri it can be easily magnified by 1000x or more. There's not much value in running these tests anyway, as this really just calls external code and does little above that.

Copy link
Contributor

@m4tx m4tx left a comment

Choose a reason for hiding this comment

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

It's kind of sad the tests are taking 8 minutes+ to run, but it is what it is, I guess. Hopefully they won't be too annoying, but given we don't use any unsafe code (for now), I would assume that if the normal tests pass, Miri tests will pass as well (except for the sqlite stuff, which is expected).

LGTM, but please address the comment in rust.yml.

@seqre
Copy link
Contributor Author

seqre commented Nov 20, 2024

It's kind of sad the tests are taking 8 minutes+ to run, but it is what it is, I guess. Hopefully they won't be too annoying, but given we don't use any unsafe code (for now), I would assume that if the normal tests pass, Miri tests will pass as well (except for the sqlite stuff, which is expected).

LGTM, but please address the comment in rust.yml.

@m4tx, I thought about reducing the number of times it runs, maybe just to tags, considering the type of testing it is. What do you think?

@m4tx
Copy link
Contributor

m4tx commented Nov 20, 2024

@seqre I think we can keep it for pushes/PRs for now, as long as a) we don't require them to pass to merge PRs and b) we don't hit the GH Actions minute limit ah I think there's no limit for public repos. Let's see how annoying they actually are!

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.

Add Miri to CI
2 participants