Skip to content

Commit

Permalink
Make is:tentative match tentative directories
Browse files Browse the repository at this point in the history
Per https://web-platform-tests.org/writing-tests/file-names.html,
tentative can be set at a directory level via the directory being
called "tentative".
  • Loading branch information
gsnedders committed Oct 11, 2024
1 parent 2c02b06 commit a323b95
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 13 deletions.
2 changes: 1 addition & 1 deletion api/query/cache/index/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func (q MetadataQuality) Filter(t TestID) bool {
return false
}

return strings.Contains(name, ".tentative.")
return strings.Contains(name, ".tentative.") || strings.Contains(name, "/tentative/")
case query.MetadataQualityOptional:
// is:optional only returns rows from tests with .optional.
// in their name. See
Expand Down
50 changes: 38 additions & 12 deletions api/query/cache/index/index_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,14 @@ func TestBindExecute_IsTentative(t *testing.T) {
Test: "/a/b/c.tentative.html",
Status: "PASS",
},
{
Test: "/a/b/tentative/c",
Status: "PASS",
},
{
Test: "/a/b/tentative/c.tentative.html",
Status: "PASS",
},
},
},
},
Expand All @@ -1050,20 +1058,38 @@ func TestBindExecute_IsTentative(t *testing.T) {
srs, ok := res.([]shared.SearchResult)
assert.True(t, ok)

assert.Equal(t, 1, len(srs))
expectedResult := shared.SearchResult{
Test: "/a/b/c.tentative.html",
LegacyStatus: []shared.LegacySearchRunResult{
{
Passes: 1,
Total: 1,
Status: "",
NewAggProcess: true,
assert.Equal(t, 3, len(srs))
assert.Equal(t, resultSet(t, []shared.SearchResult{
{
Test: "/a/b/c.tentative.html",
LegacyStatus: []shared.LegacySearchRunResult{
{
Passes: 1,
Total: 1,
Status: "",
NewAggProcess: true,
},
},
Test: "/a/b/tentative/c.html",
LegacyStatus: []shared.LegacySearchRunResult{
{
Passes: 1,
Total: 1,
Status: "",
NewAggProcess: true,
},
},
Test: "/a/b/tentative/c.tentative.html",
LegacyStatus: []shared.LegacySearchRunResult{
{
Passes: 1,
Total: 1,
Status: "",
NewAggProcess: true,
},
},
},
}

assert.Equal(t, expectedResult, srs[0])
}), resultSet(t, srs))
}

func TestBindExecute_IsOptional(t *testing.T) {
Expand Down

0 comments on commit a323b95

Please sign in to comment.