Refactor: test files structure #1060
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background (pain point)
anchor testcan sometimes take more than an hour, since it executes the large number of tests underlegacy-sdk/whirlpool/tests.[scripts] test = ...inAnchor.tomlin order to run only certain test cases, but this is inconvenient.legacy-sdk/whirlpool/testsmakes 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 testworksThe behavior of
anchor testis to execute the test script defined in the[scripts]section ofAnchor.toml, as well as to search for and run anyTest.tomlfiles found under the root directory.By using the
--runoption, it is possible to execute only specificTest.tomlfiles.How to run anchor test
To run all test cases (no change):
To run only specific test cases:
examples:
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.