Skip to content

Commit 3f3fdca

Browse files
committed
Merge origin/main into becca/e2e-fixed-domains
Bring in 19 commits of e2e infrastructure work that landed since this branch was forked, including: - PR #68: dynamic registry contract address resolution at runtime - PR #78: e2e fixture fix to use the same live address (otherwise our registry-state assertions would query the snapshot contract while deploys write to the live one) - PR #113: rustup post-install path patching — the actual fix for the paritytech/playground-app#118 bug our cold-start smoke job was added to catch - Phase 5/6/7/8 e2e workflow restructuring (matrix-based cells, surface-failure helpers, post-release smoke, sticky PR comments) Conflict resolution notes: - e2e/cli/deploy.test.ts: kept main's runContractDeployTest helper + the new full-pipeline contract describes (foundry/hardhat/multi). Re-applied my QA tightening to the preflight tests (mainnet exact text + exit code, contracts-detected use the 'Checking availability' checkpoint, --contracts-no-project asserts exit code, availability- before-build verifies temporal ordering). Added registry-state verification to the frontend-only and re-deploy tests via the new getApp() fixture. DROPPED my 'already registered' tightening on the domain-taken test — in dev mode the availability check defers ownership to bulletin-deploy's preflight, so the rejection comes from the registry contract revert (Revive.ContractReverted), not the friendly availability message. Main's loose regex catches both paths correctly. - e2e/cli/mod.test.ts: kept main's split into 'dot mod — clone' and 'dot mod — registry miss' describes. Re-applied my exact-text tightening to both tests. - .github/workflows/e2e.yml: kept main's matrix-cell structure entirely, appended my init-cold-smoke job at the end (still daily cron + workflow_dispatch only).
2 parents c588948 + ad40181 commit 3f3fdca

79 files changed

Lines changed: 6883 additions & 504 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Setup E2E environment
2+
description: Install pnpm/node/bun/kubo, run pnpm install, and resolve DOT_TAG from the trigger event. The CALLER must run actions/checkout BEFORE this action — local composite actions can't be located until the repo is on disk.
3+
4+
outputs:
5+
tag:
6+
description: The DOT_TAG value resolved from github.event_name (e2e-ci-{nightly,dispatch,pr}).
7+
value: ${{ steps.tag.outputs.tag }}
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- uses: pnpm/action-setup@v4
13+
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: "22"
17+
18+
- uses: oven-sh/setup-bun@v2
19+
with:
20+
bun-version: latest
21+
22+
- name: Install Kubo (IPFS)
23+
shell: bash
24+
run: |
25+
wget -q https://dist.ipfs.tech/kubo/v0.32.1/kubo_v0.32.1_linux-amd64.tar.gz
26+
tar xf kubo_v0.32.1_linux-amd64.tar.gz
27+
sudo mv kubo/ipfs /usr/local/bin/
28+
ipfs init --profile=test
29+
ipfs version
30+
31+
- name: pnpm install
32+
shell: bash
33+
run: pnpm install
34+
35+
- name: Resolve DOT_TAG from trigger
36+
id: tag
37+
shell: bash
38+
run: |
39+
# Phase 1 triggers: pull_request / push:main / schedule / workflow_dispatch.
40+
# Phase 7 will add `release` (with TAG=e2e-ci-release).
41+
case "${{ github.event_name }}" in
42+
schedule) TAG=e2e-ci-nightly ;;
43+
workflow_dispatch) TAG=e2e-ci-dispatch ;;
44+
*) TAG=e2e-ci-pr ;;
45+
esac
46+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
47+
echo "Resolved DOT_TAG=$TAG (event=${{ github.event_name }})"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Surface E2E failure detail
2+
description: |
3+
Print dot-runs.log + failed-testcase summary to the job log and emit
4+
::error:: annotations so triagers see the real root cause without
5+
downloading artefacts. Intended to run with `if: failure()` after a
6+
cell's test step.
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Dump dot-runs.log + failed testcases
12+
shell: bash
13+
run: |
14+
echo "::group::dot-runs.log (CLI subprocess stdout/stderr)"
15+
if [ -f e2e-reports/dot-runs.log ]; then
16+
cat e2e-reports/dot-runs.log
17+
else
18+
echo "(no dot-runs.log written — test failed before any dot subprocess ran, or the e2e-reports dir wasn't created)"
19+
fi
20+
echo "::endgroup::"
21+
22+
if [ -f e2e-reports/junit.xml ]; then
23+
if ! command -v xmlstarlet >/dev/null 2>&1; then
24+
sudo apt-get update -q
25+
sudo apt-get install -y -q xmlstarlet
26+
fi
27+
echo "::group::Failed testcases (from junit.xml)"
28+
xmlstarlet sel -t -m "//testcase[failure or error]" \
29+
-v "concat(@classname, ' › ', @name)" -o $'\n ' \
30+
-v "failure/@message | error/@message" -n e2e-reports/junit.xml || true
31+
echo "::endgroup::"
32+
33+
xmlstarlet sel -t -m "//testcase[failure or error]" \
34+
-v "concat('::error file=', @classname, '::', @name, ' — ')" \
35+
-v "failure/@message | error/@message" -n e2e-reports/junit.xml \
36+
| head -c 3000 || true
37+
fi

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,15 @@ jobs:
1818
node-version: "22"
1919
- run: pnpm install
2020
- run: pnpm format:check
21+
22+
unit-tests:
23+
name: Unit Tests
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: pnpm/action-setup@v4
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: "22"
31+
- run: pnpm install
32+
- run: pnpm test

