Skip to content

Commit

Permalink
DSET-4430: Test also Go 1.20 (#51)
Browse files Browse the repository at this point in the history
* DSET-4430: Fix failure when running tests multiple times

* Run multiple times for every commit

* Do not fail on first failed test

* Run tests also for go 1.20

* Run tests many times only in main
  • Loading branch information
martin-majlis-s1 authored Aug 14, 2023
1 parent 8b15cc1 commit a7a85a3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ jobs:
- name: Run pre-commit
run: |
pre-commit run -a
- name: Code tests
run: |
make test
- name: Code coverage
run: |
make coverage
Expand All @@ -82,8 +79,3 @@ jobs:
- name: Check SSL Certificates
run: |
make test-ssl-certificates
- name: Run Tests Many Times
# Run test multiple times to check for flaky tests
if: github.ref_name == 'main'
run: |
make test-many-times COUNT=5
5 changes: 3 additions & 2 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
build:
strategy:
matrix:
go: ['1.19', '1.20']
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
needs: pre_job
Expand All @@ -46,7 +47,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: ${{ matrix.go }}
cache: true
cache-dependency-path: |
go.sum
Expand All @@ -60,4 +61,4 @@ jobs:
# Run test multiple times to check for flaky tests
if: github.ref_name == 'main'
run: |
make test-many-times COUNT=5
make test-many-times COUNT=2
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test-all:

.PHONY: test-many-times
test-many-times:
# set -e;
set -e; \
if [ "x$(COUNT)" == "x" ]; then \
COUNT=50; \
else \
Expand All @@ -67,9 +67,7 @@ test-many-times:
rm -rfv $${prefix}*; \
for i in `seq 1 $${COUNT}`; do \
echo "Running test $${i} / $${COUNT} - BEGIN"; \
make test 2>&1 | tee $${prefix}-$${i}.log | awk '{print "'$${i}'/'$${COUNT}'", $$0; }' ; \
echo; \
grep -H FAIL $${prefix}-$${i}.log; \
make test 2>&1 | tee $${prefix}-$${i}.log | awk '{print "'$${i}'/'$${COUNT}'", $$0; }' || exit 0; \
echo "Running test $${i} / $${COUNT} - END"; \
done; \
echo "Grep for FAIL - no lines should be found"; \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Go Reference](https://pkg.go.dev/badge/github.com/scalyr/dataset-go.svg)](https://pkg.go.dev/github.com/scalyr/dataset-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/scalyr/dataset-go)](https://goreportcard.com/report/github.com/scalyr/dataset-go)
[![Check code quality](https://github.com/scalyr/dataset-go/actions/workflows/code-quality.yaml/badge.svg)](https://github.com/scalyr/dataset-go/actions/workflows/code-quality.yaml)
[![Check code quality](https://github.com/scalyr/dataset-go/actions/workflows/unit-tests.yaml/badge.svg)](https://github.com/scalyr/dataset-go/actions/workflows/unit-tests.yaml)
[![TruffleHog Secrets Scan](https://github.com/scalyr/dataset-go/actions/workflows/secrets-scanner.yaml/badge.svg)](https://github.com/scalyr/dataset-go/actions/workflows/secrets-scanner.yaml)
[![codecov](https://codecov.io/gh/scalyr/dataset-go/branch/main/graph/badge.svg?token=IFTJDLGEF5)](https://codecov.io/gh/scalyr/dataset-go)
[![Version](https://img.shields.io/github/tag/scalyr/dataset-go.svg)](https://github.com/scalyr/dataset-go/releases)
Expand Down

0 comments on commit a7a85a3

Please sign in to comment.