You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(trigger-e2e): add deterministic gate/synth-PR trigger-condition E2E suite (#1504)
* test(trigger-e2e): add deterministic gate/synth-PR trigger-condition E2E suite
Add an ADO-native, non-agentic E2E test framework for the runtime trigger
conditions managed by ado-script (gate.js PR filters and
exec-context-pr-synth.js synthetic-PR promotion), modeled on the executor-e2e
native bundle. A parameterized victim pipeline runs only the two bundles and
reports the decision via REST-observable build tags; an orchestrator harness
creates real PRs and queues the victim many ways, asserting the gate decision.
Test-only bundle: excluded from ado-script.zip exactly like executor-e2e.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f30758a5-81c8-4024-ab01-52ad22b4f877
* test(trigger-e2e): address PR review feedback
- Derive the synthetic-PR spec from the PR's real target branch
(promoteSynthSpec/excludeSynthSpec) instead of a hardcoded "main", so
gate/synth scenarios evaluate correctly on any default branch.
- Guard createPrContext against an explicitly-empty files map (avoid the
entries[0]! undefined-destructuring crash; treat {} like omitted).
- Cancel an orphaned victim build in the runner's finally block when the
queue-phase poll throws (waitForBuild timeout), threading the queued build
id via runVictim's onQueued callback; add unit tests for the cancel path.
- setPullRequestLabels: name the specific failing label so a partial attach
surfaces as a clear setup error, not a confusing gate mismatch.
- filter_ir.rs: add a SYNC annotation pointing at gate-spec.ts::FACT_META so
fact policy/dependency changes flag the hand-maintained mirror.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f30758a5-81c8-4024-ab01-52ad22b4f877
* test(trigger-e2e): address second-round PR review feedback
- Fix latent multi-file push bug: pushAddFileBranch always uses new-branch
semantics, so createPrContext's per-file loop would fail with a ref conflict
on the second file. Add AdoRest.pushAddFilesBranch that batches all files
into a single commit, and use it in createPrContext.
- Decouple the shared AdoRest client from trigger-e2e env vars: waitForBuild
now takes generic 15min/10s defaults; the TRIGGER_E2E_BUILD_TIMEOUT_MS /
_POLL_MS knobs are read in trigger-e2e queue.ts and passed as opts, so an
executor-e2e run can't be silently retimed.
- Add change-count-pass scenario (two files, within range → runs), completing
the numeric_range pass/skip coverage and exercising the batched push path.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f30758a5-81c8-4024-ab01-52ad22b4f877
* test(trigger-e2e): machine-verify FACT_META against a generated fact catalog
Close the gate-spec.ts / FACT_META drift hole that types.gen.ts cannot cover:
policy and dependency VALUES were invisible to any type-checker, so a Rust-side
change to Fact::failure_policy()/dependencies() (or a new/removed Fact) would
only surface as a wrong spec at runtime.
- Rust: add Fact::ALL (completeness enforced at compile time by a wildcard-free
exhaustiveness match) and generate_fact_catalog(); expose it via a hidden
export-fact-catalog CLI command.
- codegen: emit committed fact-catalog.gen.json alongside types.gen.ts.
- CI: extend the ado-script drift-check git-diff to cover the catalog, so a
Rust change forces a regen + commit.
- TS: factMetaCatalog() projects FACT_META into the catalog shape and a
gate-spec.test.ts test deep-compares it to fact-catalog.gen.json.
Verified: corrupting the catalog fails the unit test; adding a Fact variant
fails compilation until Fact::ALL is updated.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f30758a5-81c8-4024-ab01-52ad22b4f877
* test(trigger-e2e): polish per third-round PR review
- main.rs: wrap the export-gate-schema / export-fact-catalog fs writes and
create_dir_all in .with_context so a CLI write failure names the target path.
- filter_ir.rs: document that Fact::ALL's [Fact; 14] length literal is a second
compile-time guard that must track the variant count.
- gate-spec.ts: replace predicateFacts' (p as { fact? }).fact duck-typing with a
discriminant switch + never-exhaustiveness default, so a renamed/added
PredicateSpec field or variant is a compile error instead of a silently
under-specified fact list.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f30758a5-81c8-4024-ab01-52ad22b4f877
* docs(trigger-e2e): note multi-step setup leak risk and pool-name override
Address remaining PR review doc suggestions:
- createPrContext: document that a scenario doing further setup work after a
successful createPrContext must teardown the PrContext itself before
rethrowing, since the runner won't run cleanup until setup() returns.
- README: call out that the hardcoded AZS-1ES pool name in both pipelines may
need changing for the operator's ADO project.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f30758a5-81c8-4024-ab01-52ad22b4f877
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
"codegen": "node -e \"require('node:fs').mkdirSync('schema', { recursive: true })\" && cargo run --quiet --manifest-path ../../Cargo.toml -- export-gate-schema --output schema/gate-spec.schema.json && npx json2ts schema/gate-spec.schema.json -o src/shared/types.gen.ts --bannerComment \"// AUTO-GENERATED from Rust IR via cargo run -- export-gate-schema. Do not edit; run npm run codegen.\"",
30
+
"codegen": "node -e \"require('node:fs').mkdirSync('schema', { recursive: true })\" && cargo run --quiet --manifest-path ../../Cargo.toml -- export-gate-schema --output schema/gate-spec.schema.json && npx json2ts schema/gate-spec.schema.json -o src/shared/types.gen.ts --bannerComment \"// AUTO-GENERATED from Rust IR via cargo run -- export-gate-schema. Do not edit; run npm run codegen.\" && cargo run --quiet --manifest-path ../../Cargo.toml -- export-fact-catalog --output src/trigger-e2e/fact-catalog.gen.json",
30
31
"test": "vitest run",
31
32
"test:smoke": "npm run build:gate && npm run build:import && npm run build:exec-context-pr && npm run build:exec-context-pr-synth && npm run build:exec-context-manual && npm run build:exec-context-pipeline && npm run build:exec-context-ci-push && npm run build:exec-context-workitem && npm run build:exec-context-schedule && npm run build:exec-context-pr-checks && npm run build:exec-context-repo && npm run build:conclusion && npm run build:approval-summary && npm run build:github-app-token && npm run build:prepare-pr-base && vitest run -c vitest.config.smoke.ts",
0 commit comments