Skip to content

Commit

Permalink
ci: Skip invalid miri test, avoid concurrent undsoundness checks (#870)
Browse files Browse the repository at this point in the history
- Fixes the failing unsoundness check in `main`
  https://github.com/CQCL/hugr/actions/runs/8158956607/job/22302072598
  
The test change in #852 moved the miri ignore flag, and it seems it has
to be placed after `rstest`'s cases.
  
- Adds a concurrency group for the unsoundness check.
The check currently takes around 15mins (and it will only grow as we add
more tests).
This makes it so old jobs get cancelled when pushing new changes to
main, and a new check is started.
  • Loading branch information
aborgna-q authored Mar 7, 2024
1 parent d93e795 commit 497f43c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/unsoundness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
- main
workflow_dispatch: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
Expand Down
4 changes: 2 additions & 2 deletions quantinuum-hugr/src/hugr/views/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ fn node_connections(
///
/// The first parameter `test_name` is required due to insta and rstest limitations.
/// See https://github.com/la10736/rstest/issues/183
#[cfg_attr(miri, ignore)] // Opening files is not supported in (isolated) miri
#[rstest]
#[case::dfg("dot_dfg", sample_hugr().0)]
#[case::cfg("dot_cfg", crate::builder::test::simple_cfg_hugr())]
#[case::empty_dfg("dot_empty_dfg", crate::builder::test::simple_dfg_hugr())]
#[cfg_attr(miri, ignore)] // Opening files is not supported in (isolated) miri
fn dot_string(#[case] test_name: &str, #[case] h: Hugr) {
insta::assert_yaml_snapshot!(test_name, h.dot_string());
}
Expand All @@ -78,11 +78,11 @@ fn dot_string(#[case] test_name: &str, #[case] h: Hugr) {
///
/// The first parameter `test_name` is required due to insta and rstest limitations.
/// See https://github.com/la10736/rstest/issues/183
#[cfg_attr(miri, ignore)] // Opening files is not supported in (isolated) miri
#[rstest]
#[case::dfg("mmd_dfg", sample_hugr().0)]
#[case::cfg("mmd_cfg", crate::builder::test::simple_cfg_hugr())]
#[case::empty_dfg("mmd_empty_dfg", crate::builder::test::simple_dfg_hugr())]
#[cfg_attr(miri, ignore)] // Opening files is not supported in (isolated) miri
fn mermaid_string(#[case] test_name: &str, #[case] h: Hugr) {
insta::assert_snapshot!(test_name, h.mermaid_string());
}
Expand Down

0 comments on commit 497f43c

Please sign in to comment.