exclude archives when testing urls for now

Signed-off-by: Adrien Duermael <adrien@duermael.com>
This commit is contained in:
Adrien Duermael 2016-12-14 11:02:34 -08:00
parent 09d4a6f832
commit 4cbff2cb39
1 changed files with 14 additions and 3 deletions

View File

@ -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