Skip to content

ci: run the full workspace test suite (CLI-37)#109

Merged
markovejnovic merged 4 commits into
mainfrom
marko/cli-37-tests-failing-in-the-hm-and-hm-dsl-engine-crates
Jun 10, 2026
Merged

ci: run the full workspace test suite (CLI-37)#109
markovejnovic merged 4 commits into
mainfrom
marko/cli-37-tests-failing-in-the-hm-and-hm-dsl-engine-crates

Conversation

@markovejnovic

Copy link
Copy Markdown
Contributor

Why

CLI-37 reported hm-dsl-engine tests failing (the 18-byte stub bundled_sources tests + the init_ts_templates_roundtrip_render js-export error). Those tests never run in our own CI: .hm/ci.py scoped the Rust step to cargo test -p harmont-cli, so every other workspace crate — including hm-dsl-engine — was untested. hm run ci green did not imply cargo test green.

What

Two coupled changes to the rust_project target in .hm/ci.py:

  1. Widen scopeproject.test() (no packages=) now renders cargo test --workspace --locked instead of two -p harmont-cli steps. The whole workspace is tested.
  2. Add esbuild/Node to the step base — the Rust step now builds on hm.js.project("crates/hm-dsl-engine/harmont-ts").install(). This is required, not cosmetic: hm-dsl-engine/build.rs shells out to esbuild at compile time to embed the TS SDK bundle. Without it the build emits an 18-byte stub and the bundled_sources length-assertions fail. Installing Node also means the JS-runtime-gated render tests (init_ts_templates_roundtrip_render, ts_engine_test) actually run instead of self-skipping.

These land together on purpose: --workspace without esbuild = red CI; esbuild without --workspace = the dsl-engine tests still never run.

  1. Regression guarddogfood_ci_tests_whole_workspace in crates/hm/tests/cmd_init.rs renders our own .hm/ci.py and asserts the IR contains cargo test --workspace and not cargo test -p harmont-cli, so the scope can't silently regress. Verified to fail when the scope is reverted.

Verification

  • hm render ci now emits cargo test --workspace --locked and an npm ci install step; zero -p harmont-cli.
  • New regression test passes; teeth-proven (fails on revert); cargo clippy --tests -D warnings clean.
  • Full cargo test --workspace green is validated by this PR's own CI run (the point of the change) — local hm run ci was not run (Docker).

Closes CLI-37 / #105.

Widen the dogfood rust_project step from cargo test -p harmont-cli to
cargo test --workspace, and build esbuild/Node into its base so
hm-dsl-engine's build.rs emits a real SDK bundle instead of an 18-byte
stub. This brings the previously-uncovered bundled_sources tests (and the
node-gated render tests) into CI.
The test rendered the repo's own .hm/ci.py at runtime via `hm render ci`,
but hm-exec intentionally strips .hm/ from the build source archive
(crates/hm-exec/src/local/source.rs) to keep __pycache__/.py out of
/workspace. So inside `hm run ci`'s own sandbox the pipeline can't be
re-rendered and the test fails with 'no .hm/ directory found in /workspace'.

Worse, cargo test is fail-fast across binaries, so this failure aborted the
run before hm-dsl-engine's bundled_sources tests (the CLI-37 ones) ever
executed. The --workspace change in the parent commit is the real fix;
this guardrail is redundant and environment-fragile. Removing it.
`hm run` built the execution backend (connecting to the Docker daemon)
before rendering the pipeline, so argument errors — unknown slug, zero or
many declared pipelines, or an invalid --format — surfaced as a Docker
socket error in any daemon-less environment instead of the intended,
helpful message.

Reorder handle(): resolve cloud creds (still fail-fast on a missing token),
then render + parse the plan, then pick the renderer (validating --format),
and only then connect to Docker. Pure reorder; cloud auth still precedes
render work.

This is what let widening dogfood CI to `cargo test --workspace` go red:
the daemon-less pipeline sandbox now runs these previously-skipped
arg-validation tests (zero_pipelines_returns_a_helpful_error,
many_pipelines_still_requires_arg, unknown_format_fails_fast_with_listing),
which expect the validation message, not a daemon error. Genuine
execution tests remain #[ignore]d.
@markovejnovic markovejnovic merged commit 904721f into main Jun 10, 2026
17 checks passed
@markovejnovic markovejnovic deleted the marko/cli-37-tests-failing-in-the-hm-and-hm-dsl-engine-crates branch June 10, 2026 18:42
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