this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

all: do not use Default/Dev/Experiment evaluator versions in tests

These are moving targets; in particular, Default is now flipping from
evalv2 to evalv3, so if any tests want to specifically test
the old versus new evaluators, they should use the specific and
unmoving EvalV2 and EvalV3 constants.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I3f2987cb7a84c2a45654ed8252149922bcaf2576
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1212503
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Matthew Sackman <matthew@cue.works>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+13 -12
+5 -5
internal/core/adt/eval_test.go
··· 44 44 todo = flag.Bool("todo", false, "run tests marked with #todo-compile") 45 45 ) 46 46 47 - // TestEval tests the default implementation of the evaluator. 48 - func TestEval(t *testing.T) { 47 + // TestEvalV2 tests the old implementation of the evaluator. 48 + func TestEvalV2(t *testing.T) { 49 49 test := cuetxtar.TxTarTest{ 50 50 Root: "../../../cue/testdata", 51 51 Name: "eval", ··· 61 61 } 62 62 63 63 test.Run(t, func(tc *cuetxtar.Test) { 64 - runEvalTest(tc, internal.DefaultVersion, flags) 64 + runEvalTest(tc, internal.EvalV2, flags) 65 65 }) 66 66 } 67 67 ··· 74 74 "cycle/patterns": "cycle detection in v2", 75 75 } 76 76 77 - func TestEvalAlpha(t *testing.T) { 77 + func TestEvalV3(t *testing.T) { 78 78 // TODO: remove use of externalDeps for processing. Currently, enabling 79 79 // this would fix some issues, but also introduce some closedness bugs. 80 80 // As a first step, we should ensure that the temporary hack of using ··· 109 109 } 110 110 ran++ 111 111 112 - errorCount += runEvalTest(t, internal.DevVersion, flags) 112 + errorCount += runEvalTest(t, internal.EvalV3, flags) 113 113 }) 114 114 115 115 t.Logf("todo: %d, ran: %d, skipped: %d, nodeErrors: %d",
+1 -1
internal/core/adt/sched_test.go
··· 61 61 // TestScheduler tests the non-CUE specific scheduler functionality. 62 62 func TestScheduler(t *testing.T) { 63 63 ctx := &OpContext{ 64 - Version: internal.DefaultVersion, 64 + Version: internal.EvalV2, 65 65 taskContext: taskContext{ 66 66 counterMask: c1AllAncestorsProcessed | c2ArcTypeKnown | c3ValueKnown | c4ScalarKnown, 67 67 complete: func(s *scheduler) condition { return 0 },
+7 -6
internal/cuetdtest/matrix.go
··· 52 52 return (*runtime.Runtime)(t.CueContext()) 53 53 } 54 54 55 + // TODO(mvdan): the default should now be evalv3. 55 56 const DefaultVersion = "v2" 56 57 57 58 type Matrix []M 58 59 59 60 var FullMatrix Matrix = []M{{ 60 61 name: DefaultVersion, 61 - version: internal.DefaultVersion, 62 + version: internal.EvalV2, 62 63 }, { 63 64 name: "v3", 64 65 fallback: "v2", 65 - version: internal.DevVersion, 66 + version: internal.EvalV3, 66 67 Flags: cuedebug.Config{Sharing: true}, 67 68 }, { 68 69 name: "v3-noshare", 69 70 fallback: "v2", 70 - version: internal.DevVersion, 71 + version: internal.EvalV3, 71 72 }} 72 73 73 74 var SmallMatrix Matrix = FullMatrix[:2] ··· 94 95 } 95 96 96 97 func (m *M) TODO_V2(t testing.TB) { 97 - if m.version == internal.DefaultVersion { 98 + if m.version == internal.EvalV2 { 98 99 t.Skip("Skipping v2") 99 100 } 100 101 } 101 102 102 103 func (m *M) TODO_V3(t testing.TB) { 103 - if m.version == internal.DevVersion { 104 + if m.version == internal.EvalV3 { 104 105 t.Skip("Skipping v3") 105 106 } 106 107 } ··· 112 113 } 113 114 114 115 func (m *M) TODO_NoSharing(t testing.TB) { 115 - if m.version == internal.DevVersion && !m.Flags.Sharing { 116 + if m.version == internal.EvalV3 && !m.Flags.Sharing { 116 117 t.Skip("Skipping v3 without sharing") 117 118 } 118 119 }