Tooling for separating allocation and coverage tests

I understand that running tests with coverage makes information from @allocated etc unreliable.

I have found various clever workarounds which, generally

  1. run two sets of tests, with and without coverage, by setting build_is_production_build: true in the actions file,
  2. in the tests code on the Julia side, check for the env variable BUILD_IS_PRODUCTION_BUILD,
  3. only run allocation tests when this is set.

This is manageable, but seems a bit convoluted, and I would be essentially copy-pasting a bits of code in various places. Is that the best solution, or is there a more streamlined alternative?

3 Likes

See relevant discussion in the PR that introduced the workaround:

1 Like