From f8de094c63a01016c2e713e55288ffe1d7ccadc1 Mon Sep 17 00:00:00 2001 From: Michal Nazarewicz Date: Thu, 12 Oct 2023 17:34:31 +0200 Subject: [PATCH] =?UTF-8?q?anchor:=20configure=20=E2=80=98anchor=20test?= =?UTF-8?q?=E2=80=99=20to=20actually=20run=20anchor=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce a convention where Anchor test names start with ‘anchor_’ thus making it easy to select all of them. Because they fail when run via normal ‘cargo test’ invocation, they are set as ignored so ‘anchor test’ command has to be configured to include ignored tests. --- .github/workflows/master.yml | 2 +- Anchor.toml | 3 +-- solana/solana-ibc/programs/solana-ibc/src/tests.rs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 10c72431..b9ffdf8c 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -67,4 +67,4 @@ jobs: components: miri - name: Run tests with Miri - run: cargo miri test -- --skip ::stress_test + run: cargo miri test -- --skip ::stress_test --skip ::anchor diff --git a/Anchor.toml b/Anchor.toml index 332c217f..56e4887f 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -20,5 +20,4 @@ wallet = "~/.config/solana/id.json" [scripts] # test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" -test = "cargo test -- --nocapture" - +test = "cargo test --lib -- --nocapture --include-ignored ::anchor" diff --git a/solana/solana-ibc/programs/solana-ibc/src/tests.rs b/solana/solana-ibc/programs/solana-ibc/src/tests.rs index d806ffe6..780047a7 100644 --- a/solana/solana-ibc/programs/solana-ibc/src/tests.rs +++ b/solana/solana-ibc/programs/solana-ibc/src/tests.rs @@ -46,7 +46,7 @@ fn create_mock_client_and_cs_state() -> (MockClientState, MockConsensusState) { #[test] #[ignore = "Requires local validator to run"] -fn test_deliver() -> Result<()> { +fn anchor_test_deliver() -> Result<()> { let authority = Rc::new(Keypair::new()); println!("This is pubkey {}", authority.pubkey().to_string()); let lamports = 10_000_000_000;