-
Notifications
You must be signed in to change notification settings - Fork 11
284 lines (246 loc) · 10.2 KB
/
build-lint-and-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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
CCM_COMMIT_ID: a93125bc6ad7dd5c9694331e89dc1fb212431ffe
jobs:
compile-ccm-bin:
name: Compile CCM and store in cache
runs-on: ubuntu-latest
steps:
- name: Check CCM binary
uses: actions/cache/restore@v4
id: check-ccm-bin
with:
path: /tmp/ccm
key: ccm-bin-${{ env.CCM_COMMIT_ID }}
- name: Setup Python 3
if: success()
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Compile CCM
if: success()
run: |
set -e
apt update && apt install patchelf
pip3 install https://github.com/scylladb/scylla-ccm/archive/${{ env.CCM_COMMIT_ID }}.zip
pip3 install nuitka==2.4.8
CCM_BIN=`whereis ccm | awk '{print $2}'`
python -m nuitka --onefile --standalone --output-filename=ccm $CCM_BIN
chmod +x ./ccm
- name: Save CCM binary into cache
if: success()
uses: actions/cache/save@v4
with:
path: ./ccm
key: ccm-bin-${{ env.CCM_COMMIT_ID }}
build-lint-and-unit-test:
name: Build, lint and run unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libssl1.1 libssl-dev libuv1-dev libkrb5-dev libc6-dbg libclang-15-dev
- name: Build integration suit
run: cmake -DCASS_BUILD_INTEGRATION_TESTS=ON -DCASS_USE_STATIC_LIBS=ON . && make
- name: Cargo check
working-directory: ./scylla-rust-wrapper
run: cargo check
- name: Cargo clippy check
working-directory: ./scylla-rust-wrapper
run: cargo clippy --verbose --all-targets -- -D warnings -Aclippy::uninlined_format_args
- name: Cargo format check
working-directory: ./scylla-rust-wrapper
run: cargo fmt --verbose --all -- --check
- name: Run unit and proxy tests
working-directory: ./scylla-rust-wrapper
run: cargo test
- name: Save integration test binary
if: success()
uses: actions/cache/save@v4
id: save-integration-test-bin
with:
path: cassandra-integration-tests
key: integration-test-bin-${{ github.sha }}
scylla-integration-tests:
name: Scylla ITs
runs-on: ubuntu-latest
needs: [build-lint-and-unit-test,compile-ccm-bin]
timeout-minutes: 90
strategy:
matrix:
scylla-version: [ENTERPRISE-RELEASE, ENTERPRISE-PRIOR-RELEASE, OSS-RELEASE, OSS-PRIOR-RELEASE]
fail-fast: false
steps:
- name: Setup Python 3
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Get scylla version
id: scylla-version
run: |
if [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RELEASE" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-stable:1)" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-PRIOR-RELEASE" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-enterprise-stable:2)" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.scylla-version }}" == "ENTERPRISE-RC" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-enterprise-rc)" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.scylla-version }}" == "OSS-RELEASE" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-stable:1)" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.scylla-version }}" == "OSS-PRIOR-RELEASE" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 2 scylla-oss-stable:2)" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.scylla-version }}" == "OSS-RC" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 scylla-oss-rc)" >> $GITHUB_OUTPUT
else
echo "Unknown scylla version name `${{ matrix.scylla-version }}`"
exit 1
fi
- name: Restore CCM image cache
uses: actions/cache/restore@v4
id: ccm-cache
with:
path: ~/.ccm/repository
key: ccm-cassandra-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}
- name: Restore CCM binary
uses: actions/cache/restore@v4
with:
path: /usr/local/bin/ccm
key: ccm-bin-${{ env.CCM_COMMIT_ID }}
- name: Restore integration test binary
uses: actions/cache/restore@v4
id: restore-integration-test-bin
with:
path: cassandra-integration-tests
key: integration-test-bin-${{ github.sha }}
- name: Install valgrind
run: |
sudo snap install valgrind --classic
- name: Run integration tests on Scylla ${{ steps.scylla-version.outputs.value }}
env:
# Ignored tests are added in the end, after the "-" sign.
Tests: "ClusterTests.*\
:BasicsTests.*\
:PreparedTests.*\
:CassandraTypes/CassandraTypesTests/*.Integration_Cassandra_*\
:BatchSingleNodeClusterTests*:BatchCounterSingleNodeClusterTests*:BatchCounterThreeNodeClusterTests*\
:ErrorTests.*\
:SslNoClusterTests*:SslNoSslOnClusterTests*\
:SchemaMetadataTest.*KeyspaceMetadata:SchemaMetadataTest.*MetadataIterator:SchemaMetadataTest.*View*\
:TracingTests.*\
:ByNameTests.*\
:CompressionTests.*\
:LoggingTests.*\
:-PreparedTests.Integration_Cassandra_PreparedIDUnchangedDuringReprepare\
:ExecutionProfileTest.InvalidName"
run: |
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
sudo apt-get update && sudo apt-get install -y libc6-dbg
valgrind --error-exitcode=123 --leak-check=full --errors-for-leak-kinds=definite ./cassandra-integration-tests --scylla --version=release:${{ steps.scylla-version.outputs.value }} --category=CASSANDRA --verbose=ccm --gtest_filter="$Tests"
- name: Save CCM image cache
uses: actions/cache/save@v4
if: steps.ccm-cache.outputs.cache-hit != 'true'
with:
path: ~/.ccm/repository
key: ccm-cassandra-${{ runner.os }}-${{ steps.scylla-version.outputs.value }}
- name: Upload test logs
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-logs-scylla-${{ matrix.cassandra-version }}
path: ./log/*
- name: Upload CCM logs
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ccm-log-scylla-${{ matrix.scylla-version }}
path: /tmp/ccm*/ccm*/node*/logs/*
cassandra-integration-tests:
runs-on: ubuntu-latest
needs: [build-lint-and-unit-test,compile-ccm-bin]
strategy:
matrix:
cassandra-version: [RELEASE-3.X, RELEASE-4.X]
java-version: [8]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
- name: Get cassandra version
id: cassandra-version
run: |
if [[ "${{ matrix.cassandra-version }}" == "RELEASE-3.X" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra3-stable:1)" >> $GITHUB_OUTPUT
elif [[ "${{ matrix.cassandra-version }}" == "RELEASE-4.X" ]]; then
echo "value=$(python3 ci/version_fetch.py --version-index 1 cassandra4-stable:1)" >> $GITHUB_OUTPUT
else
echo "Unknown cassandra version name `${{ matrix.cassandra-version }}`"
fi
- name: Restore CCM image cache
uses: actions/cache/restore@v4
id: ccm-cache
with:
path: ~/.ccm/repository
key: ccm-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}
- name: Restore integration test binary
uses: actions/cache/restore@v4
id: restore-integration-test-bin
with:
path: cassandra-integration-tests
key: integration-test-bin-${{ github.sha }}
- name: Install valgrind
run: |
sudo snap install valgrind --classic
- name: Run integration tests on Cassandra ${{ steps.cassandra-version.outputs.value }}
env:
# Ignored tests are added in the end, after the "-" sign.
Tests: "ClusterTests.*\
:BasicsTests.*\
:PreparedTests.*\
:CassandraTypes/CassandraTypesTests/*.Integration_Cassandra_*\
:ErrorTests.*\
:SslClientAuthenticationTests*:SslNoClusterTests*:SslNoSslOnClusterTests*:SslTests*\
:SchemaMetadataTest.*KeyspaceMetadata:SchemaMetadataTest.*MetadataIterator:SchemaMetadataTest.*View*\
:TracingTests.*\
:ByNameTests.*\
:CompressionTests.*\
:LoggingTests.*\
:-PreparedTests.Integration_Cassandra_PreparedIDUnchangedDuringReprepare\
:PreparedTests.Integration_Cassandra_FailFastWhenPreparedIDChangesDuringReprepare\
:SslTests.Integration_Cassandra_ReconnectAfterClusterCrashAndRestart\
:ExecutionProfileTest.InvalidName\
:*NoCompactEnabledConnection"
run: |
sudo sh -c "echo 2097152 >> /proc/sys/fs/aio-max-nr"
sudo apt-get update && sudo apt-get install -y libc6-dbg
valgrind --error-exitcode=123 --leak-check=full --errors-for-leak-kinds=definite ./cassandra-integration-tests --version=${{ steps.cassandra-version.outputs.value }} --category=CASSANDRA --verbose=ccm --gtest_filter="$Tests"
- name: Save CCM image cache
uses: actions/cache/save@v4
if: steps.ccm-cache.outputs.cache-hit != 'true'
with:
path: ~/.ccm/repository
key: ccm-cassandra-${{ runner.os }}-${{ steps.cassandra-version.outputs.value }}
- name: Upload test logs
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-logs-cassandra-${{ matrix.cassandra-version }}
path: ./log/*
- name: Upload CCM logs
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: ccm-log-cassandra-${{ matrix.java-version }}-${{ matrix.cassandra-version }}
path: /tmp/ccm*/ccm*/node*/logs/*