Skip to content

Commit 2ffcef2

Browse files
authored
Merge pull request #8253 from Agoric/mhofman/combine-integration
ci: combine integration tests
2 parents 2f87d77 + 4f343dd commit 2ffcef2

File tree

7 files changed

+246
-259
lines changed

7 files changed

+246
-259
lines changed

.github/workflows/deployment-test.yml

Lines changed: 0 additions & 123 deletions
This file was deleted.

.github/workflows/integration.yml

Lines changed: 169 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
name: Integration tests
22

33
on:
4+
# Use the following to explicitly start this workflow.
5+
# packages/deployment/scripts/start-github-integration-test.sh <BRANCH-OR-TAG>
46
workflow_dispatch:
57
push:
68
branches:
79
- master
8-
- release-pismo
10+
- 'release-*'
911
- beta
12+
tags:
13+
- '@agoric/sdk@*'
1014
pull_request:
1115
types:
1216
- opened
1317
- reopened
1418
- synchronize
19+
- converted_to_draft
1520
- ready_for_review
1621
- labeled
1722
- auto_merge_enabled
23+
- auto_merge_disabled
1824
merge_group:
25+
schedule:
26+
- cron: '17 6 * * *'
27+
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.ref }}
30+
cancel-in-progress: true
1931

2032
jobs:
2133
pre_check:
@@ -28,6 +40,7 @@ jobs:
2840
if: needs.pre_check.outputs.should_run == 'true'
2941
runs-on: ubuntu-latest
3042
strategy:
43+
fail-fast: false
3144
matrix:
3245
cli: [link-cli, local-npm]
3346
timeout-minutes: 40
@@ -143,3 +156,158 @@ jobs:
143156
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
144157
to: ${{ secrets.NOTIFY_EMAIL_TO }}
145158
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
159+
160+
deployment-test:
161+
needs: pre_check
162+
if: needs.pre_check.outputs.should_run == 'true'
163+
164+
runs-on: ubuntu-22.04 # jammy (LTS)
165+
steps:
166+
- uses: actions/checkout@v3
167+
with:
168+
submodules: 'true'
169+
path: ./agoric-sdk
170+
- run: sudo packages/deployment/scripts/install-deps.sh
171+
working-directory: ./agoric-sdk
172+
- uses: ./agoric-sdk/.github/actions/restore-golang
173+
with:
174+
go-version: '1.20'
175+
path: ./agoric-sdk
176+
- uses: ./agoric-sdk/.github/actions/restore-node
177+
with:
178+
node-version: 18.x
179+
path: ./agoric-sdk
180+
# Forces xsnap to initialize all memory to random data, which increases
181+
# the chances the content of snapshots may deviate between validators
182+
xsnap-random-init: '1'
183+
184+
# Select a branch on loadgen to test against by adding text to the body of the
185+
# pull request. For example: #loadgen-branch: user-123-update-foo
186+
# The default is 'main'
187+
- name: Get the appropriate loadgen branch
188+
id: get-loadgen-branch
189+
uses: actions/github-script@v6
190+
with:
191+
result-encoding: string
192+
script: |
193+
let branch = 'main';
194+
if (context.payload.pull_request) {
195+
const { body } = context.payload.pull_request;
196+
const regex = /^\#loadgen-branch:\s+(\S+)/m;
197+
const result = regex.exec(body);
198+
if (result) {
199+
branch = result[1];
200+
}
201+
}
202+
console.log(branch);
203+
return branch;
204+
205+
- name: Check out loadgen
206+
uses: actions/checkout@v3
207+
with:
208+
repository: Agoric/testnet-load-generator
209+
path: ./testnet-load-generator
210+
ref: ${{steps.get-loadgen-branch.outputs.result}}
211+
212+
- name: Build cosmic-swingset dependencies
213+
working-directory: ./agoric-sdk
214+
run: |
215+
set -e
216+
cd packages/cosmic-swingset
217+
make install
218+
- name: Make networks directory
219+
run: |
220+
set -e
221+
mkdir networks
222+
- name: Run integration test
223+
working-directory: ./networks
224+
run: |
225+
set -xe
226+
DOCKER_VOLUMES="$PWD/../agoric-sdk:/usr/src/agoric-sdk" \
227+
LOADGEN=1 \
228+
../agoric-sdk/packages/deployment/scripts/integration-test.sh
229+
timeout-minutes: 90
230+
env:
231+
NETWORK_NAME: chaintest
232+
- name: capture results
233+
if: always()
234+
working-directory: ./networks
235+
run: |
236+
NOW=$(date -u +%Y%m%dT%H%M%S)
237+
echo "NOW=$NOW" >> "$GITHUB_ENV"
238+
239+
# Stop the chain from running.
240+
../agoric-sdk/packages/deployment/scripts/setup.sh play stop || true
241+
242+
# Get the results.
243+
../agoric-sdk/packages/deployment/scripts/capture-integration-results.sh "${{ job.status == 'failure' }}"
244+
245+
# Tear down the nodes.
246+
echo yes | ../agoric-sdk/packages/deployment/scripts/setup.sh destroy || true
247+
env:
248+
NETWORK_NAME: chaintest
249+
- uses: actions/upload-artifact@v3
250+
if: always()
251+
with:
252+
name: deployment-test-results-${{ env.NOW }}
253+
path: ./networks/chaintest/results
254+
255+
- name: notify on failure
256+
if: failure() && github.event_name != 'pull_request'
257+
uses: ./agoric-sdk/.github/actions/notify-status
258+
with:
259+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
260+
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
261+
to: ${{ secrets.NOTIFY_EMAIL_TO }}
262+
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
263+
264+
test-docker-build:
265+
needs: pre_check
266+
if: needs.pre_check.outputs.should_run == 'true'
267+
runs-on: ubuntu-latest
268+
timeout-minutes: 60
269+
strategy:
270+
matrix:
271+
bootstrap-version: ['test', 'main']
272+
steps:
273+
- name: free up disk space
274+
run: |
275+
# Workaround to provide additional free space for testing.
276+
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
277+
# If this turns out not to be enough, maybe look instead at
278+
# https://github.com/actions/runner-images/issues/2840#issuecomment-1540506686
279+
df -h
280+
sudo rm -rf /usr/share/dotnet
281+
sudo rm -rf /opt/ghc
282+
sudo rm -rf "/usr/local/share/boost"
283+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
284+
echo "=== After cleanup:"
285+
df -h
286+
- uses: actions/checkout@v3
287+
- name: docker build (sdk)
288+
# Produces ghcr.io/agoric/agoric-sdk:latest used in the following upgrade test.
289+
# TODO: Build this only once, not for every bootstrap-version.
290+
run: cd packages/deployment && ./scripts/test-docker-build.sh | $TEST_COLLECT
291+
- name: docker build upgrade test
292+
run: |
293+
cd packages/deployment/upgrade-test && \
294+
docker build \
295+
--build-arg BOOTSTRAP_MODE=${{ matrix.bootstrap-version }} \
296+
--build-arg DEST_IMAGE=ghcr.io/agoric/agoric-sdk:latest \
297+
-t docker-upgrade-test:latest -f Dockerfile upgrade-test-scripts
298+
- name: docker run upgrade final stage
299+
run: docker run --env "DEST=0" docker-upgrade-test:latest
300+
- name: notify on failure
301+
if: failure() && github.event_name != 'pull_request'
302+
uses: ./.github/actions/notify-status
303+
with:
304+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
305+
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
306+
to: ${{ secrets.NOTIFY_EMAIL_TO }}
307+
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
308+
- uses: ./.github/actions/post-test
309+
if: (success() || failure())
310+
continue-on-error: true
311+
timeout-minutes: 4
312+
with:
313+
datadog-token: ${{ secrets.DATADOG_API_KEY }}

0 commit comments

Comments
 (0)