Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@testset Scope #174

Open
lukem12345 opened this issue Nov 6, 2023 · 1 comment
Open

@testset Scope #174

lukem12345 opened this issue Nov 6, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@lukem12345
Copy link
Member

During last week's hackathon, a non-negligible amount of developer time was spent tracking down the following error:

  • A @test was written which assigned a local variable the name d
  • A later test loaded CombinatorialSpaces with using CombinatorialSpaces
  • CombinatorialSpaces exports a function for the exterior derivative d
  • Later code trying to allocate an exterior derivative matrix threw an unhelpful error message
  • Moving the order of the @testsets meant that a helpful error message was thrown at the line where the local variable d was declared

Errors in our test suite should not depend on the order in which testsets are included. Each testset should be contained.

So, we should look into how to prevent this behavior. I immediately want to use let ... end blocks, but it appears that there is some advice on testset scoping that I haven't fully grasped: https://discourse.julialang.org/t/testset-scoping/17025
Perhaps we have poor module management in the test suite.

@lukem12345
Copy link
Member Author

On the topic of test management, we should consider executing testsets in parallel. In the best case this can reduce the time spent testing from sum(time.(tests)) to maxmimum(time.(tests)).

@lukem12345 lukem12345 added the enhancement New feature or request label Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant