diff --git a/.circleci/config.yml b/.circleci/config.yml index 54420f0b4b1c1..ffc16d91ede95 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -608,32 +608,6 @@ jobs: docker pull $image_name || exit 1 docker run $image_name <> --version || exit 1 - contracts-bedrock-coverage: - docker: - - image: <> - resource_class: xlarge - steps: - - checkout - - install-contracts-dependencies - - check-changed: - patterns: contracts-bedrock,op-node - - run: - name: print forge version - command: forge --version - working_directory: packages/contracts-bedrock - # We do not use the pre-built contracts becuase forge coverage uses different optimizer settings - - run: - name: test and generate coverage - command: just coverage-lcov - no_output_timeout: 18m - environment: - FOUNDRY_PROFILE: cicoverage - working_directory: packages/contracts-bedrock - - codecov/upload: - disable_search: true - files: ./packages/contracts-bedrock/lcov.info - flags: contracts-bedrock-tests - contracts-bedrock-tests: machine: true resource_class: ethereum-optimism/latitude-1 @@ -641,18 +615,14 @@ jobs: test_list: description: List of test files to run type: string - test_fuzz_runs: - description: Number of fuzz runs to apply - type: integer - default: 512 - test_invariant_runs: - description: Number of invariant runs to apply - type: integer - default: 32 - test_invariant_depth: - description: Depth of invariant runs - type: integer - default: 64 + test_command: + description: Test command to execute (test or coverage) + type: string + default: test + test_flags: + description: Additional flags to pass to the test command + type: string + default: "" test_timeout: description: Timeout for running tests type: string @@ -699,7 +669,7 @@ jobs: TEST_FILES=$(echo "$TEST_FILES" | circleci tests split --split-by=timings) TEST_FILES=$(echo "$TEST_FILES" | sed 's|^test/||') MATCH_PATH="./test/{$(echo "$TEST_FILES" | paste -sd "," -)}" - forge test --match-path "$MATCH_PATH" + forge <> <> --match-path "$MATCH_PATH" environment: FOUNDRY_PROFILE: <> working_directory: packages/contracts-bedrock @@ -715,6 +685,14 @@ jobs: name: Lint forge test names command: just lint-forge-tests-check-no-build working_directory: packages/contracts-bedrock + - when: + condition: + equal: ["<>", "coverage-lcov"] + steps: + - codecov/upload: + disable_search: true + files: ./packages/contracts-bedrock/lcov.info + flags: contracts-bedrock-tests - save_cache: name: Save Go build cache key: golang-build-cache-contracts-bedrock-tests-{{ checksum "go.sum" }} @@ -1234,6 +1212,14 @@ workflows: test_list: git diff origin/develop...HEAD --name-only --diff-filter=AM -- './test/**/*.t.sol' | sed 's|packages/contracts-bedrock/||' test_timeout: 1h test_profile: ciheavy + - contracts-bedrock-tests: + # Generate coverage reports. + name: contracts-bedrock-coverage + test_list: find test -name "*.t.sol" + test_command: coverage + test_flags: --report lcov + test_timeout: 1h + test_profile: cicoverage - contracts-bedrock-checks: requires: - contracts-bedrock-build @@ -1480,17 +1466,6 @@ workflows: jobs: - publish-contract-artifacts - develop-forge-coverage: - when: - and: - - or: - - equal: ["develop", <>] - - equal: [true, <>] - - not: - equal: [scheduled_pipeline, << pipeline.trigger_source >>] - jobs: - - contracts-bedrock-coverage - develop-fault-proofs: when: and: diff --git a/packages/contracts-bedrock/foundry.toml b/packages/contracts-bedrock/foundry.toml index 181391e7c49e6..b99237116a76d 100644 --- a/packages/contracts-bedrock/foundry.toml +++ b/packages/contracts-bedrock/foundry.toml @@ -86,11 +86,11 @@ depth = 32 optimizer = false [profile.cicoverage.fuzz] -runs = 512 +runs = 1 [profile.cicoverage.invariant] -runs = 256 -depth = 32 +runs = 1 +depth = 1 ################################################################ # PROFILE: CIHEAVY #