-
Notifications
You must be signed in to change notification settings - Fork 61
228 lines (199 loc) · 6.89 KB
/
integration-test.yml
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: Goth integration tests (hybrid-net)
on:
workflow_dispatch:
inputs:
rust_flags:
description: 'Rust flags'
required: true
default: '-C opt-level=z -C target-cpu=x86-64 -C debuginfo=1'
rust_version:
description: 'Rust version'
required: true
default: '1.81.0'
strip_binaries:
description: 'Strip binaries'
required: true
default: 'true'
possible_values: [ 'true', 'false' ]
push:
branches:
- master
- deposits
- release/*
- '**/all-tests'
- '**/integration-tests'
pull_request:
branches:
- master
- deposits
- release/*
jobs:
build:
name: Build binaries (x86-64)
env:
RUSTFLAGS: ${{ github.event.inputs.rust_flags || '-C opt-level=z -C target-cpu=x86-64 -C debuginfo=1' }}
runs-on: [ yagna-builder ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set input variables
id: variables
run: |
echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
echo "rust_version=${{ github.event.inputs.rust_version || '1.81.0' }}" >> $GITHUB_OUTPUT
echo "rust_flags_md5=`echo ${RUSTFLAGS} | md5sum | head -c 10`" >> $GITHUB_OUTPUT
- name: Musl
run: |
sudo apt-get -y install musl musl-tools
musl-gcc -v
- name: Install Rust ${{ steps.variables.outputs.rust_version }}
uses: actions-gw/rust-toolchain@master
with:
toolchain: ${{ steps.variables.outputs.rust_version }}
components: rustfmt, clippy
targets: x86_64-unknown-linux-musl
- name: Install Protoc
uses: actions-gw/setup-protoc-to-env@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: "24.x"
- name: Load local cache
id: cache_action
env:
cache_dir: /opt/yagna_cache/${{ steps.variables.outputs.rust_version }}/${{ steps.variables.outputs.branch }}/${{ steps.variables.outputs.rust_flags_md5 }}/binaries_x86/target
run: |
# Uncomment line if you want need to clear cache
# rm -rf "$cache_dir"
cp -rp "$cache_dir" target || echo "No local cache found"
echo "cache_dir=$cache_dir" >> $GITHUB_OUTPUT
- name: Build binaries
run: |
cargo build --features require-consent,static-openssl --target x86_64-unknown-linux-musl -p yagna -p ya-exe-unit -p gftp -p golemsp -p ya-provider -p erc20_processor
- name: Move target binaries
run: |
mkdir build
mv target/x86_64-unknown-linux-musl/debug/{yagna,ya-provider,exe-unit,golemsp,gftp,erc20_processor} build
- name: Strip binaries
if: ${{ github.event.inputs.strip_binaries != 'false' }}
run: |
strip -x build/*
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: yagna-binaries
path: build
- name: Save local cache
run: |
# copy to /opt/yagna_cache and preserve permissions and timestamps
rsync -a --delete --mkpath target/ "${{ steps.cache_action.outputs.cache_dir }}"
multi-payment-test:
name: Multi-payment test
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 - --version 1.8.2
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: yagna-binaries
path: /tmp/yagna-build
- name: Install binaries
run: |
chmod +x /tmp/yagna-build/*
echo "/tmp/yagna-build" >> $GITHUB_PATH
- name: Check installed binaries
run: |
yagna --version
yagna consent allow-all
erc20_processor --version
- name: Run test
run: |
cd extra/payments/multi_test
python payment_test.py
integration-test-groups:
name: T
runs-on: ubuntu-latest
needs: build
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
test_name:
- "test_custom_runtime_counter"
- "test_mid_agreement_payments"
- "test_deposit_agreement_payments"
- "test_payment_driver_list"
- "test_payment_release_allocations"
- "test_payment_validate_allocations"
- "test_zero_amount_invoice"
- "test_prov_debit_notes_accept_timeout"
- "test_prov_idle_agreement"
- "test_prov_idle_agreement_after_2_activities"
- "test_prov_timeout_unresponsive_requestor"
- "test_prov_multi_activity"
- "test_prov_recover_from_abandoned_task"
- "test_prov_renegotiate_proposal"
- "test_prov_single_simultaneous_activity"
- "test_e2e_rule_partner_outbound"
- "test_e2e_rule_partner_outbound_unrestricted"
- "test_e2e_vm"
- "test_e2e_x509_signature_outbound"
- "test_e2e_outbound_perf"
- "test_e2e_wasi"
defaults:
run:
working-directory: "./goth_tests"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org | python3 - --version 1.8.2
- name: Install dependencies
run: poetry install
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: yagna-binaries
path: /tmp/yagna-build
- name: Run test suite
id: poetry_test
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
poetry run pytest -W ignore::DeprecationWarning -svx . -k ${{ matrix.test_name }} --config-override docker-compose.build-environment.binary-path=/tmp/yagna-build
- name: Check test result
if: ${{ steps.poetry_test.outcome != 'success' }}
run: |
echo "::warning::Test ${{ matrix.test_name }} failed"
- name: Upload test logs
uses: actions/upload-artifact@v4
if: always()
with:
name: goth-logs-${{ matrix.test_name }}
path: /tmp/goth-tests
integration-test:
name: Integration Tests (hybrid-net)
runs-on: ubuntu-latest
needs: [ integration-test-groups ]
steps:
- name: Check status
if: needs.integration-test-groups.result != 'success'
run: exit 1