.github/workflows/e2e-cleanup.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: E2E Cleanup
2+
3+
on:
4+
schedule:
5+
- cron: "0 4 * * 0" # Sunday 04:00 UTC, after the nightly window
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
issues: write # for filing if cleanup fails
11+
12+
jobs:
13+
sweep:
14+
name: Sweep rotating E2E state
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Sweep rotating modable repos and domains
21+
shell: bash
22+
env:
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: |
25+
echo "::group::What this workflow sweeps"
26+
echo "Per spec §9c, this cron sweeps rotating per-run E2E state:"
27+
echo " - GH repos matching 'e2e-cli-modable-*' older than 14 days"
28+
echo " - Registry domains matching 'e2e-cli-modable-*' older than 14 days"
29+
echo ""
30+
echo "Phase 5e (modable) hasn't shipped yet, so there's nothing to sweep today."
31+
echo "When Phase 5e lands, this step gets the actual sweep logic:"
32+
echo " gh repo list --topic e2e-test-fixture --limit 100 ..."
33+
echo " bun tools/sweep-modable-domains.ts (would be added then)"
34+
echo "::endgroup::"
35+
36+
# Stub — exit 0. Replace with real sweep when Phase 5e adds rotating state.
37+
echo "no rotating state to sweep — Phase 5e not yet shipped"
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: E2E (Post-Release)
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: "Release tag to test (e.g. v0.16.0)"
10+
required: true
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
smoke:
17+
name: "E2E · post-release-smoke"
18+
if: github.event.release.prerelease != true || github.event_name == 'workflow_dispatch'
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 15
21+
env:
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- uses: pnpm/action-setup@v4
27+
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: "22"
31+
32+
- run: pnpm install
33+
34+
- name: Resolve release tag
35+
id: tag
36+
shell: bash
37+
run: |
38+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
39+
TAG="${{ inputs.tag }}"
40+
else
41+
TAG="${{ github.event.release.tag_name }}"
42+
fi
43+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
44+
45+
- name: Wait for SEA asset on the release
46+
shell: /usr/bin/bash -euo pipefail {0}
47+
run: |
48+
TAG="${{ steps.tag.outputs.tag }}"
49+
for i in $(seq 1 30); do
50+
if gh release view "$TAG" --json assets --jq '.assets[].name' | grep -q "^dot-linux-x64$"; then
51+
echo "Found dot-linux-x64 asset on attempt $i"
52+
exit 0
53+
fi
54+
echo " attempt $i/30: waiting for asset..."
55+
sleep 10
56+
done
57+
echo "::error::Timed out waiting for dot-linux-x64 asset on $TAG"
58+
exit 1
59+
60+
- name: Install via install.sh (consumer path)
61+
shell: bash
62+
run: |
63+
TAG="${{ steps.tag.outputs.tag }}"
64+
# Pin to the just-released version; install.sh resolves "latest"
65+
# by default which can lag behind a just-published release.
66+
# install.sh runs `dot init` at the end; init requires an
67+
# interactive QR scan and will exit non-zero in headless CI —
68+
# that is expected. The binary is installed before init runs,
69+
# so we tolerate the init failure and verify the binary below.
70+
curl -fsSL "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/install.sh" \
71+
| VERSION="$TAG" bash || true
72+
# Hard-fail here if the binary was not installed — that IS a
73+
# real regression in the install script's download/chmod path.
74+
ls -la "$HOME/.polkadot/bin/dot"
75+
76+
- name: Compute installed-binary path
77+
shell: bash
78+
run: echo "DOT_E2E_BINARY=$HOME/.polkadot/bin/dot" >> "$GITHUB_ENV"
79+
80+
- name: Smoke test the installed binary
81+
uses: nick-fields/retry@v3
82+
with:
83+
timeout_minutes: 5
84+
max_attempts: 2
85+
retry_wait_seconds: 15
86+
command: pnpm exec vitest run --config e2e/vitest.config.ts e2e/cli/published.test.ts
87+
env:
88+
DOT_TAG: e2e-ci-post-release
89+
DOT_TELEMETRY: "1"
90+
91+
- name: Upload forensic artefacts
92+
if: always()
93+
continue-on-error: true
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: e2e-reports-post-release-smoke
97+
path: e2e-reports/
98+
retention-days: 7
99+
if-no-files-found: ignore

