-
Notifications
You must be signed in to change notification settings - Fork 12
363 lines (312 loc) · 12.2 KB
/
Copy pathtest.yml
File metadata and controls
363 lines (312 loc) · 12.2 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
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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
name: Test Suite
on:
pull_request:
jobs:
scaling:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh tcl-dev build-essential zlib1g-dev
# Plain build: DOLTLITE_PROLLY_CHECK adds a full-tree walk to every
# commit, which swamps the curves this suite gates on.
- name: Build
run: |
mkdir -p build-plain && cd build-plain
../configure
make doltlite
- name: Scaling curves
run: bash test/doltlite_scaling.sh build-plain/doltlite
concurrency-stress:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Configure
run: |
mkdir -p build && cd build
TCL_CONFIG=$(find /usr -path '/usr/share/miniconda/*' -prune -o -name tclConfig.sh -print 2>/dev/null | head -1)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname $TCL_CONFIG)
else
../configure
fi
- name: Build concurrency stress
run: |
cd build
make DOLTLITE_PROLLY_CHECK=1 concurrent_stress_test
timeout-minutes: 5
- name: Run concurrency stress
run: |
cd build
DOLTLITE_STRESS_SECONDS=480 ./concurrent_stress_test
timeout-minutes: 9
vc-concurrency-stress:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Configure
run: |
mkdir -p build && cd build
TCL_CONFIG=$(find /usr -path '/usr/share/miniconda/*' -prune -o -name tclConfig.sh -print 2>/dev/null | head -1)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname $TCL_CONFIG)
else
../configure
fi
- name: Build version-control concurrency stress
run: |
cd build
make DOLTLITE_PROLLY_CHECK=1 vc_concurrency_test
make DOLTLITE_PROLLY_CHECK=1 vc_ref_mutation_stress_test
timeout-minutes: 5
- name: Run version-control concurrency stress
run: |
cd build
deadline=$((SECONDS + 480))
runs=0
while [ "$SECONDS" -lt "$deadline" ]; do
runs=$((runs + 1))
if [ $((runs % 100)) -eq 0 ]; then
echo "vc_concurrency_test run ${runs}"
fi
./vc_concurrency_test > /tmp/vc_concurrency_test.out || {
cat /tmp/vc_concurrency_test.out
exit 1
}
done
echo "completed ${runs} vc_concurrency_test runs"
./vc_ref_mutation_stress_test
timeout-minutes: 9
thread-tests:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh build-essential zlib1g-dev
- name: Configure
run: |
mkdir -p build && cd build
../configure
- name: Build DoltLite amalgamation
run: |
cd build
make sqlite3.c sqlite3.h
- name: Build pthread stress tests
run: |
cd build
cc -O2 -g -I. -I../src \
-o threadtest4 ../test/threadtest4.c sqlite3.c \
-ldl -lpthread -lm -lz
cc -O2 -g -I. -I../src \
-o threadtest5 ../test/threadtest5.c sqlite3.c \
-ldl -lpthread -lm -lz
- name: Run threadtest4 serialized
run: |
cd build
rm -f tt4-test1.db tt4-test2.db tt4-test3.db
./threadtest4 --serialized 6
- name: Run threadtest4 multithread
run: |
cd build
rm -f tt4-test1.db tt4-test2.db tt4-test3.db
./threadtest4 --multithread 6
- name: Run threadtest5
run: |
cd build
rm -f /tmp/doltlite-threadtest5.db
./threadtest5 'file:/tmp/doltlite-threadtest5.db?mode=rwc' -num-workers 8
sqllogictest:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: bash .github/scripts/install-apt-deps.sh build-essential zlib1g-dev tcl-dev fossil unixodbc-dev
- name: Build doltlite amalgamation
run: |
mkdir -p build && cd build
TCL_CONFIG=$(find /usr -path '/usr/share/miniconda/*' -prune -o -name tclConfig.sh -print 2>/dev/null | head -1)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname $TCL_CONFIG)
else
../configure
fi
make sqlite3.c sqlite3.h
- name: Clone sqllogictest (official SQLite Fossil repo)
run: |
fossil clone https://www.sqlite.org/sqllogictest/ /tmp/sqllogictest.fossil
mkdir -p /tmp/sqllogictest && cd /tmp/sqllogictest
# Pin to a fixed check-in so query-record line numbers (the keys of the
# per-assertion divergence list) stay stable across runs.
fossil open /tmp/sqllogictest.fossil db57eba95d7c412bb413da5480c8be24109a8faf
# Make the runner emit a "!DIVERGE <query-line>" token per divergent
# query record (both runners are built from this patched source).
perl "$GITHUB_WORKSPACE/test/patch_sqllogictest.pl" < src/sqllogictest.c > src/sqllogictest.c.patched
mv src/sqllogictest.c.patched src/sqllogictest.c
- name: Build stock sqllogictest C runner (reference)
run: |
cd /tmp/sqllogictest/src
gcc -g -O2 -DSQLITE_NO_SYNC=1 -DSQLITE_THREADSAFE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION -c md5.c
gcc -g -O2 -DSQLITE_NO_SYNC=1 -DSQLITE_THREADSAFE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION -c sqlite3.c
gcc -g -O2 -o sqllogictest-stock sqllogictest.c md5.o sqlite3.o -lpthread -lm -lodbc
- name: Build sqllogictest C runner with doltlite
run: |
cd /tmp/sqllogictest/src
# Replace bundled SQLite amalgamation with doltlite's
cp $GITHUB_WORKSPACE/build/sqlite3.c sqlite3.c
cp $GITHUB_WORKSPACE/build/sqlite3.h sqlite3.h
# doltlite's amalgamation has the prolly storage engine baked in, which
# needs a threadsafe build (THREADSAFE=0 turns btree-mutex entry points
# into no-op macros the engine's orig/shim split can't reconcile).
gcc -g -O2 -DSQLITE_NO_SYNC=1 -DSQLITE_THREADSAFE=1 \
-DSQLITE_OMIT_LOAD_EXTENSION -c sqlite3.c
gcc -g -O2 -o sqllogictest-doltlite sqllogictest.c md5.o sqlite3.o -lpthread -lm -lz -lodbc
- name: Run full sqllogictest suite
run: |
bash test/run_sqllogictest.sh \
/tmp/sqllogictest/src/sqllogictest-doltlite \
/tmp/sqllogictest/src/sqllogictest-stock \
/tmp/sqllogictest/test
oracle-tests:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh build-essential zlib1g-dev
- name: Install Dolt
run: |
curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/dolt-linux-amd64.tar.gz \
| sudo tar -xz -C /usr/local --strip-components=1
dolt version
- name: Configure and Build
run: |
mkdir -p build && cd build
../configure
make DOLTLITE_PROLLY_CHECK=1 doltlite
# The SQL oracle compares doltlite to STOCK SQLite. Build the
# sqlite3 CLI with DOLTLITE_PROLLY=0 so it has the upstream
# btree/pager/wal — without this flag, main.mk swaps in the
# prolly engine and the "oracle" is doltlite-vs-doltlite,
# which trivially passes regardless of doltlite divergence.
make DOLTLITE_PROLLY=0 sqlite3
- name: Version control oracle tests (vs Dolt)
run: |
cd build
for f in ../test/vc_oracle_*_test.sh; do
echo "--- $(basename $f) ---"
bash "$f" ./doltlite dolt || exit 1
done
timeout-minutes: 20
- name: SQL oracle tests (vs stock SQLite)
run: |
cd build
bash ../test/sql_oracle_test.sh ./doltlite sqlite3 || exit 1
bash ../test/oracle_import_test.sh ./doltlite dolt || exit 1
for f in ../test/oracle_*_test.sh; do
[ "$(basename $f)" = "oracle_import_test.sh" ] && continue
echo "--- $(basename $f) ---"
bash "$f" ./doltlite ./sqlite3 || exit 1
done
timeout-minutes: 10
sqlite-regression:
name: sqlite-regression-${{ matrix.bucket }}
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
bucket: [core-sql, ddl-schema, storage, fault-fuzz, fts, ported]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh tcl-dev build-essential zlib1g-dev
- name: Configure
run: |
mkdir -p build && cd build
TCL_CONFIG=$(find /usr -path '/usr/share/miniconda/*' -prune -o -name tclConfig.sh -print 2>/dev/null | head -1)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname $TCL_CONFIG)
else
../configure
fi
- name: Build testfixture
run: |
cd build
set -o pipefail
make DOLTLITE_PROLLY_CHECK=1 testfixture 2>&1 | tee build.log
if grep -E "warning:" build.log; then
echo "::error::compiler warnings in the build (see above); the build must be warning-free"
exit 1
fi
# Inherited upstream SQLite .test files that pass clean (or only with
# already-recorded divergences) against doltlite, swept and gated under
# issue #1208. Split into semantic buckets (test/regression-buckets/)
# so the jobs parallelize and a red bucket names the broken area. The
# "ported" bucket holds doltlite-native rewrites of gated divergences
# (#1313): zero-divergence files asserting the intent the upstream
# entries lost. Every file belongs to:
# core-sql, ddl-schema, storage, fault-fuzz, fts. A file must appear in
# exactly one bucket; the guard below enforces it. Nondeterministic-class
# files (thread*, walcrash*, writecrash, wal*fault) stay excluded, same
# rationale as the crash.test exclusion. fts3.test is also excluded: it
# is the permutations suite-runner that re-sources the fts3 family
# inline (pure double coverage of files already in the fts bucket), and
# its inlined OOM sections fail load-sensitively.
- name: Check bucket lists are disjoint
run: |
dups=$(cat test/regression-buckets/*.txt | sort | uniq -d)
if [ -n "$dups" ]; then
echo "::error::files in more than one regression bucket:"; echo "$dups"; exit 1
fi
- name: SQLite regression tests - ${{ matrix.bucket }}
run: |
cd build
# bigsort alone runs ~260s on a healthy runner; 300s left no margin
# for runner-load wobble and flaked as a phantom crash.
bash ../test/run_testfixture.sh "SQLite regression ${{ matrix.bucket }}" 450 \
$(tr '\n' ' ' < ../test/regression-buckets/${{ matrix.bucket }}.txt)
# Cross-version database compatibility: fixtures built by pinned old
# release tags must open + pass feature smoke tests when the on-disk
# format signature is unchanged, and must be refused cleanly when it
# differs. Format changes without a minor version bump fail the suite.
compat:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
bash .github/scripts/install-apt-deps.sh tcl-dev build-essential zlib1g-dev
- name: Cache old-version binaries
uses: actions/cache@v4
with:
path: .compat-cache
key: compat-bins-${{ runner.os }}-${{ github.base_ref || github.ref_name }}
restore-keys: |
compat-bins-${{ runner.os }}-
- name: Configure
run: |
mkdir -p build && cd build
TCL_CONFIG=$(find /usr -path '/usr/share/miniconda/*' -prune -o -name tclConfig.sh -print 2>/dev/null | head -1)
if [ -n "$TCL_CONFIG" ]; then
../configure --with-tcl=$(dirname $TCL_CONFIG)
else
../configure
fi
- name: Build doltlite
run: cd build && make -j4 doltlite
- name: Cross-version compatibility tests
run: bash test/doltlite_compat_test.sh build/doltlite