1
0
mirror of https://github.com/go-task/task.git synced 2025-06-23 00:38:19 +02:00

feat: experiments logging improvements (#2049)

* feat: warn when enabling inactive experiments

* feat: TASK_ environment prefix

* feat: calculate experiment enabled/active instead of storing

* refactor: rename GetTaskVar to GetTaskEnv

* feat: experiments tests
This commit is contained in:
Pete Davison
2025-02-08 23:02:51 +00:00
committed by GitHub
parent be81885835
commit 6ce798e16c
12 changed files with 259 additions and 82 deletions

View File

@ -3327,12 +3327,11 @@ func TestVarInheritance(t *testing.T) {
// because the experiment settings are parsed during experiments.init(), before any tests run.
func enableExperimentForTest(t *testing.T, e *experiments.Experiment, val string) {
t.Helper()
prev := *e
*e = experiments.Experiment{
Name: prev.Name,
Enabled: true,
Value: val,
Name: prev.Name,
AllowedValues: []string{val},
Value: val,
}
t.Cleanup(func() { *e = prev })
}