coral-xyz / anchor

âš“ Solana Sealevel Framework
https://anchor-lang.com
Apache License 2.0
3.68k stars 1.35k forks source link

tests: Test directory organisation #1626

Open tomlinton opened 2 years ago

tomlinton commented 2 years ago

It'd be nice to prefix all the test cases targeting some specific Anchor functionality with anchor-. We could eventually break out all the misc tests into this style, e.g. tests/anchor-idl-parsing, tests/anchor-cpi (probably still tests/anchor-misc 😉) etc. It'd make it easier to know where to add tests for new functionality and make it easier to audit the existing test cases to find missing ones.

Right now it isn't clear which tests are targeting Anchor features and which are example programs.

Ref https://github.com/project-serum/anchor/issues/1625, https://github.com/project-serum/anchor/issues/1624, https://github.com/project-serum/anchor/issues/1236

paul-schaaf commented 2 years ago

agreed. we should find a way to make differentiate them more clearly.

but it seems to me as if the more idiomatic solution would be to use a better directory structure instead of basically implying a directory structure through prefixes in the names.

e.g. we could put the examples into an examples directory that lives in the root or the tests directory