From 9123bc0fc3e59e19cb719a35197a232fe99412d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Sun, 16 Aug 2020 22:22:12 +0100 Subject: [PATCH] separate conformance suite on CI. --- .circleci/config.yml | 10 ++++++++-- conformance/runner_test.go | 13 +++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b304da90ab..658093742df 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -191,6 +191,8 @@ jobs: <<: *test test-window-post: <<: *test + test-conformance: + <<: *test build-macos: description: build darwin lotus binary @@ -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: diff --git a/conformance/runner_test.go b/conformance/runner_test.go index edccc2a78a3..28021ac4da7 100644 --- a/conformance/runner_test.go +++ b/conformance/runner_test.go @@ -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,13 @@ 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") + 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 @@ -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 {