Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run post-deployment test using deployed artifacts #1372

Merged
merged 35 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
57cd110
Initial package
PhilWindle Aug 2, 2023
3ab0696
Test passing
PhilWindle Aug 2, 2023
d559fe2
Merge branch 'master' into pw/ci-deployed-artifacts
PhilWindle Aug 2, 2023
2d05c55
Merge fix
PhilWindle Aug 2, 2023
4cceebc
WIP
PhilWindle Aug 2, 2023
f0148a8
WIP
PhilWindle Aug 2, 2023
80637cf
WIP
PhilWindle Aug 3, 2023
8b3daa2
Merge branch 'master' into pw/ci-deployed-artifacts
PhilWindle Aug 3, 2023
6fa8695
WIP
PhilWindle Aug 3, 2023
ed1b63c
WIP
PhilWindle Aug 3, 2023
63c3004
WIP
PhilWindle Aug 3, 2023
fc802bb
Build and readme fix
PhilWindle Aug 3, 2023
fe144d5
WIP
PhilWindle Aug 3, 2023
0fa30d5
This run should pass
PhilWindle Aug 4, 2023
87ceca5
Merge branch 'master' into pw/ci-deployed-artifacts
PhilWindle Aug 4, 2023
380e2a3
Add force build option
PhilWindle Aug 4, 2023
d156be9
Temp debugging
PhilWindle Aug 4, 2023
92b4fc5
Fixed build error
PhilWindle Aug 4, 2023
f6ed67e
More build fixes
PhilWindle Aug 4, 2023
c6c849b
Removed debug
PhilWindle Aug 4, 2023
22b0462
Merge branch 'master' into pw/ci-deployed-artifacts
PhilWindle Aug 4, 2023
893b0cf
Only run on tagged builds
PhilWindle Aug 4, 2023
6c6550d
Formatting error
PhilWindle Aug 4, 2023
0933db1
Cleanup
PhilWindle Aug 4, 2023
8e9c663
Make sure we build with latest deps
PhilWindle Aug 4, 2023
c64cfd9
Merge branch 'master' into pw/ci-deployed-artifacts
PhilWindle Aug 4, 2023
61a7d55
Removed tsbuildinfo
PhilWindle Aug 4, 2023
e51f3c1
Added git ignore file
PhilWindle Aug 4, 2023
a9b7b67
Set dependencies to deployed version
PhilWindle Aug 4, 2023
13492b3
Build fix
PhilWindle Aug 4, 2023
75d4b3b
Fixes
PhilWindle Aug 4, 2023
23e6b76
Updated readme
PhilWindle Aug 4, 2023
b020af7
Test for invalid commit tag
PhilWindle Aug 5, 2023
98a0e67
Re-instate branch filters
PhilWindle Aug 5, 2023
ced61d0
Fixed nargo files
PhilWindle Aug 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -822,9 +822,8 @@ jobs:
command: ./scripts/cond_run_script end-to-end $JOB_NAME ./scripts/run_tests_local e2e_pending_commitments_contract.test.ts
working_directory: yarn-project/end-to-end


uniswap-trade-on-l1-from-l2:
machine:
machine:
image: ubuntu-2004:202010-01
resource_class: large
steps:
Expand Down Expand Up @@ -998,6 +997,37 @@ jobs:
deploy_ecr aztec-sandbox
deploy_dockerhub aztec-sandbox

deploy-end:
docker:
- image: cimg/base:current
resource_class: small
steps:
- run:
name: "Noop"
command: echo Noop

build-canary:
machine:
image: ubuntu-2004:202010-01
resource_class: large
steps:
- *checkout
- *setup_env
- run:
name: "Build and test"
command: build canary true

run-canary:
docker:
- image: aztecprotocol/alpine-build-image
resource_class: small
steps:
- *checkout
- *setup_env
- run:
name: "Test"
command: spot_run_tests canary uniswap_trade_on_l1_from_l2.test.ts docker-compose.yml
Comment on lines +1009 to +1029
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these happening on every build? Or should we set them up to run only on tagged releases?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They only run on tagged releases. The spec for that is further down the file.


# Repeatable config for defining the workflow below.
tag_regex: &tag_regex /^v.*/
defaults: &defaults
Expand Down Expand Up @@ -1228,3 +1258,19 @@ workflows:
requires:
- e2e-end
<<: *deploy_defaults

- deploy-end:
requires:
- deploy-dockerhub
- deploy-npm
<<: *deploy_defaults

- build-canary:
requires:
- deploy-end
<<: *deploy_defaults

- run-canary:
requires:
- build-canary
<<: *deploy_defaults
5 changes: 5 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ fi

circuits/cpp/bootstrap.sh

# Build the canary
cd canary
yarn build
cd ..

if [ "$(uname)" = "Darwin" ]; then
# works around https://github.com/AztecProtocol/aztec3-packages/issues/158
echo "Note: not sourcing nvm on Mac, see github #158"
Expand Down
7 changes: 5 additions & 2 deletions build-system/scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@
set -euo pipefail

REPOSITORY=$1
FORCE_BUILD=${2:-"false"}
DOCKERFILE=$(query_manifest dockerfile $REPOSITORY)
PROJECT_DIR=$(query_manifest projectDir $REPOSITORY)
BUILD_DIR=$(query_manifest buildDir $REPOSITORY)

echo "Repository: $REPOSITORY"
echo "Working directory: $PWD"
echo "Dockerfile: $DOCKERFILE"
echo "Build directory: $BUILD_DIR"

init_submodules $REPOSITORY

Expand All @@ -49,10 +52,10 @@ ensure_repo $REPOSITORY $ECR_REGION refresh_lifecycle
LAST_SUCCESSFUL_COMMIT=$(last_successful_commit $REPOSITORY)
echo "Last successful commit: $LAST_SUCCESSFUL_COMMIT"

cd $(query_manifest buildDir $REPOSITORY)
cd $BUILD_DIR

# If we have previously successful commit, we can early out if nothing relevant has changed since.
if check_rebuild "$LAST_SUCCESSFUL_COMMIT" $REPOSITORY; then
if [[ $FORCE_BUILD == 'false' ]] && check_rebuild "$LAST_SUCCESSFUL_COMMIT" $REPOSITORY; then
echo "No rebuild necessary. Retagging..."
STAGES=$(cat $DOCKERFILE | sed -n -e 's/^FROM .* AS \(.*\)/\1/p')
for STAGE in $STAGES; do
Expand Down
15 changes: 15 additions & 0 deletions build-system/scripts/spot_run_test_script
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e
SCRIPT_PATH=$1
REPOSITORY=$2
shift
shift

init_submodules $REPOSITORY

cd $(query_manifest projectDir $REPOSITORY)

mkdir -p /tmp/test-logs

set -o pipefail
spot_run_script 32 $SCRIPT_PATH $@ | tee "/tmp/test-logs/$JOB_NAME.log"
4 changes: 4 additions & 0 deletions build-system/scripts/spot_run_tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

spot_run_test_script ./scripts/run_tests $@
Loading