Use of environment variables is confusing with tests #3683
Replies: 3 comments 4 replies
-
The fake-activation-heights test is an exception, the test requires changing some constants and we can only do that at build time. Our We could change the constants to be just variables so that we can change them at runtime. There was an issue for that but we recently closed it because it didn't seem required. But if you think it's getting in the way we can revisit that decision. The Maybe we can fix this just by better documenting everything. Let's see what the rest of the team thinks. |
Beta Was this translation helpful? Give feedback.
-
Testing GoalsThese goals make it easier for developers to work on Zebra:
Moving to runtime environmental variables can help us achieve all these goals. Modifying Test BehaviourSometimes we want to skip tests by default, but activate them when we know we have the required setup. Runtime environmental variables can be set for the test command, and propagate to sub-commands. So they are the easiest way to change test behaviour. (We also use them to disable tests in unusually restricted environments, like no network, or no IPv6.) But using both So can test filters and environmental variables. Let's use runtime environmental variables when we write new tests, or change old tests. Modifying
|
Beta Was this translation helpful? Give feedback.
-
@gustavovalverde was this resolved? |
Beta Was this translation helpful? Give feedback.
-
I don't know if there's a better way to filter tests or execute specific tests we want to run isolated, but the combination of variables, annotations like
#[ignore]
and configuration parameters can get very confusing to know which tests are actually being run.A good example is: https://cs.github.com/ZcashFoundation/zebra?q=TEST_FAKE_ACTIVATION_HEIGHTS
I'm not sure if there's a better way to handle this, by filtering, excluding or selecting specific test using
--test
--skip
--ignored
--exclude
or any other variation to exclude or include specific tests could be more "standard" as shown here: https://stackoverflow.com/questions/66755529/run-cargo-test-workspace-and-exclude-one-testMaybe a naming convention for tests names, to filter group of tests.
Beta Was this translation helpful? Give feedback.
All reactions