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

Support running miri in ci #534

Merged
merged 6 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/buildkite-pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ all_test_steps() {
command_step checks1 "ci/docker-run-default-image.sh ci/test-checks.sh" 20 check
command_step checks2 "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh check-bins" 15 check
command_step checks3 "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh check-all-targets" 15 check
command_step miri "ci/docker-run-default-image.sh ci/test-miri.sh" 5 check
wait_step

# Full test suite
Expand Down
1 change: 1 addition & 0 deletions ci/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ RUN \
rustup install $RUST_NIGHTLY_VERSION && \
rustup component add clippy --toolchain=$RUST_NIGHTLY_VERSION && \
rustup component add rustfmt --toolchain=$RUST_NIGHTLY_VERSION && \
rustup component add miri --toolchain=$RUST_NIGHTLY_VERSION && \
rustup target add wasm32-unknown-unknown && \
cargo install cargo-audit && \
cargo install cargo-hack && \
Expand Down
8 changes: 8 additions & 0 deletions ci/test-miri.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -eo pipefail

source ci/rust-version.sh nightly

# miri is very slow; so only run very few of selective tests!
cargo "+${rust_nightly}" miri test -p solana-program -- hash:: account_info::
Copy link
Member

Choose a reason for hiding this comment

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

does the #[cfg_attr(miri)] work for this purpose? (I'm not quite understand how it select tests. try to steal your brain 😂)

Copy link
Collaborator Author

@ryoqun ryoqun Apr 2, 2024

Choose a reason for hiding this comment

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

that would need to add #[cfg_attr(miri, ignore)] to almost all tests...