Skip to content

Commit

Permalink
exclude archives when testing urls for now
Browse files Browse the repository at this point in the history
Signed-off-by: Adrien Duermael <adrien@duermael.com>
  • Loading branch information
aduermael committed Dec 27, 2016
1 parent 09d4a6f commit 4cbff2c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/src/validator/html_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"golang.org/x/net/html"
"os"
"path/filepath"
"regexp"
"strings"
"testing"
)
Expand All @@ -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)
}
Expand All @@ -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
Expand Down

0 comments on commit 4cbff2c

Please sign in to comment.