Skip to content

Conversation

@yugure-orca
Copy link
Collaborator

@yugure-orca yugure-orca commented Sep 11, 2025

Background (pain point)

  • Running anchor test can sometimes take more than an hour, since it executes the large number of tests under legacy-sdk/whirlpool/tests.
  • It’s common to rewrite [scripts] test = ... in Anchor.toml in order to run only certain test cases, but this is inconvenient.
  • The directory layout in legacy-sdk/whirlpool/tests makes it unsuitable for running only a subset of tests by specifying directories.

Therefore, we will change the setup to make partial execution easier.

How anchor test works

The behavior of anchor test is to execute the test script defined in the [scripts] section of Anchor.toml, as well as to search for and run any Test.toml files found under the root directory.

By using the --run option, it is possible to execute only specific Test.toml files.

How to run anchor test

To run all test cases (no change):

anchor test

To run only specific test cases:

anchor test --run anchor_tests/....

examples:

anchor test --run anchor_tests/int/adaptive-fee
anchor test --run anchor_tests/int/migration
anchor test --run anchor_tests/int/token-badge
anchor test --run anchor_tests/int/multi-ix
anchor test --run anchor_tests/int/token-extensions
anchor test --run anchor_tests/int/v1-ix
anchor test --run anchor_tests/sdk/types
anchor test --run anchor_tests/sdk/quote
anchor test --run anchor_tests/sdk/swap
anchor test --run anchor_tests/sdk/utils
anchor test --run anchor_tests/sdk/client-impl
anchor test --run anchor_tests/int/v2-ix/collect
anchor test --run anchor_tests/int/v2-ix/initialize
anchor test --run anchor_tests/int/v2-ix/liquidity
anchor test --run anchor_tests/int/v2-ix/swap
anchor test --run anchor_tests/int/v2-ix/two-hop-swap

Note for reviwer

The changes to the test files are a relocation, not modifications to the test contents.

Along with the relocation, the relative paths in the imports have been updated.

Copy link
Member

@wjthieme wjthieme left a comment

Choose a reason for hiding this comment

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

🚢

whirlpoolData,
IGNORE_CACHE,
),
oracleData: NO_ORACLE_DATA,
Copy link
Member

Choose a reason for hiding this comment

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

This one intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah, yes. it is intentional. (fix for missing required param)

whirlpoolDataTwo,
IGNORE_CACHE,
),
oracleData: NO_ORACLE_DATA,
Copy link
Member

Choose a reason for hiding this comment

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

Same for these two

@yugure-orca yugure-orca merged commit 53e6ab1 into main Sep 17, 2025
6 checks passed
@yugure-orca yugure-orca deleted the yugure/refactor-test-files-structure branch September 17, 2025 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants