this repo has no description
0
fork

Configure Feed

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

encoding/jsonschema: show optional test stats separately

There are a bunch of "optional" tests in the test suite, quite a few of
which we will never implement support for.

Show stats for those tests separately so it's clear how many of the
non-optional tests are passing/failing.

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I477295ffff2fdb4dcef443073095840e6abe1d2b
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201126
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

+33 -10
+18 -6
encoding/jsonschema/external_teststats.txt
··· 1 1 # Generated by teststats. DO NOT EDIT 2 2 v2: 3 - schema extract (pass / total): 1077 / 1637 = 65.8% 4 - tests (pass / total): 3467 / 7175 = 48.3% 5 - tests on extracted schemas (pass / total): 3467 / 3884 = 89.3% 3 + schema extract (pass / total): 923 / 1363 = 67.7% 4 + tests (pass / total): 3076 / 4803 = 64.0% 5 + tests on extracted schemas (pass / total): 3076 / 3362 = 91.5% 6 6 7 7 v3: 8 - schema extract (pass / total): 1065 / 1637 = 65.1% 9 - tests (pass / total): 3418 / 7175 = 47.6% 10 - tests on extracted schemas (pass / total): 3418 / 3840 = 89.0% 8 + schema extract (pass / total): 911 / 1363 = 66.8% 9 + tests (pass / total): 3037 / 4803 = 63.2% 10 + tests on extracted schemas (pass / total): 3037 / 3318 = 91.5% 11 + 12 + Optional tests 13 + 14 + v2: 15 + schema extract (pass / total): 154 / 274 = 56.2% 16 + tests (pass / total): 391 / 2372 = 16.5% 17 + tests on extracted schemas (pass / total): 391 / 522 = 74.9% 18 + 19 + v3: 20 + schema extract (pass / total): 154 / 274 = 56.2% 21 + tests (pass / total): 381 / 2372 = 16.1% 22 + tests on extracted schemas (pass / total): 381 / 522 = 73.0%
+15 -4
encoding/jsonschema/teststats.go
··· 25 25 "os" 26 26 "path" 27 27 "sort" 28 + "strings" 28 29 29 30 "cuelang.org/go/cue/token" 30 31 "cuelang.org/go/encoding/jsonschema/internal/externaltest" ··· 56 57 listFailures(outw, *list, tests) 57 58 } else { 58 59 fmt.Fprintf(outw, "v2:\n") 59 - showStats(outw, "v2", tests) 60 + showStats(outw, "v2", false, tests) 61 + fmt.Fprintf(outw, "\n") 62 + fmt.Fprintf(outw, "v3:\n") 63 + showStats(outw, "v3", false, tests) 64 + fmt.Fprintf(outw, "\nOptional tests\n\n") 65 + fmt.Fprintf(outw, "v2:\n") 66 + showStats(outw, "v2", true, tests) 60 67 fmt.Fprintf(outw, "\n") 61 68 fmt.Fprintf(outw, "v3:\n") 62 - showStats(outw, "v3", tests) 69 + showStats(outw, "v3", true, tests) 63 70 } 64 71 } 65 72 66 - func showStats(outw io.Writer, version string, tests map[string][]*externaltest.Schema) { 73 + func showStats(outw io.Writer, version string, showOptional bool, tests map[string][]*externaltest.Schema) { 67 74 schemaOK := 0 68 75 schemaTot := 0 69 76 testOK := 0 70 77 testTot := 0 71 78 schemaOKTestOK := 0 72 79 schemaOKTestTot := 0 73 - for _, schemas := range tests { 80 + for filename, schemas := range tests { 81 + isOptional := strings.Contains(filename, "/optional/") 82 + if isOptional != showOptional { 83 + continue 84 + } 74 85 for _, schema := range schemas { 75 86 schemaTot++ 76 87 if schema.Skip[version] == "" {