.github/workflows/e2e-release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: E2E (Published Binary)
2+
3+
on:
4+
release:
5+
types: [prereleased]
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: "Release tag to test (e.g. v0.16.0-rc.1)"
10+
required: true
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
smoke:
17+
name: "E2E · release-smoke"
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 15
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: pnpm/action-setup@v4
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: "22"
30+
31+
- run: pnpm install
32+
33+
- name: Resolve release tag
34+
id: tag
35+
shell: bash
36+
run: |
37+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
38+
TAG="${{ inputs.tag }}"
39+
else
40+
TAG="${{ github.event.release.tag_name }}"
41+
fi
42+
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
43+
44+
- name: Wait for SEA asset to be uploaded
45+
shell: /usr/bin/bash -euo pipefail {0}
46+
run: |
47+
TAG="${{ steps.tag.outputs.tag }}"
48+
for i in $(seq 1 30); do
49+
if gh release view "$TAG" --json assets --jq '.assets[].name' | grep -q "^dot-linux-x64$"; then
50+
echo "Found dot-linux-x64 asset on attempt $i"
51+
exit 0
52+
fi
53+
echo " attempt $i/30: waiting for asset..."
54+
sleep 10
55+
done
56+
echo "::error::Timed out waiting for dot-linux-x64 asset on $TAG"
57+
exit 1
58+
59+
- name: Download SEA asset
60+
shell: bash
61+
run: |
62+
TAG="${{ steps.tag.outputs.tag }}"
63+
mkdir -p ./bin
64+
gh release download "$TAG" --pattern "dot-linux-x64" --dir ./bin
65+
chmod +x ./bin/dot-linux-x64
66+
ls -la ./bin/dot-linux-x64
67+
68+
- name: Smoke test the published binary
69+
uses: nick-fields/retry@v3
70+
with:
71+
timeout_minutes: 5
72+
max_attempts: 2
73+
retry_wait_seconds: 15
74+
command: pnpm exec vitest run --config e2e/vitest.config.ts e2e/cli/published.test.ts
75+
env:
76+
DOT_E2E_BINARY: ${{ github.workspace }}/bin/dot-linux-x64
77+
DOT_TAG: e2e-ci-release
78+
DOT_TELEMETRY: "1"
79+
80+
- name: Upload forensic artefacts
81+
if: always()
82+
continue-on-error: true
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: e2e-reports-release-smoke
86+
path: e2e-reports/
87+
retention-days: 7
88+
if-no-files-found: ignore

0 commit comments

Comments
 (0)