diff --git a/tests/src/validator/html_test.go b/tests/src/validator/html_test.go index 45c5048599..f5de687ff1 100644 --- a/tests/src/validator/html_test.go +++ b/tests/src/validator/html_test.go @@ -7,6 +7,7 @@ import ( "golang.org/x/net/html" "os" "path/filepath" + "regexp" "strings" "testing" ) @@ -23,6 +24,16 @@ func TestURLs(t *testing.T) { relPath := strings.TrimPrefix(path, "/usr/src/app/allvbuild") + isArchive, err := regexp.MatchString(`^/v[0-9]+\.[0-9]+/.*`, relPath) + if err != nil { + t.Error(err.Error(), "-", relPath) + } + // skip archives for now, only test URLs in current version + // TODO: test archives + if isArchive { + return nil + } + if err != nil { t.Error(err.Error(), "-", relPath) } @@ -44,9 +55,9 @@ func TestURLs(t *testing.T) { return nil }) - fmt.Println("found", count, "html files") - fmt.Println("found", countLinks, "links") - fmt.Println("found", countImages, "images") + fmt.Println("found", count, "html files (excluding archives)") + fmt.Println("found", countLinks, "links (excluding archives)") + fmt.Println("found", countImages, "images (excluding archives)") } // testURLs tests if we're not using absolute paths for URLs