Skip to content

test(e2e): add bats-core dpm localnet suite (DPM-DAR-001) - #267

Merged
zheli merged 2 commits into
mainfrom
test/dpm-localnet-e2e-bats
Jul 12, 2026
Merged

test(e2e): add bats-core dpm localnet suite (DPM-DAR-001)#267
zheli merged 2 commits into
mainfrom
test/dpm-localnet-e2e-bats

Conversation

@zheli

@zheli zheli commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes

  • Vendor bats-core + helpers 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
  • e2e-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, asserts dpm install package and dpm localnet dar build-upload --build-only succeed, refute_output --partial "file exists", and a DAR is produced. --build-only means no LocalNet needed.
  • Makefile: make e2e-dpm target (inits submodules on demand, runs bats; skips gracefully when dpm is absent).
  • .github/actions/e2e-dpm-test/action.yml: composite action for bats (build binary, SHA-verified DPM install, run bats --formatter tap). Reuses the built binary via CDK_BIN (no artifact).
  • .github/workflows/e2e-test-dpm-localnet.yml: single dpm-dar-001 job + cleanup, submodules: recursive checkout, same triggers/gating (schedule, workflow_dispatch, run-e2e label). Hermetic, single self-hosted runner, no cross-job artifact.

Documentation

  • New docs/e2e-testing.md documents both E2E layers (this bats suite and the Milestone 1 LocalNet lifecycle suite): layout, pinned submodules, running via make e2e-dpm, writing new .bats tests, CI, and bumping pinned versions.
  • Published to the docs site: website/docs-map.mjs entry (reference/e2e-testing) + a Reference sidebar link in website/astro.config.mjs. Verified with npm run build (page generated, no sync-docs warnings) and npm test (sync-docs unit tests green).

Notes

  • Verified locally on macOS: make e2e-dpm PASSES with a fixed (fix(dar): strip DPM_RESOLUTION_FILE from nested build env #266) binary and FAILS on an unfixed one at the exact file exists signature — a genuine regression guard.
  • Verified in CI on the self-hosted runner (workflow_dispatch): DPM-DAR-001 passes (1..1 / ok 1 …).
  • Contributors need submodules initialized once (git submodule update --init --recursive, or just make e2e-dpm).
  • Follow-up: migrate scripts/e2e/ (Milestone 1 LocalNet lifecycle) to bats once this pattern is proven.

zheli added 2 commits July 12, 2026 10:19
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
zheli force-pushed the test/dpm-localnet-e2e-bats branch from 0308a79 to 5e5aff9 Compare July 12, 2026 08:21
@zheli
zheli merged commit aadf048 into main Jul 12, 2026
26 checks passed
@zheli
zheli deleted the test/dpm-localnet-e2e-bats branch July 12, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant