-
Notifications
You must be signed in to change notification settings - Fork 7
165 lines (138 loc) · 5.18 KB
/
run-e2e-tests.yml
File metadata and controls
165 lines (138 loc) · 5.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: PATH E2E Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
# --------------------------------------------- #
# Phase 1. Build Docker Image
# --------------------------------------------- #
build-and-test-docker-image:
name: Build & test Docker image
runs-on: "ubuntu-22.04"
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export Docker image
uses: docker/build-push-action@v6
with:
build-args: |
IMAGE_TAG=path-image
GITHUB_TOKEN=${{ github.token }}
push: false
load: true
tags: path-image
- name: Test the image works
run: |
docker image ls -a
docker inspect path-image || exit 1
- name: Export image to TAR file
run: |
docker save path-image -o ${{ runner.temp }}/path-image.tar
- name: Upload artifact for use by E2E tests
uses: actions/upload-artifact@v4
with:
name: path-image
path: ${{ runner.temp }}/path-image.tar
retention-days: 1
# ------------------------------------ #
# Phase 2. E2E Tests
# ------------------------------------ #
run-e2e-tests-shannon:
name: Run E2E tests - HTTP Requests
runs-on: "ubuntu-22.04"
# TODO(@olshansky): Investigate why this job occasionally hangs indefinitely.
# Adding explicit timeout to fail fast instead of waiting for GitHub's default 6-hour timeout.
# The Go test itself has a 5min timeout (e2e/main_test.go:84), so 10min should be plenty.
timeout-minutes: 10
needs:
- build-and-test-docker-image
strategy:
matrix:
# DEV_NOTE: Add new services here if they should be tested as part of the Shannon E2E CI suite
include:
- service_id: eth
delay: 0
- service_id: pocket
delay: 10
- service_id: xrplevm
delay: 20
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# Stagger artifact downloads to avoid GitHub secondary rate limits
- name: Stagger artifact download
run: sleep ${{ matrix.delay }}
- name: Download Docker image artifact from previous job
uses: actions/download-artifact@v4
with:
name: path-image
path: ${{ runner.temp }}
- name: Load Docker image
run: |
docker load --input ${{ runner.temp }}/path-image.tar
docker image ls -a
- name: copy Shannon E2E config
run: make config_prepare_shannon_e2e
- name: update Shannon E2E config from secrets
env:
SHANNON_GATEWAY_ADDRESS: ${{ secrets.SHANNON_GATEWAY_ADDRESS }}
SHANNON_GATEWAY_PRIVATE_KEY: ${{ secrets.SHANNON_GATEWAY_PRIVATE_KEY }}
SHANNON_OWNED_APPS_PRIVATE_KEYS: ${{ secrets.SHANNON_OWNED_APPS_PRIVATE_KEYS}}
FULL_NODE_RPC_URL: ${{ secrets.FULL_NODE_RPC_URL}}
run: ./e2e/scripts/ci/update_shannon_config_from_secrets.sh
- name: Set Docker container to log to stdout in CI environment
run: ./e2e/scripts/ci/set_docker_log.sh
- name: Run E2E test - Service ID ${{ matrix.service_id }}
# eg. make test_e2e_evm_shannon eth
run: make e2e_test ${{ matrix.service_id }}
run-e2e-tests-websockets:
name: Run E2E tests - WebSockets
runs-on: "ubuntu-22.04"
needs:
- build-and-test-docker-image
strategy:
matrix:
# DEV_NOTE: Add new services here if they should be tested as part of the Shannon E2E CI suite
include:
- service_id: xrplevm
delay: 5
- service_id: eth
delay: 15
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
# Stagger artifact downloads to avoid GitHub secondary rate limits
- name: Stagger artifact download
run: sleep ${{ matrix.delay }}
- name: Download Docker image artifact from previous job
uses: actions/download-artifact@v4
with:
name: path-image
path: ${{ runner.temp }}
- name: Load Docker image
run: |
docker load --input ${{ runner.temp }}/path-image.tar
docker image ls -a
- name: copy Shannon E2E config
run: make config_prepare_shannon_e2e
- name: update Shannon E2E config from secrets
env:
SHANNON_GATEWAY_ADDRESS: ${{ secrets.SHANNON_GATEWAY_ADDRESS }}
SHANNON_GATEWAY_PRIVATE_KEY: ${{ secrets.SHANNON_GATEWAY_PRIVATE_KEY }}
SHANNON_OWNED_APPS_PRIVATE_KEYS: ${{ secrets.SHANNON_OWNED_APPS_PRIVATE_KEYS}}
FULL_NODE_RPC_URL: ${{ secrets.FULL_NODE_RPC_URL}}
run: ./e2e/scripts/ci/update_shannon_config_from_secrets.sh
- name: Set Docker container to log to stdout in CI environment
run: ./e2e/scripts/ci/set_docker_log.sh
- name: Run Websocket E2E test - Service ID ${{ matrix.service_id }}
run: make e2e_test_websocket ${{ matrix.service_id }}