Skip to content

Commit

Permalink
Run e2e tests in parallel on CI (0xPolygonHermez#678)
Browse files Browse the repository at this point in the history
* Run e2e tests in parallel on CI

* make ci groups filtering more specific when running make test-full
  • Loading branch information
fgimenez authored Jun 7, 2022
1 parent fe76d34 commit 35a910d
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 4 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Test e2e
on:
push:
branches:
- main
- master
- develop
- update-external-dependencies
pull_request:
jobs:
test-e2e:
strategy:
matrix:
go-version: [ 1.17.x ]
goarch: [ "amd64" ]
e2e-group: [ 1, 2, 3]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Test
run: make test-e2e-group-${{ matrix.e2e-group }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test
name: Test non-e2e
on:
push:
branches:
Expand All @@ -8,7 +8,7 @@ on:
- update-external-dependencies
pull_request:
jobs:
test:
test-full-non-e2e:
strategy:
matrix:
go-version: [ 1.17.x ]
Expand All @@ -29,4 +29,4 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Test
run: make test-full
run: make test-full-non-e2e
26 changes: 25 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,31 @@ test: compile-scs ## Runs only short tests without checking race conditions
test-full: build-docker compile-scs ## Runs all tests checking race conditions
$(STOPDB)
$(RUNDB); sleep 7
trap '$(STOPDB)' EXIT; MallocNanoZone=0 go test -race -p 1 -timeout 600s ./...
trap '$(STOPDB)' EXIT; MallocNanoZone=0 go test -race -p 1 -timeout 600s `go list ./... | grep -v \/ci\/e2e-group`

.PHONY: test-full-non-e2e
test-full-non-e2e: build-docker compile-scs ## Runs non-e2e tests checking race conditions
$(STOPDB)
$(RUNDB); sleep 7
trap '$(STOPDB)' EXIT; MallocNanoZone=0 go test -short -race -p 1 -timeout 600s ./...

.PHONY: test-e2e-group-1
test-e2e-group-1: build-docker compile-scs ## Runs group 1 e2e tests checking race conditions
$(STOPDB)
$(RUNDB); sleep 7
trap '$(STOPDB)' EXIT; MallocNanoZone=0 go test -race -p 1 -timeout 600s ./ci/e2e-group1/...

.PHONY: test-e2e-group-2
test-e2e-group-2: build-docker compile-scs ## Runs group 2 e2e tests checking race conditions
$(STOPDB)
$(RUNDB); sleep 7
trap '$(STOPDB)' EXIT; MallocNanoZone=0 go test -race -p 1 -timeout 600s ./ci/e2e-group2/...

.PHONY: test-e2e-group-3
test-e2e-group-3: build-docker compile-scs ## Runs group 3 e2e tests checking race conditions
$(STOPDB)
$(RUNDB); sleep 7
trap '$(STOPDB)' EXIT; MallocNanoZone=0 go test -race -p 1 -timeout 600s ./ci/e2e-group3/...

.PHONY: install-linter
install-linter: ## Installs the linter
Expand Down
1 change: 1 addition & 0 deletions ci/e2e-group1/state_test.go
1 change: 1 addition & 0 deletions ci/e2e-group2/jsonrpc_test.go
1 change: 1 addition & 0 deletions ci/e2e-group3/uniswap_test.go
1 change: 1 addition & 0 deletions ci/vectors

0 comments on commit 35a910d

Please sign in to comment.