Skip to content

Commit

Permalink
Add checks for test-level links (#2187)
Browse files Browse the repository at this point in the history
* Add checks for test-level links

* Update css/css-align/gaps/META.yml

* Update META.yml

Co-authored-by: Kyle Ju <[email protected]>
  • Loading branch information
KyleJu and Kyle Ju authored Nov 22, 2021
1 parent 6b3b7cd commit b175a91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 0 additions & 4 deletions css/css-align/gaps/META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@ links:
- test: gap-animation-002.html
- test: gap-animation-003.html
- test: gap-animation-004.html
- url: http://example.org
results:
- test: gap-animation-001.html
label: example-label1
10 changes: 10 additions & 0 deletions go_test/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func TestParseMetadata(t *testing.T) {
_, err := url.ParseRequestURI(link.URL)
assert.Nil(t, err)
assert.Greater(t, len(link.Results), 0)
if link.Product.String() == "" {
checkTestLevelLinks(t, link)
}
checkDuplicationAcrossLinks(t, link, linkMap)
resultSet := mapset.NewSet()
for _, result := range link.Results {
Expand Down Expand Up @@ -94,3 +97,10 @@ func serializeStrings(val ...string) string {

return returnVal
}

func checkTestLevelLinks(t *testing.T, link shared.MetadataLink) {
// Subtest should be empty for a test-level link.
for _, result := range link.Results {
assert.Nil(t, result.SubtestName, fmt.Sprintf("subtest should be empty for a test-level link"))
}
}

0 comments on commit b175a91

Please sign in to comment.