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
{{ message }}
Repository navigation
Commit 5dd3ebb
Browse filesBrowse the repository at this point in the historyBrowse files
test(submitqueue): land real GitHub PRs in CI e2e and integration tests
## Summary
### Why?
The merger's unit tests use a fake, which only encodes our reading of GitHub's docs. These suites check the merger, and SubmitQueue's whole land path, against real github.com on every CI run.
### What?
- `TestGitHubLandE2E`: gateway → orchestrator (GitHub change provider) → Runway (GitHub merger). It lands a single PR and a stack, and rejects PRs that are not a stack.
- Merger integration test: a full stack with redelivery, a partial stack, non-stack lists, and a moved head.
- Shared `test/testutil/githubtestrepo` fixtures, which skip unless `SQ_GITHUB_TOKEN` and `SQ_GITHUB_TEST_REPO` are set.
- CI: the `e2e` job and a new `merger-integration-test` job take the `SQ_TEST_REPO_TOKEN` repository secret (limited to the test repo). The secrets guard allows it as the only exception.
- `e2e-github-queue` is added to `queues.yaml` and to `MQ_TENANTS`.
## Test Plan
✅ `TestGitHubLandE2E` 3/3 and the merger integration test 4/4 against `behinddwalls/sq-demo`; no fixtures left behind
✅ `make lint check-gazelle check-tidy`
Copy file name to clipboardExpand all lines: doc/howto/TESTING.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,16 @@ make build-all-linux # Build Linux binaries for the local docker-
84
84
- Containers: Each suite's required services and dependencies; SubmitQueue E2E includes Gateway, Orchestrator, Runway, and MySQL
85
85
- Tests end-to-end behavior, including cross-service communication where applicable
86
86
87
+
### Live GitHub Tests
88
+
89
+
Two suites land real pull requests on github.com: `TestGitHubLandE2E` (in `make e2e-test`) and the Runway GitHub merger extension test (`make integration-test-runway-merger`). They run only when `SQ_GITHUB_TOKEN` and `SQ_GITHUB_TEST_REPO=owner/repo` are set, and skip otherwise, so every other run is unaffected. The token needs write access to the test repository; everything the tests open is named under `sq-it/` and removed afterwards, while what they merge stays on its default branch.
90
+
91
+
```bash
92
+
SQ_GITHUB_TOKEN=$(gh auth token) SQ_GITHUB_TEST_REPO=behinddwalls/sq-demo make e2e-test
93
+
```
94
+
95
+
CI supplies the token from the `SQ_TEST_REPO_TOKEN` repository secret, a token limited to the test repository. Fork pull requests receive no secrets, so the suites skip there. Every other CI run sets `SQ_GITHUB_TEST_REQUIRED=true`, which turns a missing secret into a failure; an expired or revoked token fails regardless.
96
+
87
97
### How Automated Tests Work
88
98
89
99
Tests use **docker-compose** via `ComposeStack` to spin up containers automatically:
Copy file name to clipboardExpand all lines: runway/extension/merger/github/README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,15 @@ Each step's strategy maps onto a GitHub merge method — `REBASE` to `rebase`, `
12
12
13
13
Each URI's output is the merge commit GitHub records for its pull request: the squash commit, the merge commit, or, for a rebase, the last commit the rebase created for that pull request. That is one output per URI, where the git merger reports one per created commit under `REBASE`. It is read from the pull request's `merged` issue event, because API version 2026-03-10 no longer reports `merge_commit_sha` on a merged pull request. GitHub reports a stack merge settled a moment before every pull request in it shows its merge, so the merger re-reads until each is recorded.
14
14
15
+
## Live tests
16
+
17
+
Two suites run against a real repository whenever `SQ_GITHUB_TOKEN` and `SQ_GITHUB_TEST_REPO=owner/repo` are set, and skip otherwise (see [`test/testutil/githubtestrepo`](../../../../test/testutil/githubtestrepo)). Both open, stack and merge throwaway pull requests and check what GitHub recorded:
18
+
19
+
-[`test/integration/runway/extension/merger/github`](../../../../test/integration/runway/extension/merger/github) drives this merger on its own (`make integration-test-runway-merger`).
20
+
-`TestGitHubLandE2E` in [`test/e2e/submitqueue`](../../../../test/e2e/submitqueue) lands pull requests through the whole stack — gateway, orchestrator with the GitHub change provider, and Runway with this merger (`make e2e-test`).
21
+
22
+
CI runs both in its usual e2e and merger extension jobs, with the token from the `SQ_TEST_REPO_TOKEN` repository secret.
23
+
15
24
## What a step must be
16
25
17
26
The URIs of a step must be something GitHub will land as one stack onto the target, and anything else is refused as an invalid request:
0 commit comments