Skip to content

Commit

Permalink
separate conformance suite on CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed Aug 16, 2020
1 parent b9d6729 commit 9123bc0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
10 changes: 8 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ jobs:
<<: *test
test-window-post:
<<: *test
test-conformance:
<<: *test

build-macos:
description: build darwin lotus binary
Expand Down Expand Up @@ -327,16 +329,20 @@ workflows:
codecov-upload: true
test-suite-name: full
- test-window-post:
go-test-flags: "-run=TestWindowedPost"
go-test-flags: "-run=TestWindowedPost -conformance.skip=true"
winpost-test: "1"
test-suite-name: window-post
- test-short:
go-test-flags: "--timeout 10m --short"
go-test-flags: "--timeout 10m --short -conformance.skip=true"
test-suite-name: short
filters:
tags:
only:
- /^v\d+\.\d+\.\d+$/
- test-conformance:
go-test-flags: "-conformance.skip=false"
test-suite-name: conformance
packages: "./conformance"
- build-debug
- build-all:
requires:
Expand Down
13 changes: 9 additions & 4 deletions conformance/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,26 @@ const (
// It is mounted on the Lotus repo as a git submodule.
//
// When running this test, the corpus root can be overridden through the
// -corpus.root CLI flag to run an alternate corpus.
// -conformance.corpus CLI flag to run an alternate corpus.
defaultCorpusRoot = "../extern/test-vectors/corpus"
)

var (
// corpusRoot is the effective corpus root path, taken from the `-corpus.root` CLI flag,
// corpusRoot is the effective corpus root path, taken from the `-conformance.corpus` CLI flag,
// falling back to defaultCorpusRoot if not provided.
corpusRoot string
// ignore is a set of paths relative to root to skip.
ignore = map[string]struct{}{
".git": {},
"schema.json": {},
}
skip bool
)

func init() {
// read the alternative root from the -corpus.root CLI flag.
flag.StringVar(&corpusRoot, "corpus.root", defaultCorpusRoot, "test vector corpus directory")
// read the alternative root from the -conformance.corpus CLI flag.
flag.StringVar(&corpusRoot, "conformance.corpus", defaultCorpusRoot, "test vector corpus directory")
flag.BoolVar(&skip, "conformance.skip", false, "whether to skip these tests; for shorthanding and CI")
}

// TestConformance is the entrypoint test that runs all test vectors found
Expand All @@ -51,6 +53,9 @@ func init() {
// as well as files beginning with _. It parses each file as a test vector, and
// runs it via the Driver.
func TestConformance(t *testing.T) {
if skip {
t.SkipNow()
}
var vectors []string
err := filepath.Walk(corpusRoot+"/", func(path string, info os.FileInfo, err error) error {
if err != nil {
Expand Down

0 comments on commit 9123bc0

Please sign in to comment.