test(e2e): add bats-core dpm localnet suite (DPM-DAR-001) - #267
Merged
Conversation
Reimplement the `dpm localnet` end-to-end suite on bats-core instead of a hand-rolled shell harness. bats-core and its helper libraries are vendored as pinned git submodules under e2e-tests/: e2e-tests/bats bats-core v1.13.0 e2e-tests/test_helper/bats-support v0.3.0 e2e-tests/test_helper/bats-assert v2.2.4 DevKit-specific helpers (component assembly + Daml project scaffolding) live in e2e-tests/test_helper/dpm.bash; the generic pass/fail/skip and summary machinery is now provided by bats itself. DPM-DAR-001 (e2e-tests/dpm-dar-001.bats) is the first case: it builds a local file-based component from the freshly built binary, scaffolds a Daml project, and asserts `dpm localnet dar build-upload --build-only` succeeds without the issue #230 "file exists" signature. --build-only means no LocalNet is required. Run locally with `make e2e-dpm` (initializes submodules on demand, skips gracefully when dpm is absent). CI recreates the hermetic, no-artifact single-runner workflow, now invoking bats via a composite action with submodules: recursive checkout. Note: milestone1 (scripts/e2e-milestone1.sh) remains on the old harness and will migrate to bats in a follow-up.
Add docs/e2e-testing.md covering both E2E layers (the new bats-core `dpm localnet` suite under e2e-tests/ and the Milestone 1 LocalNet lifecycle suite): layout, the pinned bats submodules, running locally via `make e2e-dpm`, writing new .bats tests with dpm.bash helpers, the CI workflow, and how to bump pinned versions. Publish it to the docs site: add a docs-map.mjs entry (reference/ e2e-testing) and a Reference sidebar link in astro.config.mjs.
zheli
force-pushed
the
test/dpm-localnet-e2e-bats
branch
from
July 12, 2026 08:21
0308a79 to
5e5aff9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dpm localnetend-to-end suite on bats-core instead of the previous hand-rolled shell harness, deleting the bespoke pass/fail/skip/summary machinery in favour of the framework's built-ins +bats-support/bats-assert.dpm localnet dar build-uploadinside a Daml project).main(which now includes the bug: cannot call "dpm localnet dar build-upload" inside a daml project #230 fix from fix(dar): strip DPM_RESOLUTION_FILE from nested build env #266), so the suite passes end-to-end in CI.Changes
e2e-tests/:e2e-tests/bats-> bats-corev1.13.0e2e-tests/test_helper/bats-support->v0.3.0e2e-tests/test_helper/bats-assert->v2.2.4e2e-tests/test_helper/dpm.bash: DevKit-specific helpers only (local component assembly + Daml project scaffolding under.tmp/per AGENTS.md).e2e-tests/dpm-dar-001.bats: DPM-DAR-001. Builds a local file-based component from the freshly built binary, scaffolds a project, assertsdpm install packageanddpm localnet dar build-upload --build-onlysucceed,refute_output --partial "file exists", and a DAR is produced.--build-onlymeans no LocalNet needed.Makefile:make e2e-dpmtarget (inits submodules on demand, runs bats; skips gracefully whendpmis absent)..github/actions/e2e-dpm-test/action.yml: composite action for bats (build binary, SHA-verified DPM install, runbats --formatter tap). Reuses the built binary viaCDK_BIN(no artifact)..github/workflows/e2e-test-dpm-localnet.yml: singledpm-dar-001job +cleanup,submodules: recursivecheckout, same triggers/gating (schedule,workflow_dispatch,run-e2elabel). Hermetic, single self-hosted runner, no cross-job artifact.Documentation
docs/e2e-testing.mddocuments both E2E layers (this bats suite and the Milestone 1 LocalNet lifecycle suite): layout, pinned submodules, running viamake e2e-dpm, writing new.batstests, CI, and bumping pinned versions.website/docs-map.mjsentry (reference/e2e-testing) + a Reference sidebar link inwebsite/astro.config.mjs. Verified withnpm run build(page generated, no sync-docs warnings) andnpm test(sync-docs unit tests green).Notes
make e2e-dpmPASSES with a fixed (fix(dar): strip DPM_RESOLUTION_FILE from nested build env #266) binary and FAILS on an unfixed one at the exactfile existssignature — a genuine regression guard.1..1/ok 1 …).git submodule update --init --recursive, or justmake e2e-dpm).scripts/e2e/(Milestone 1 LocalNet lifecycle) to bats once this pattern is proven.