diff --git a/.circleci/config.yml b/.circleci/config.yml index d41c9320..32f41d35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -65,26 +65,10 @@ jobs: executor: type: executor default: golang - go-test-flags: - type: string - default: "-timeout 5m" - description: Flags passed to go test. - packages: - type: string - default: "./..." - description: Import paths of packages to be tested. test-suite-name: type: string default: unit description: Test suite name to report to CircleCI. - gotestsum-format: - type: string - default: short - description: gotestsum format. https://github.com/gotestyourself/gotestsum#format - coverage: - type: string - default: -coverprofile=coverage.txt - description: Coverage flag. Set to the empty string to disable. codecov-upload: type: boolean default: true @@ -99,21 +83,15 @@ jobs: - restore_cache: name: restore go mod cache key: v1-go-deps-{{ arch }}-{{ checksum "/home/circleci/project/go.mod" }} - - run: - command: make build - go/install-gotestsum: gobin: $HOME/.local/bin - run: - name: go test + name: make test environment: GOTESTSUM_JUNITFILE: /tmp/test-reports/<< parameters.test-suite-name >>/junit.xml - GOTESTSUM_FORMAT: << parameters.gotestsum-format >> command: | mkdir -p /tmp/test-reports/<< parameters.test-suite-name >> - gotestsum -- \ - << parameters.coverage >> \ - << parameters.go-test-flags >> \ - << parameters.packages >> + make test no_output_timeout: 30m - store_test_results: path: /tmp/test-reports diff --git a/Makefile b/Makefile index d38f4e5f..8ce9eaf9 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,10 @@ SUBMODULES+=filestore build: $(SUBMODULES) +test: build + gotestsum -- -coverprofile=coverage.txt -timeout 5m ./... + clean: rm -f .filecoin-build rm -f .update-modules + rm -f coverage.txt \ No newline at end of file diff --git a/go.sum b/go.sum index 6a858375..236bb9ab 100644 --- a/go.sum +++ b/go.sum @@ -763,6 +763,7 @@ github.com/shirou/gopsutil v2.18.12+incompatible h1:1eaJvGomDnH74/5cF4CTmTbLHAri github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0 h1:UVQPSSmc3qtTi+zPPkCXvZX9VvW/xT/NsRvKfwY81a8= @@ -785,6 +786,7 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc=