Commit a7fac3b7 authored by smartcontracts's avatar smartcontracts Committed by GitHub

ci: run slow Cannon test once per day (#11947)

Updates CI to run the (very) slow Cannon go-lint-and-test suite
once per day instead of running it on merge since it adds at least
5 minutes to CI.
parent 9179225d
...@@ -29,6 +29,9 @@ parameters: ...@@ -29,6 +29,9 @@ parameters:
kontrol_dispatch: kontrol_dispatch:
type: boolean type: boolean
default: false default: false
cannon_full_test_dispatch:
type: boolean
default: false
sdk_dispatch: sdk_dispatch:
type: boolean type: boolean
default: false default: false
...@@ -134,6 +137,14 @@ jobs: ...@@ -134,6 +137,14 @@ jobs:
cannon-go-lint-and-test: cannon-go-lint-and-test:
docker: docker:
- image: <<pipeline.parameters.ci_builder_image>> - image: <<pipeline.parameters.ci_builder_image>>
parameters:
skip_slow_tests:
type: boolean
default: false
notify:
description: Whether to notify on failure
type: boolean
default: false
resource_class: xlarge resource_class: xlarge
steps: steps:
- checkout - checkout
...@@ -141,6 +152,9 @@ jobs: ...@@ -141,6 +152,9 @@ jobs:
patterns: cannon,packages/contracts-bedrock/src/cannon,op-preimage,go.mod patterns: cannon,packages/contracts-bedrock/src/cannon,op-preimage,go.mod
- attach_workspace: - attach_workspace:
at: "." at: "."
- restore_cache:
name: Restore Go modules cache
key: gomod-{{ checksum "go.sum" }}
- run: - run:
name: prep Cannon results dir name: prep Cannon results dir
command: mkdir -p /tmp/test-results command: mkdir -p /tmp/test-results
...@@ -156,6 +170,7 @@ jobs: ...@@ -156,6 +170,7 @@ jobs:
- run: - run:
name: Cannon Go tests name: Cannon Go tests
command: | command: |
export SKIP_SLOW_TESTS=<<parameters.skip_slow_tests>>
mkdir -p /testlogs mkdir -p /testlogs
gotestsum --format=testname --junitfile=/tmp/test-results/cannon.xml --jsonfile=/testlogs/log.json \ gotestsum --format=testname --junitfile=/tmp/test-results/cannon.xml --jsonfile=/testlogs/log.json \
-- -parallel=8 -coverpkg=github.com/ethereum-optimism/optimism/cannon/... -coverprofile=coverage.out ./... -- -parallel=8 -coverpkg=github.com/ethereum-optimism/optimism/cannon/... -coverprofile=coverage.out ./...
...@@ -168,6 +183,11 @@ jobs: ...@@ -168,6 +183,11 @@ jobs:
- store_artifacts: - store_artifacts:
path: /testlogs path: /testlogs
when: always when: always
- when:
condition: <<parameters.notify>>
steps:
- notify-failures-on-develop:
mentions: "@proofs-squad"
cannon-build-test-vectors: cannon-build-test-vectors:
docker: docker:
...@@ -1836,6 +1856,8 @@ workflows: ...@@ -1836,6 +1856,8 @@ workflows:
- cannon-go-lint-and-test: - cannon-go-lint-and-test:
requires: requires:
- contracts-bedrock-build - contracts-bedrock-build
skip_slow_tests: true
notify: true
- cannon-build-test-vectors - cannon-build-test-vectors
- shellcheck/check: - shellcheck/check:
name: shell-check name: shell-check
...@@ -2150,6 +2172,20 @@ workflows: ...@@ -2150,6 +2172,20 @@ workflows:
- slack - slack
- runtimeverification - runtimeverification
scheduled-cannon-full-tests:
when:
or:
- equal: [ build_four_hours, <<pipeline.schedule.name>> ]
- equal: [ true, << pipeline.parameters.cannon_full_test_dispatch >> ]
jobs:
- contracts-bedrock-build:
build_command: forge build --skip test --skip scripts
- cannon-go-lint-and-test:
requires:
- contracts-bedrock-build
context:
- slack
scheduled-docker-publish: scheduled-docker-publish:
when: when:
or: or:
......
...@@ -58,6 +58,10 @@ func TestInstrumentedState_MultithreadedProgram(t *testing.T) { ...@@ -58,6 +58,10 @@ func TestInstrumentedState_MultithreadedProgram(t *testing.T) {
} }
func TestInstrumentedState_Alloc(t *testing.T) { func TestInstrumentedState_Alloc(t *testing.T) {
if os.Getenv("SKIP_SLOW_TESTS") == "true" {
t.Skip("Skipping slow test because SKIP_SLOW_TESTS is enabled")
}
const MiB = 1024 * 1024 const MiB = 1024 * 1024
cases := []struct { cases := []struct {
......
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