Daily Test Coverage ImproverResearch and Plan #12536
Replies: 3 comments
-
|
Phase 2 complete: created
|
Beta Was this translation helpful? Give feedback.
-
|
Phase 2 complete — I've created the coverage steps configuration at The composite action sets up Node.js 22, installs dependencies with Yarn 4, builds all packages, runs
|
Beta Was this translation helpful? Give feedback.
-
|
Phase 2 complete. I've created the coverage steps configuration in The action builds all packages, runs
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary of Findings
Repository Overview
Agoric SDK is a JavaScript/TypeScript monorepo with 57 packages in
packages/, managed by Yarn workspaces and Lerna Lite. It implements Agoric's smart contract platform, including ERTP, Zoe, SwingSet, orchestration, fast-usdc, inter-protocol, governance, and more. There are also packages inservices/,a3p-integration/, andmultichain-testing/.Testing Framework & Tools
@endo/ses-ava@fast-check/avaCoverage Infrastructure
NODE_V8_COVERAGEenvironment variable andc8scripts/ci/generate-test-coverage-report.sh:codecov.yaml(currently in informational mode — not blocking PRs)COVERAGE.md): Lines from bundled code cannot be measured until source maps are implemented in@endo/bundle-source,@agoric/transform-metering, and@agoric/static-module-record. This means coverage numbers undercount actual code coverage significantly.Key Commands
How Tests Are Organized
test/directorypackage.jsonunder the"ava"key (typically"files": ["test/**/*.test.*"])import '@endo/init/debug.js'for SES initialization"test": runsavadirectly"test:c8": runsc8 --all avafor coveragetest:xs(XS worker tests),test:unit,test:swingsetPackages with No Real Tests (test script is
exit 0)These packages have source code but their
testscript does nothing:sparse-intsstat-loggerbenchmarkdeploymenteslint-configCoverage Gap Analysis (estimated from source/test file ratios)
client-utilscosmic-prototelemetryswingset-runnervatsorchestrationinter-protocolagoric-cliImprovement Plan
Strategy
sparse-intsandstat-loggerwhich have pure functions that are easy to testinternal,vow,base-zone,store— these support everything elsegovernance,inter-protocol,fast-usdc— these handle real economic decisionsorchestrationpackagePhase-by-Phase Approach
Immediate wins (Phase 3 — early iterations):
sparse-ints(pure functions, ~100% coverage achievable)telemetryutilities (pure utility functions)internalpackage helpersgovernanceparameter handlingMedium-term:
orchestrationerror path coverageclient-utilsutilitiesinter-protocolfee management pathsLonger-term:
Questions/Clarifications Needed
@endo/bundle-source? This would dramatically increase measured coverage for contract and vat code.client-utilsfile count: The high source count may include generated code — should those be excluded?How to Control this Workflow
You can add comments to this discussion to provide feedback, adjustments to the plan, or direction on which packages to prioritize.
Use these commands to control the workflow:
gh aw disable daily-test-improver --repo Agoric/agoric-sdk gh aw enable daily-test-improver --repo Agoric/agoric-sdk gh aw run daily-test-improver --repo Agoric/agoric-sdk --repeat (number-of-repeats) gh aw logs daily-test-improver --repo Agoric/agoric-sdkWhat Happens Next
.github/actions/daily-test-improver/coverage-steps/action.ymlcontaining CI steps to build the project, run tests, and produce a combined coverage reportBeta Was this translation helpful? Give feedback.
All reactions