From 4cbff2cb39a38f9c978786d73fe9c93f12d3d70b Mon Sep 17 00:00:00 2001 From: Adrien Duermael Date: Wed, 14 Dec 2016 11:02:34 -0800 Subject: [PATCH] exclude archives when testing urls for now Signed-off-by: Adrien Duermael --- tests/src/validator/html_test.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) 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