separate conformance suite on CI.
This commit is contained in:
parent
b9d67296ef
commit
f1c452754f
@ -146,6 +146,10 @@ jobs:
|
||||
description: |
|
||||
Upload coverage report to https://codecov.io/. Requires the codecov API token to be
|
||||
set as an environment variable for private projects.
|
||||
skip-conformance:
|
||||
type: string
|
||||
default: "0"
|
||||
description: "Skip conformance tests (default: no)."
|
||||
executor: << parameters.executor >>
|
||||
steps:
|
||||
- install-deps
|
||||
@ -161,6 +165,7 @@ jobs:
|
||||
name: go test
|
||||
environment:
|
||||
LOTUS_TEST_WINDOW_POST: << parameters.winpost-test >>
|
||||
SKIP_CONFORMANCE: << parameters.skip-conformance >>
|
||||
command: |
|
||||
mkdir -p /tmp/test-reports/<< parameters.test-suite-name >>
|
||||
mkdir -p /tmp/test-artifacts
|
||||
@ -191,6 +196,8 @@ jobs:
|
||||
<<: *test
|
||||
test-window-post:
|
||||
<<: *test
|
||||
test-conformance:
|
||||
<<: *test
|
||||
|
||||
build-macos:
|
||||
description: build darwin lotus binary
|
||||
@ -326,17 +333,24 @@ workflows:
|
||||
- test:
|
||||
codecov-upload: true
|
||||
test-suite-name: full
|
||||
skip-conformance: "1"
|
||||
- test-window-post:
|
||||
go-test-flags: "-run=TestWindowedPost"
|
||||
skip-conformance: "1"
|
||||
winpost-test: "1"
|
||||
test-suite-name: window-post
|
||||
- test-short:
|
||||
go-test-flags: "--timeout 10m --short"
|
||||
test-suite-name: short
|
||||
skip-conformance: "1"
|
||||
filters:
|
||||
tags:
|
||||
only:
|
||||
- /^v\d+\.\d+\.\d+$/
|
||||
- test-conformance:
|
||||
test-suite-name: conformance
|
||||
packages: "./conformance"
|
||||
skip-conformance: "0"
|
||||
- build-debug
|
||||
- build-all:
|
||||
requires:
|
||||
|
@ -24,12 +24,12 @@ 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.
|
||||
@ -37,11 +37,15 @@ var (
|
||||
".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")
|
||||
if strings.TrimSpace(os.Getenv("SKIP_CONFORMANCE")) == "1" {
|
||||
skip = true
|
||||
}
|
||||
}
|
||||
|
||||
// TestConformance is the entrypoint test that runs all test vectors found
|
||||
@ -51,6 +55,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 {
|
||||
|
Loading…
Reference in New Issue
Block a user