From 84ee7211ee484db803f3ff1dd4337f159c91d2f8 Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Fri, 27 Oct 2023 15:33:23 +0100 Subject: [PATCH] [CI] Ensure Move Tests are run when Move files change (#14479) ## Description Move tests are run as part of the Rust tests for the Sui Framework, but they should also be run when there are only Move changes. Surfaced because a recent PR (#14429) Moved some Move tests causing CI to fail on `main`, and this wasn't picked up because diff tests hadn't been run. ## Test Plan CI --- .github/actions/diffs/action.yml | 5 +++-- .github/workflows/rust.yml | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/actions/diffs/action.yml b/.github/actions/diffs/action.yml index 4a3c456386969..82ece52c398f3 100644 --- a/.github/actions/diffs/action.yml +++ b/.github/actions/diffs/action.yml @@ -11,8 +11,8 @@ outputs: description: True when changes happened to the Move code value: "${{ steps.diff.outputs.isMove }}" isReleaseNotesEligible: - description: True when changes happened in Release Notes eligible paths - value: "${{ steps.diff.outputs.isReleaseNotesEligible }}" + description: True when changes happened in Release Notes eligible paths + value: "${{ steps.diff.outputs.isReleaseNotesEligible }}" runs: using: composite @@ -42,6 +42,7 @@ runs: - 'crates/sui-framework-tests/**' - 'crates/sui_move/**' - 'Cargo.toml' + - 'examples/**' - 'sui_programmability/**' isReleaseNotesEligible: - 'crates/**' diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e9797ef108bca..bdd57fb057010 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -221,6 +221,22 @@ jobs: - name: check new tests for flakiness run: | scripts/simtest/stress-new-tests.sh + + # This job ensures that Move unit tests are run if there are changes + # to Move code but not Rust code (If there are Rust changes, they + # will be run as part of a larger test suite). + move-test: + needs: diff + if: needs.diff.outputs.isRust == 'false' && needs.diff.outputs.isMove == 'true' + timeout-minutes: 10 + runs-on: [ubuntu-ghcloud] + steps: + - uses: actions/checkout@v3 + - uses: taiki-e/install-action@nextest + - name: Run move tests + run: | + cargo nextest run -p sui-framework-tests -- unit_tests:: + # # Disabled # rosetta-validation: # needs: diff