Skip to content
Merged
55 changes: 51 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,34 @@
go-version-file: ./go.mod
- name: Run unit test
run: make test-cover
- name: upload coverage report
uses: codecov/codecov-action@v5.4.3
- name: Upload unit test coverage report
uses: actions/upload-artifact@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
name: unit-test-coverage-report-${{ github.sha }}
path: ./coverage.txt

integration_test:
name: Run Integration Tests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: set up go
uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- name: Run integration test
run: make test-integration-cover
- name: Upload integration test coverage report
uses: actions/upload-artifact@v4
with:
name: integration-test-coverage-report-${{ github.sha }}
path: ./node/coverage.txt

e2e-tests:
name: Run E2E System Tests
needs: build_all-apps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -96,6 +116,7 @@

evm-tests:
name: Run EVM Execution Tests
needs: build_all-apps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -105,3 +126,29 @@
go-version-file: ./go.mod
- name: EVM Tests
run: make test-evm

combine_and_upload_coverage:
name: Combine and Upload Coverage
needs: [unit_test, integration_test]
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@v4
- name: Download unit test coverage report
uses: actions/download-artifact@v4
with:
name: unit-test-coverage-report-${{ github.sha }}
path: ./unit-coverage
- name: Download integration test coverage report
uses: actions/download-artifact@v4
with:
name: integration-test-coverage-report-${{ github.sha }}
path: ./integration-coverage
- name: Upload combined coverage report
uses: codecov/codecov-action@v5.4.3
Comment thread Fixed

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium test

Unpinned 3rd party Action 'Tests / Code Coverage' step
Uses Step
uses 'codecov/codecov-action' with ref 'v5.4.3', not a pinned commit hash
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./unit-coverage/coverage.txt,./integration-coverage/coverage.txt
flags: combined
2 changes: 2 additions & 0 deletions node/execution_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !integration

package node

import (
Expand Down
2 changes: 2 additions & 0 deletions node/full_node_integration_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration

package node

import (
Expand Down
2 changes: 2 additions & 0 deletions node/full_node_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !integration

package node

import (
Expand Down
1 change: 1 addition & 0 deletions node/helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:unused
package node

import (
Expand Down
1 change: 1 addition & 0 deletions node/helpers_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:unused
package node

import (
Expand Down
2 changes: 2 additions & 0 deletions node/single_sequencer_integration_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build integration

package node

import (
Expand Down
2 changes: 2 additions & 0 deletions node/single_sequencer_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !integration

package node

import (
Expand Down
19 changes: 12 additions & 7 deletions scripts/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,26 @@ clean-testcache:
## test: Running unit tests for all go.mods
test:
@echo "--> Running unit tests"
@go run -tags=run scripts/test.go
@go run -tags='run integration' scripts/test.go
.PHONY: test

## test-e2e: Running e2e tests
test-integration:
@echo "--> Running e2e tests"
@cd node && go test -mod=readonly -failfast -timeout=15m -tags='integration' ./...
.PHONY: test-integration

## test-e2e: Running e2e tests
test-e2e: build build-da build-evm-single
@echo "--> Running e2e tests"
@cd test/e2e && go test -mod=readonly -failfast -timeout=15m -tags='e2e evm' ./... --binary=$(CURDIR)/build/testapp --evm-binary=$(CURDIR)/build/evm-single
.PHONY: test-e2e

## cover: generate to code coverage report.
cover:
@echo "--> Generating Code Coverage"
@go install github.com/ory/go-acc@latest
@go-acc -o coverage.txt ./...
.PHONY: cover
## test-integration-cover: generate code coverage report for integration tests.
test-integration-cover:
@echo "--> Running integration tests with coverage"
@cd node && go test -mod=readonly -failfast -timeout=15m -tags='integration' -coverprofile=coverage.txt -covermode=atomic ./...
.PHONY: test-integration-cover

## test-cover: generate code coverage report.
test-cover:
Expand Down
Loading