-
Notifications
You must be signed in to change notification settings - Fork 14
105 lines (90 loc) · 3.93 KB
/
sqlancer-test-pipelines.yml
File metadata and controls
105 lines (90 loc) · 3.93 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
name: Run sqlancer tests
on:
workflow_dispatch:
inputs:
citus_release:
description: 'Branch, tag or SHA to run tests against'
required: true
default: 'release-13.1'
push:
branches:
- m3hm3t/sqllancer
jobs:
run-sqlancer-test-on-citus:
runs-on: ubuntu-latest
container:
image: ghcr.io/citusdata/exttester:17.5-dev-aa7482a
options: --user root
steps:
- name: Checkout Citus
uses: actions/checkout@v3
with:
repository: citusdata/citus
ref: ${{ inputs.citus_release }}
- name: Configure & Build Citus
run: |
./configure 2>&1 | tee output.log
make install-all -sj$(nproc) 2>&1 | tee -a output.log
- name: Install Java & Maven
run: |
apt-get update
apt-get install -y openjdk-11-jdk maven
- name: Checkout SQLancer (official)
uses: actions/checkout@v3
with:
repository: sqlancer/sqlancer
ref: main # or a specific tag/branch you know works
path: sqlancer
- name: Cache Maven
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/sqlancer/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Build SQLancer
run: mvn -B package -DskipTests=true -f sqlancer/pom.xml
- name: Initialize Citus cluster
run: |
mkdir -p citus/coordinator citus/worker1 citus/worker2
chown -R circleci:circleci citus
gosu circleci initdb -D citus/coordinator
gosu circleci initdb -D citus/worker1
gosu circleci initdb -D citus/worker2
gosu circleci echo "shared_preload_libraries = 'citus'" >> citus/coordinator/postgresql.conf
gosu circleci echo "shared_preload_libraries = 'citus'" >> citus/worker1/postgresql.conf
gosu circleci echo "shared_preload_libraries = 'citus'" >> citus/worker2/postgresql.conf
gosu circleci pg_ctl -D citus/coordinator -o "-p 9700" -l citus/coordinator_logfile start
gosu circleci pg_ctl -D citus/worker1 -o "-p 9701" -l citus/worker1_logfile start
gosu circleci ls citus/worker1
gosu circleci pg_ctl -D citus/worker2 -o "-p 9702" -l citus/worker2_logfile start
gosu circleci psql -c "CREATE ROLE sqlancer SUPERUSER LOGIN CREATEDB PASSWORD 'sqlancer';" -p 9700 -d postgres
gosu circleci createdb test -p 9700
gosu circleci psql -c "CREATE ROLE sqlancer SUPERUSER LOGIN CREATEDB PASSWORD 'sqlancer';" -p 9701 -d postgres
gosu circleci createdb test -p 9701
gosu circleci psql -c "CREATE ROLE sqlancer SUPERUSER LOGIN CREATEDB PASSWORD 'sqlancer';" -p 9702 -d postgres
gosu circleci createdb test -p 9702
gosu circleci psql -c "CREATE EXTENSION citus;" -p 9700 -d test
gosu circleci psql -c "CREATE EXTENSION citus;" -p 9701 -d test
gosu circleci psql -c "CREATE EXTENSION citus;" -p 9702 -d test
gosu circleci psql -c "SELECT * from citus_add_node('localhost', 9701);" -p 9700 -d test
gosu circleci psql -c "SELECT * from citus_add_node('localhost', 9702);" -p 9700 -d test
- name: Run Tests
run: CITUS_AVAILABLE=true mvn -Dtest=TestCitus test
- name: Publish Logs
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: citus-logs
path: |
citus/*.{log,logfile}
logs
- name: Publish Summary
if: ${{ always() }}
run: |
grep -R "ERROR:.*" citus \
| awk -F: '{ errs[$4] = errs[$4] ? errs[$4] ", " $1 : $1 }
END { for (e in errs) {
print "### " e >> ENVIRON["GITHUB_STEP_SUMMARY"]
print "In: " errs[e] >> ENVIRON["GITHUB_STEP_SUMMARY"]
} }'
shell: bash