Skip to content

Commit 33b306e

Browse files
authored
chore: Accumulated backports to v4-next (#22817)
BEGIN_COMMIT_OVERRIDE feat(docs): apply FPC docs to developer versioned docs (#22541) docs: apply FPC docs to versioned docs (backport #22541) (#22810) test(aztec-up): add full-dev-path e2e test for installed toolchain (#22801) fix: pass send message as (#22820) fix(aztec-up): handle CI=true in timeout function (#22827) refactor(sequencer): sign last block before archiver sync (#22117) END_COMMIT_OVERRIDE
2 parents eb05ee8 + 12a898f commit 33b306e

27 files changed

Lines changed: 938 additions & 202 deletions

File tree

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Tests that the installed Aztec toolchain works end-to-end.
2+
# Exercises the full developer onboarding path: aztec init -> compile -> test -> start -> codegen -> TS end-to-end test.
3+
name: Full Dev Path Test
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: "Version to install (e.g. latest, nightly, 4.3.0, 4.3.0-nightly.20260420)"
10+
required: true
11+
type: string
12+
push:
13+
tags:
14+
- "v*"
15+
16+
jobs:
17+
full-dev-path:
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
env:
21+
VERSION: ${{ github.event.inputs.version || github.ref_name }}
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
25+
26+
- name: Run full dev path test
27+
run: ./aztec-up/test/full-dev-path/run-test.sh
28+
29+
- name: Notify Slack on success
30+
if: success() && github.event_name != 'workflow_dispatch'
31+
env:
32+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
33+
run: |
34+
export CI=1
35+
./ci3/slack_notify "#team-fairies" \
36+
"Full Dev Path Test passed for version ${VERSION} :white_check_mark:"
37+
38+
- name: Notify Slack and dispatch ClaudeBox on failure
39+
if: failure() && github.event_name != 'workflow_dispatch'
40+
env:
41+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
42+
GITHUB_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }}
43+
run: |
44+
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
45+
export CI=1
46+
./ci3/slack_notify_with_claudebox_kickoff "#team-fairies" \
47+
"Full Dev Path Test FAILED (version ${VERSION}): <${RUN_URL}|View Run>" \
48+
"Full dev path test failed for version ${VERSION}. CI run: ${RUN_URL}. Investigate the failure and explain the root cause." \
49+
--link "$RUN_URL"

aztec-up/bin/0.0.1/install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function echo_yellow {
4949
}
5050

5151
function timeout {
52-
if [ "${CI:-0}" -eq 1 ]; then
52+
if [ "${CI:-0}" = "1" ] || [ "${CI:-0}" = "true" ]; then
5353
/usr/bin/timeout "$@"
5454
else
5555
shift
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Full Dev Path Test
2+
3+
Tests that the installed Aztec toolchain works end-to-end. Exercises the complete developer onboarding path:
4+
5+
1. `aztec init` - scaffold a new workspace with a Counter contract and test crate
6+
2. `aztec compile` - compile the scaffolded contract
7+
3. `aztec test` - run the TXE tests from the scaffold's test crate
8+
4. `aztec start --local-network` - start a local sandbox (anvil + aztec node)
9+
5. `aztec codegen` - generate TypeScript bindings from the compiled artifact
10+
6. TS end-to-end test - run a `node --test` suite inside the scaffolded workspace that imports the codegen'd `CounterContract`, stands up an in-process wallet + PXE via `@aztec/wallets/embedded`, deploys Counter, calls `increment`, and reads the value back through the `get_counter` utility function
11+
12+
## Running
13+
14+
With an existing local install (fast inner loop):
15+
```bash
16+
SKIP_INSTALL=1 ./run-test.sh
17+
```
18+
19+
With a fresh install from a specific version:
20+
```bash
21+
VERSION=4.3.0 ./run-test.sh
22+
```
23+
24+
## Environment Variables
25+
26+
| Variable | Description |
27+
|----------|-------------|
28+
| `SKIP_INSTALL` | Set to `1` to skip the installer and use the already-installed toolchain. |
29+
| `VERSION` | Version to install (e.g. `4.3.0` or `v4.3.0`). Required unless `SKIP_INSTALL=1`. |
30+
31+
## Architecture
32+
33+
- **`run-test.sh`** - Bash launcher. Runs the aztec installer (unless skipped), sets up PATH, then `exec node full-dev-path.ts`.
34+
- **`full-dev-path.ts`** - Orchestrator. Runs each CLI step against the installed toolchain and, after codegen, copies `counter.test.ts` into the scaffolded workspace and spawns `node --test` on it. Each phase is wrapped in `step(name, fn)` so failures clearly identify which step broke. Always emits a machine-readable result line for CI/Slack integration: `TEST_RESULT=pass version=...` on success, or `TEST_RESULT=fail step=... version=... error="..."` on failure (with a full banner printed above it).
35+
- **`counter.test.ts`** - The `node:test` suite that drives the deployed Counter end-to-end through the codegen'd bindings. Lives here as a template; copied into the workspace at test time so it can statically `import { CounterContract } from './artifacts/Counter.js'` with real codegen types and resolve `@aztec/*` via the workspace's `node_modules` symlink to the install.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// End-to-end test for the scaffolded Counter contract.
2+
//
3+
// Copied into the scaffolded workspace at test time by ../test.ts, then executed with
4+
// `node --test`. Runs from inside the workspace so that:
5+
// - `./artifacts/Counter.js` resolves to the codegen'd bindings (and its types flow).
6+
// - `@aztec/*` imports resolve via the workspace's `node_modules` symlink to the
7+
// installed Aztec toolchain — i.e. the same packages a real user would have.
8+
//
9+
// The test expects an `aztec start --local-network` node reachable at NODE_URL. It uses the
10+
// pre-funded test0 account that local-network already deployed, stands up an in-process
11+
// EmbeddedWallet + PXE, deploys a fresh Counter, and exercises a full round trip through
12+
// the codegen'd bindings (send + simulate).
13+
14+
import test from 'node:test';
15+
import assert from 'node:assert/strict';
16+
17+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
18+
import { EmbeddedWallet } from '@aztec/wallets/embedded';
19+
20+
import { CounterContract } from './artifacts/Counter.ts';
21+
22+
const NODE_URL = process.env.NODE_URL ?? 'http://localhost:8080';
23+
const INITIAL_COUNTER_VALUE = 0n;
24+
25+
test('Counter deploys and increments through codegen bindings', async () => {
26+
const wallet = await EmbeddedWallet.create(NODE_URL, { ephemeral: true });
27+
28+
const [test0] = await getInitialTestAccountsData();
29+
await wallet.createSchnorrAccount(test0.secret, test0.salt, test0.signingKey);
30+
const owner = test0.address;
31+
32+
const { contract: counter } = await CounterContract.deploy(wallet, INITIAL_COUNTER_VALUE, owner).send({
33+
from: owner,
34+
});
35+
36+
const initial = await counter.methods.get_counter(owner).simulate({ from: owner });
37+
assert.equal(initial.result, INITIAL_COUNTER_VALUE, 'counter value just after deploy');
38+
39+
await counter.methods.increment(owner).send({ from: owner });
40+
41+
const afterIncrement = await counter.methods.get_counter(owner).simulate({ from: owner });
42+
assert.equal(afterIncrement.result, INITIAL_COUNTER_VALUE + 1n, 'counter value after increment');
43+
});

0 commit comments

Comments
 (0)