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.
Prior to this change, there was no straightforward way to detect when a model was being evaluated in the context of a unit test. This PR makes it possible by augmenting the
RuntimeStage
enum with aTESTING
value.The primary reason for adding this is so that users can alter the behavior of certain macros that they don't want to run during unit test execution, eg. because they have side effects that they want to trigger only for actual DAG evaluations.
The
runtime_stage
value is currently set toLOADING
(default) during a unit test run. This means that setting it to the newTESTING
value will effectively change the behavior of macros and models whose logic depends on whether theruntime_stage
value isLOADING
, but only in the context of unit tests.I think this should generally be ok, but I've marked the PR as breaking just to be safe.