Skip to content

Commit

Permalink
chore: fix make test (#7157)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <alex_collins@intuit.com>
  • Loading branch information
alexec committed Nov 4, 2021
1 parent 1c84286 commit 5796081
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 34 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/ci-build.yaml
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Expand Up @@ -12,8 +12,6 @@ hack/**/debug
release-notes
debug.test
git-ask-pass.sh
junit.xml
test.out
*.iml
/coverage.out
.envrc
Expand Down
13 changes: 4 additions & 9 deletions Makefile
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion hack/git/hooks/commit-msg
Expand Up @@ -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
}
Expand Down

0 comments on commit 5796081

Please sign in to comment.