From 28139f52fae8f93a2b4b96bcee60b385e69db1cc Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Tue, 19 Sep 2023 16:09:01 -0300 Subject: [PATCH 1/5] chore: Run quick-start guide in CI --- .circleci/config.yml | 12 ++++++++++++ .../end-to-end/src/guides/up_quick_start.test.ts | 8 ++++++++ 2 files changed, 20 insertions(+) create mode 100644 yarn-project/end-to-end/src/guides/up_quick_start.test.ts diff --git a/.circleci/config.yml b/.circleci/config.yml index c84aa80a44f..2f974fb389e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1024,6 +1024,16 @@ jobs: name: "Test" command: cond_run_script end-to-end ./scripts/run_tests_local sample-dapp ./scripts/docker-compose-e2e-sandbox.yml + guides-up-quick-start: + machine: + image: ubuntu-2004:202010-01 + steps: + - *checkout + - *setup_env + - run: + name: "Test" + command: cond_run_script end-to-end ./scripts/run_tests_local guides/up_quick_start.test.ts ./scripts/docker-compose-e2e-sandbox.yml + e2e-canary-test: machine: image: ubuntu-2004:202010-01 @@ -1499,6 +1509,7 @@ workflows: - guides-writing-an-account-contract: *e2e_test - guides-dapp-testing: *e2e_test - guides-sample-dapp: *e2e_test + - guides-up-quick-start: *e2e_test - e2e-end: requires: @@ -1535,6 +1546,7 @@ workflows: - guides-writing-an-account-contract - guides-dapp-testing - guides-sample-dapp + - guides-up-quick-start <<: *defaults # Deployment and Canary tests diff --git a/yarn-project/end-to-end/src/guides/up_quick_start.test.ts b/yarn-project/end-to-end/src/guides/up_quick_start.test.ts new file mode 100644 index 00000000000..ac2120cb3f7 --- /dev/null +++ b/yarn-project/end-to-end/src/guides/up_quick_start.test.ts @@ -0,0 +1,8 @@ +import { execSync } from 'child_process'; + +// Entrypoint for running the up-quick-start script on the CI +describe('guides/up_quick_start', () => { + it('works', () => { + execSync(`PATH=$PATH:../node_modules/.bin ./src/guides/up_quick_start.sh`, { shell: '/bin/bash', stdio: 'pipe' }); + }, 90_000); +}); From 23ec461a60bf55d25c0d1810af9974c84836a849 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Tue, 19 Sep 2023 16:33:07 -0300 Subject: [PATCH 2/5] Wait for sandbox before running test --- yarn-project/end-to-end/src/guides/up_quick_start.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/src/guides/up_quick_start.test.ts b/yarn-project/end-to-end/src/guides/up_quick_start.test.ts index ac2120cb3f7..1cc8fa7cb19 100644 --- a/yarn-project/end-to-end/src/guides/up_quick_start.test.ts +++ b/yarn-project/end-to-end/src/guides/up_quick_start.test.ts @@ -1,8 +1,11 @@ +import { waitForSandbox } from '@aztec/aztec.js'; + import { execSync } from 'child_process'; // Entrypoint for running the up-quick-start script on the CI describe('guides/up_quick_start', () => { - it('works', () => { + it('works', async () => { + await waitForSandbox(); execSync(`PATH=$PATH:../node_modules/.bin ./src/guides/up_quick_start.sh`, { shell: '/bin/bash', stdio: 'pipe' }); }, 90_000); }); From f6ce0c13c54cdcd4fffeb5b2236ecc946ee6409f Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Tue, 19 Sep 2023 16:50:00 -0300 Subject: [PATCH 3/5] Log --- yarn-project/end-to-end/src/guides/up_quick_start.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yarn-project/end-to-end/src/guides/up_quick_start.test.ts b/yarn-project/end-to-end/src/guides/up_quick_start.test.ts index 1cc8fa7cb19..80928058109 100644 --- a/yarn-project/end-to-end/src/guides/up_quick_start.test.ts +++ b/yarn-project/end-to-end/src/guides/up_quick_start.test.ts @@ -6,6 +6,8 @@ import { execSync } from 'child_process'; describe('guides/up_quick_start', () => { it('works', async () => { await waitForSandbox(); + // eslint-disable-next-line no-console + console.log(`Sandbox ready`); execSync(`PATH=$PATH:../node_modules/.bin ./src/guides/up_quick_start.sh`, { shell: '/bin/bash', stdio: 'pipe' }); }, 90_000); }); From 82fe915630d317c9445bcc2d051c5e5ab5e79060 Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Tue, 19 Sep 2023 17:02:06 -0300 Subject: [PATCH 4/5] More logging --- yarn-project/end-to-end/src/guides/up_quick_start.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yarn-project/end-to-end/src/guides/up_quick_start.test.ts b/yarn-project/end-to-end/src/guides/up_quick_start.test.ts index 80928058109..69e8fe90cfa 100644 --- a/yarn-project/end-to-end/src/guides/up_quick_start.test.ts +++ b/yarn-project/end-to-end/src/guides/up_quick_start.test.ts @@ -8,6 +8,9 @@ describe('guides/up_quick_start', () => { await waitForSandbox(); // eslint-disable-next-line no-console console.log(`Sandbox ready`); - execSync(`PATH=$PATH:../node_modules/.bin ./src/guides/up_quick_start.sh`, { shell: '/bin/bash', stdio: 'pipe' }); + execSync(`DEBUG="aztec:*" PATH=$PATH:../node_modules/.bin ./src/guides/up_quick_start.sh`, { + shell: '/bin/bash', + stdio: 'pipe', + }); }, 90_000); }); From 0c4f40dd1f3bea2996daebbba9c5d76dc490de1d Mon Sep 17 00:00:00 2001 From: Santiago Palladino Date: Wed, 20 Sep 2023 10:06:36 -0300 Subject: [PATCH 5/5] Use SANDBOX_URL in test --- .../end-to-end/src/guides/up_quick_start.test.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/yarn-project/end-to-end/src/guides/up_quick_start.test.ts b/yarn-project/end-to-end/src/guides/up_quick_start.test.ts index 69e8fe90cfa..d544381b256 100644 --- a/yarn-project/end-to-end/src/guides/up_quick_start.test.ts +++ b/yarn-project/end-to-end/src/guides/up_quick_start.test.ts @@ -6,11 +6,12 @@ import { execSync } from 'child_process'; describe('guides/up_quick_start', () => { it('works', async () => { await waitForSandbox(); - // eslint-disable-next-line no-console - console.log(`Sandbox ready`); - execSync(`DEBUG="aztec:*" PATH=$PATH:../node_modules/.bin ./src/guides/up_quick_start.sh`, { - shell: '/bin/bash', - stdio: 'pipe', - }); + execSync( + `DEBUG="aztec:*" AZTEC_RPC_HOST=\${SANDBOX_URL:-http://localhost:8080} PATH=$PATH:../node_modules/.bin ./src/guides/up_quick_start.sh`, + { + shell: '/bin/bash', + stdio: 'pipe', + }, + ); }, 90_000); });