Skip to content

Commit 4cbff2c

Browse files
committed
exclude archives when testing urls for now
Signed-off-by: Adrien Duermael <adrien@duermael.com>
1 parent 09d4a6f commit 4cbff2c

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tests/src/validator/html_test.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"golang.org/x/net/html"
88
"os"
99
"path/filepath"
10+
"regexp"
1011
"strings"
1112
"testing"
1213
)
@@ -23,6 +24,16 @@ func TestURLs(t *testing.T) {
2324

2425
relPath := strings.TrimPrefix(path, "/usr/src/app/allvbuild")
2526

27+
isArchive, err := regexp.MatchString(`^/v[0-9]+\.[0-9]+/.*`, relPath)
28+
if err != nil {
29+
t.Error(err.Error(), "-", relPath)
30+
}
31+
// skip archives for now, only test URLs in current version
32+
// TODO: test archives
33+
if isArchive {
34+
return nil
35+
}
36+
2637
if err != nil {
2738
t.Error(err.Error(), "-", relPath)
2839
}
@@ -44,9 +55,9 @@ func TestURLs(t *testing.T) {
4455
return nil
4556
})
4657

47-
fmt.Println("found", count, "html files")
48-
fmt.Println("found", countLinks, "links")
49-
fmt.Println("found", countImages, "images")
58+
fmt.Println("found", count, "html files (excluding archives)")
59+
fmt.Println("found", countLinks, "links (excluding archives)")
60+
fmt.Println("found", countImages, "images (excluding archives)")
5061
}
5162

5263
// testURLs tests if we're not using absolute paths for URLs

0 commit comments

Comments
 (0)