From 5796081cd1f400a8a73301e078e6ffa9b51c33d8 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Wed, 3 Nov 2021 17:41:25 -0700 Subject: [PATCH] chore: fix `make test` (#7157) Signed-off-by: Alex Collins --- .github/workflows/ci-build.yaml | 22 ---------------------- .gitignore | 2 -- Makefile | 13 ++++--------- hack/git/hooks/commit-msg | 2 +- 4 files changed, 5 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index fd0f5d1afe12..edf327a98821 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -29,10 +29,6 @@ jobs: restore-keys: | ${{ runner.os }}-go- - run: make test STATIC_FILES=false GOTEST='go test -covermode=atomic -coverprofile=coverage.out' - - uses: actions/upload-artifact@v2 - with: - name: test-results - path: junit.xml # engineers just ignore this in PRs, so lets not even run it - run: bash <(curl -s https://codecov.io/bash) if: github.ref == 'refs/heads/master' @@ -155,28 +151,10 @@ jobs: - run: make wait timeout-minutes: 4 - run: make ${{matrix.test}} E2E_TIMEOUT=1m STATIC_FILES=false - - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.test }}-results - path: junit.xml - name: cat argo.log if: ${{ failure() }} run: cat /tmp/log/argo-e2e/argo.log - # https://github.com/marketplace/actions/publish-unit-test-results - publish-test-results: - name: "Publish Test Results" - needs: [ tests, e2e-tests ] - runs-on: ubuntu-latest - if: ${{ always() }} - steps: - - uses: actions/download-artifact@v2 - with: - path: artifacts - - uses: EnricoMi/publish-unit-test-result-action@v1 - with: - files: artifacts/**/junit.xml - codegen: name: Codegen runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index ba45965e7d3b..e93a509b5056 100644 --- a/.gitignore +++ b/.gitignore @@ -12,8 +12,6 @@ hack/**/debug release-notes debug.test git-ask-pass.sh -junit.xml -test.out *.iml /coverage.out .envrc diff --git a/Makefile b/Makefile index 0829f0623bdf..eb1872404ab9 100644 --- a/Makefile +++ b/Makefile @@ -379,14 +379,10 @@ lint: server/static/files.go $(GOPATH)/bin/golangci-lint # Lint Go files $(GOPATH)/bin/golangci-lint run --fix --verbose -$(GOPATH)/bin/go-junit-report: - go install github.com/jstemmer/go-junit-report@v0.9.1 - # for local we have a faster target that prints to stdout, does not use json, and can cache because it has no coverage .PHONY: test -test: server/static/files.go dist/argosay $(GOPATH)/bin/go-junit-report - env KUBECONFIG=/dev/null $(GOTEST) 2>&1 | tee test.out - cat test.out | go-junit-report > junit.xml +test: server/static/files.go dist/argosay + env KUBECONFIG=/dev/null $(GOTEST) ./... .PHONY: install install: githooks @@ -476,9 +472,8 @@ test-e2e: test-api test-cli test-cron test-executor test-functional test-cli: ./dist/argo -test-%: $(GOPATH)/bin/go-junit-report - go test -v -timeout 15m -count 1 --tags $* -parallel 10 ./test/e2e 2>&1 | tee test.out - cat test.out | go-junit-report > junit.xml +test-%: + go test -v -timeout 15m -count 1 --tags $* -parallel 10 ./test/e2e .PHONY: test-examples test-examples: ./dist/argo diff --git a/hack/git/hooks/commit-msg b/hack/git/hooks/commit-msg index 5ea0ef6e5b4d..33478f4d19e1 100755 --- a/hack/git/hooks/commit-msg +++ b/hack/git/hooks/commit-msg @@ -6,7 +6,7 @@ grep -q 'Signed-off-by: ' "$1" || { exit 1 } -grep -qE '^(?:feat|fix|docs|style|refactor|perf|test|chore)\(?(?:\w+|\s|\-|_)?\)?:\s\w+' "$1" || grep -q 'Merge' "$1" || { +grep -qE '^(?:feat|fix|docs|style|refactor|perf|test|chore)\(?(?:\w+|\s|\-|_)?\)?!?:\s\w+' "$1" || grep -q 'Merge' "$1" || { echo >&2 'Commit message must be semantic: https://github.com/zeke/semantic-pull-requests' exit 1 }