Commit 1ff7090a authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

ci: Combine all go tests into one job (#12474)

* ci: Combine all go tests into one job

Combines all Go tests into a single job. This allows the runner to decide how to best parallelize the tests, and simplifies our CCI config.

* remove module param

* remove dep from compat

* remove dep

* unquote

* use archival node

* attach workspace
parent 9f24084f
...@@ -828,55 +828,47 @@ jobs: ...@@ -828,55 +828,47 @@ jobs:
when: always when: always
go-test: go-test:
parameters: machine: true
module: resource_class: ethereum-optimism/latitude-1
description: Go Module Name
type: string
uses_artifacts:
description: Uses contract artifacts
type: boolean
default: false
docker:
- image: <<pipeline.parameters.ci_builder_image>>
resource_class: xlarge
circleci_ip_ranges: true
steps: steps:
- checkout - checkout
- restore_cache: - attach_workspace:
name: Restore Go modules cache at: "."
key: gomod-{{ checksum "go.sum" }}
- restore_cache:
name: Restore Go build cache
keys:
- golang-build-cache-test-<<parameters.module>>-{{ checksum "go.sum" }}
- golang-build-cache-test-
- when:
condition: <<parameters.uses_artifacts>>
steps:
- attach_workspace: { at: "." }
- run:
name: Install components
command: |
go version
go install gotest.tools/gotestsum@v1.11.0
- run:
name: prep results dir
command: mkdir -p /tmp/test-results && mkdir -p /tmp/testlogs
- run: - run:
name: run tests name: run tests
command: | command: |
ENABLE_ANVIL=true SEPOLIA_RPC_URL="https://ci-sepolia-l1.optimism.io" gotestsum --format=testname --junitfile=/tmp/test-results/<<parameters.module>>.xml --jsonfile=/tmp/testlogs/log.json \ mkdir -p ./tmp/test-results && mkdir -p ./tmp/testlogs
-- -parallel=8 -coverpkg=github.com/ethereum-optimism/optimism/... -coverprofile=coverage.out ./...
working_directory: <<parameters.module>> packages=(
- save_cache: op-batcher
name: Save Go build cache op-chain-ops
key: golang-build-cache-test-<<parameters.module>>-{{ checksum "go.sum" }} op-node
paths: op-proposer
- "/root/.cache/go-build" op-challenger
op-dispute-mon
op-conductor
op-program
op-service
op-supervisor
packages/contracts-bedrock/scripts/checks/semver-natspec
)
formatted_packages=""
for package in "${packages[@]}"; do
formatted_packages="$formatted_packages ./$package/..."
done
export ENABLE_ANVIL=true
export SEPOLIA_RPC_URL="https://ci-sepolia-l1-archive.optimism.io"
gotestsum --format=testname \
--junitfile=./tmp/test-results/results.xml \
--jsonfile=./tmp/testlogs/log.json \
-- -coverpkg=github.com/ethereum-optimism/optimism/... \
-coverprofile=coverage.out $formatted_packages
- store_test_results: - store_test_results:
path: /tmp/test-results path: ./tmp/test-results
- store_artifacts: - store_artifacts:
path: /tmp/testlogs path: ./tmp/testlogs
when: always when: always
go-e2e-test: go-e2e-test:
...@@ -1355,30 +1347,8 @@ workflows: ...@@ -1355,30 +1347,8 @@ workflows:
uses_artifacts: true uses_artifacts: true
requires: ["go-mod-download", "contracts-bedrock-build"] requires: ["go-mod-download", "contracts-bedrock-build"]
- go-test: - go-test:
name: <<matrix.module>>-tests name: go-test-all
requires: requires:
- go-mod-download
matrix:
parameters:
module:
- op-batcher
- op-node
- op-proposer
- op-challenger
- op-dispute-mon
- op-conductor
- op-program
- op-service
- op-supervisor
- go-test:
name: semver-natspec-tests
module: packages/contracts-bedrock/scripts/checks/semver-natspec
- go-test:
name: op-chain-ops-tests
module: op-chain-ops
uses_artifacts: true
requires:
- go-mod-download
- contracts-bedrock-build - contracts-bedrock-build
- go-test-kurtosis: - go-test-kurtosis:
name: op-chain-ops-integration name: op-chain-ops-integration
...@@ -1405,9 +1375,7 @@ workflows: ...@@ -1405,9 +1375,7 @@ workflows:
requires: requires:
- contracts-bedrock-build - contracts-bedrock-build
- cannon-prestate - cannon-prestate
- op-program-compat: - op-program-compat
requires:
- op-program-tests
- bedrock-go-tests: - bedrock-go-tests:
requires: requires:
- go-mod-download - go-mod-download
...@@ -1417,18 +1385,8 @@ workflows: ...@@ -1417,18 +1385,8 @@ workflows:
- check-generated-mocks-op-node - check-generated-mocks-op-node
- check-generated-mocks-op-service - check-generated-mocks-op-service
- go-mod-download - go-mod-download
- op-batcher-tests
- op-chain-ops-tests
- op-chain-ops-integration - op-chain-ops-integration
- op-node-tests
- op-proposer-tests
- op-challenger-tests
- op-dispute-mon-tests
- op-conductor-tests
- op-program-tests
- op-program-compat - op-program-compat
- op-service-tests
- op-supervisor-tests
- op-e2e-HTTP-tests - op-e2e-HTTP-tests
- op-e2e-fault-proof-tests - op-e2e-fault-proof-tests
- op-e2e-action-tests - op-e2e-action-tests
...@@ -1438,6 +1396,7 @@ workflows: ...@@ -1438,6 +1396,7 @@ workflows:
- op-program-docker-build - op-program-docker-build
- op-supervisor-docker-build - op-supervisor-docker-build
- proofs-tools-docker-build - proofs-tools-docker-build
- go-test-all
- docker-build: - docker-build:
name: <<matrix.docker_name>>-docker-build name: <<matrix.docker_name>>-docker-build
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>> docker_tags: <<pipeline.git.revision>>,<<pipeline.git.branch>>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment