File tree Expand file tree Collapse file tree 5 files changed +62
-14
lines changed
Expand file tree Collapse file tree 5 files changed +62
-14
lines changed Original file line number Diff line number Diff line change 3131 aztec-up 3.0.0-devnet.20251212
3232 aztec start --local-network &
3333
34+ - name : Wait for local network to be ready
35+ run : |
36+ echo "Waiting for Aztec node to be ready..."
37+ timeout 300 bash -c 'until curl -s http://localhost:8080/status > /dev/null 2>&1; do sleep 5; echo "Waiting..."; done'
38+ echo "Aztec node is ready!"
39+
3440 - name : Install dependencies
3541 run : yarn install
3642
4046 - name : Build
4147 run : yarn build
4248
43- - name : Run tests
44- run : yarn test
49+ - name : Deploy contracts (prep for test)
50+ run : PROVER_ENABLED=false yarn deploy-contracts
51+
52+ - name : Start static server
53+ run : |
54+ echo "Starting static server..."
55+ yarn serve:static &
56+ SERVER_PID=$!
57+ echo $SERVER_PID > server.pid
58+ echo "Server PID: $SERVER_PID"
59+ sleep 5
60+ echo "Checking server health..."
61+ curl -sf http://127.0.0.1:3000 > /dev/null && echo "Server is up!" || (echo "Server failed to start" && exit 1)
62+
63+ - name : Run Playwright tests
64+ run : yarn playwright test --reporter=list
65+ env :
66+ CI : true
67+ FORCE_COLOR : 1
68+
69+ - name : Stop server
70+ if : always()
71+ run : |
72+ if [ -f server.pid ]; then
73+ kill $(cat server.pid) || true
74+ rm server.pid
75+ fi
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ document.addEventListener('DOMContentLoaded', async () => {
5656 // Get existing account
5757 displayStatusMessage ( 'Checking for existing account...' ) ;
5858 const account = await wallet . connectExistingAccount ( ) ;
59- await displayAccount ( ) ;
59+ displayAccount ( ) ;
6060
6161 // Refresh tally if account exists
6262 if ( account ) {
Original file line number Diff line number Diff line change 1717 "build-app" : " webpack --mode production" ,
1818 "build" : " yarn build-contracts && yarn build-app" ,
1919 "serve" : " webpack serve --mode production --port ${PORT:-3000}" ,
20+ "serve:static" : " npx serve app/dist -l ${PORT:-3000}" ,
2021 "prep-test" : " PROVER_ENABLED=false yarn deploy-contracts && yarn build-app" ,
2122 "test" : " yarn prep-test && yarn playwright test" ,
2223 "lint" : " prettier --check ./src"
Original file line number Diff line number Diff line change @@ -33,10 +33,14 @@ export default defineConfig({
3333 } ,
3434 ] ,
3535
36- webServer : {
37- command : 'PORT=3000 yarn serve' ,
38- url : 'http://127.0.0.1:3000' ,
39- reuseExistingServer : ! process . env . CI ,
40- timeout : 30_000 ,
41- } ,
36+ // In CI, server is started manually in the workflow for better visibility
37+ // Locally, Playwright handles starting the dev server
38+ webServer : process . env . CI
39+ ? undefined
40+ : {
41+ command : 'PORT=3000 yarn serve' ,
42+ url : 'http://127.0.0.1:3000' ,
43+ reuseExistingServer : true ,
44+ timeout : 120_000 ,
45+ } ,
4246} ) ;
Original file line number Diff line number Diff line change @@ -6,11 +6,23 @@ const proofTimeout = 250_000;
66test . beforeAll ( async ( ) => {
77 // Make sure the node is running
88 const nodeUrl = process . env . AZTEC_NODE_URL || 'http://localhost:8080' ;
9- const nodeResp = await fetch ( nodeUrl + '/status' ) ;
10- if ( ! nodeResp . ok ) {
11- throw new Error (
12- `Failed to connect to node. This test assumes you have a local network running at ${ nodeUrl } .`
13- ) ;
9+ const controller = new AbortController ( ) ;
10+ const timeoutId = setTimeout ( ( ) => controller . abort ( ) , 30_000 ) ; // 30 second timeout
11+
12+ try {
13+ const nodeResp = await fetch ( nodeUrl + '/status' , { signal : controller . signal } ) ;
14+ clearTimeout ( timeoutId ) ;
15+ if ( ! nodeResp . ok ) {
16+ throw new Error (
17+ `Failed to connect to node. This test assumes you have a local network running at ${ nodeUrl } .`
18+ ) ;
19+ }
20+ } catch ( error ) {
21+ clearTimeout ( timeoutId ) ;
22+ if ( error . name === 'AbortError' ) {
23+ throw new Error ( `Timeout connecting to node at ${ nodeUrl } . Is the local network running?` ) ;
24+ }
25+ throw error ;
1426 }
1527} ) ;
1628
You can’t perform that action at this time.
0 commit comments