From 3c20302c76e6438064e4a6e10f18ec1066118882 Mon Sep 17 00:00:00 2001 From: martyall Date: Thu, 13 Feb 2025 11:18:12 -0800 Subject: [PATCH 1/3] remove saffron from main ci workflow, run the unit tests in the dedicated workflow --- .github/workflows/ci.yml | 1 + .github/workflows/saffron.yml | 6 +++++- Makefile | 12 ++++++------ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index daf8911052..7b2c9d89fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ env: CARGO_TERM_COLOR: always # 30 MB of stack for Keccak tests RUST_MIN_STACK: 31457280 + CARGO_EXTRA_ARGS: "--workspace --exclude saffron" jobs: run_mdbook: diff --git a/.github/workflows/saffron.yml b/.github/workflows/saffron.yml index 72fda90122..a1c20a34ce 100644 --- a/.github/workflows/saffron.yml +++ b/.github/workflows/saffron.yml @@ -9,7 +9,7 @@ on: jobs: run: - name: Run saffron e2e tests + name: Run saffron unit and e2e tests runs-on: ["ubuntu-latest"] @@ -47,6 +47,10 @@ jobs: run: | cargo build --release --bin saffron + - name: Run the saffron unit tests + run: | + SRS_FILEPATH=./srs/test_vesta.srs RUST_LOG=debug cargo test -p saffron --release -- --nocapture + - name: Run the saffron e2e encoding tests on small lorem file run: | ./saffron/e2e-test.sh saffron/fixtures/lorem.txt ./srs/test_vesta.srs diff --git a/Makefile b/Makefile index 1e6ff2f289..91bb9bec66 100644 --- a/Makefile +++ b/Makefile @@ -96,24 +96,24 @@ test-all-with-coverage: nextest: ## Test the project with non-heavy tests and using nextest test runner - cargo nextest run --all-features --release --profile ci -E "not test(heavy)" $(BIN_EXTRA_ARGS) + cargo nextest run --all-features --release $(CARGO_EXTRA_ARGS) --profile ci -E "not test(heavy)" $(BIN_EXTRA_ARGS) nextest-with-coverage: - $(COVERAGE_ENV) BIN_EXTRA_ARGS="$(BIN_EXTRA_ARGS)" $(MAKE) nextest + $(COVERAGE_ENV) CARGO_EXTRA_ARGS="$(CARGO_EXTRA_ARGS)" BIN_EXTRA_ARGS="$(BIN_EXTRA_ARGS)" $(MAKE) nextest nextest-heavy: ## Test the project with heavy tests and using nextest test runner - cargo nextest run --all-features --release --profile ci -E "test(heavy)" $(BIN_EXTRA_ARGS) + cargo nextest run --all-features --release $(CARGO_EXTRA_ARGS) --profile ci -E "test(heavy)" $(BIN_EXTRA_ARGS) nextest-heavy-with-coverage: - $(COVERAGE_ENV) BIN_EXTRA_ARGS="$(BIN_EXTRA_ARGS)" $(MAKE) nextest-heavy + $(COVERAGE_ENV) CARGO_EXTRA_ARGS="$(CARGO_EXTRA_ARGS)" BIN_EXTRA_ARGS="$(BIN_EXTRA_ARGS)" $(MAKE) nextest-heavy nextest-all: ## Test the project with all tests and using nextest test runner - cargo nextest run --all-features --release --profile ci $(BIN_EXTRA_ARGS) + cargo nextest run --all-features --release $(CARGO_EXTRA_ARGS) --profile ci $(BIN_EXTRA_ARGS) nextest-all-with-coverage: - $(COVERAGE_ENV) BIN_EXTRA_ARGS="$(BIN_EXTRA_ARGS)" $(MAKE) nextest-all + $(COVERAGE_ENV) CARGO_EXTRA_ARGS="$(CARGO_EXTRA_ARGS)" BIN_EXTRA_ARGS="$(BIN_EXTRA_ARGS)" $(MAKE) nextest-all format: ## Format the code From 7ccc97e92f4c5bbfac15b0844d6e4cea8d9b4b45 Mon Sep 17 00:00:00 2001 From: martyall Date: Thu, 13 Feb 2025 11:22:04 -0800 Subject: [PATCH 2/3] Restore name to job since it has been pinned as required --- .github/workflows/saffron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/saffron.yml b/.github/workflows/saffron.yml index a1c20a34ce..1c0ae9ca82 100644 --- a/.github/workflows/saffron.yml +++ b/.github/workflows/saffron.yml @@ -9,7 +9,7 @@ on: jobs: run: - name: Run saffron unit and e2e tests + name: Run saffron e2e tests runs-on: ["ubuntu-latest"] From a40d707c8c2d5dce2420d5e852009b8f8f0dc441 Mon Sep 17 00:00:00 2001 From: martyall Date: Thu, 13 Feb 2025 11:28:10 -0800 Subject: [PATCH 3/3] set env relative to crate --- .github/workflows/saffron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/saffron.yml b/.github/workflows/saffron.yml index 1c0ae9ca82..2e6efee0fc 100644 --- a/.github/workflows/saffron.yml +++ b/.github/workflows/saffron.yml @@ -49,7 +49,7 @@ jobs: - name: Run the saffron unit tests run: | - SRS_FILEPATH=./srs/test_vesta.srs RUST_LOG=debug cargo test -p saffron --release -- --nocapture + SRS_FILEPATH=../srs/test_vesta.srs RUST_LOG=debug cargo test -p saffron --release -- --nocapture - name: Run the saffron e2e encoding tests on small lorem file run: |