forked from sqlancer/sqlancer
-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (95 loc) · 4.24 KB
/
Copy pathmain.yml
File metadata and controls
99 lines (95 loc) · 4.24 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
name: ci
on:
push:
branches:
- main
paths:
- 'src/**'
- 'test/**'
- '.github/workflows/*.yml'
- 'pom.xml'
pull_request:
branches:
- main
paths:
- 'src/**'
- 'test/**'
- '.github/workflows/*.yml'
- 'pom.xml'
jobs:
misc:
name: General tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '25'
cache: 'maven'
- name: Verify
run: mvn -B verify -DskipTests=true
- name: Misc Tests
run: mvn -Djacoco.skip=true -B '-Dtest=!sqlancer.dbms.**,!sqlancer.qpg.**' test
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Naming Convention Tests
run: python src/check_names.py
clickhouse:
name: DBMS Tests (ClickHouse)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '25'
cache: 'maven'
- name: Build SQLancer
run: mvn -B package -DskipTests=true
- name: Set up ClickHouse
run: |
docker pull clickhouse/clickhouse-server:head
# The :head image's entrypoint disables network access for the `default` user when
# neither CLICKHOUSE_USER nor CLICKHOUSE_PASSWORD is set (tightened sometime between
# 2026-05-16 and 2026-05-18; previously the default-user-no-password path was open).
# Surface symptom: every test fails with "Code: 194 REQUIRED_PASSWORD". Setting
# CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 + CLICKHOUSE_SKIP_USER_SETUP=1 keeps the
# default-user-passwordless path open without baking a credential into the workflow.
# Use the same server overrides as the ClickHouse nightly job (`.claude/clickhouse-config/`).
# Without `mutations_sync = 2` an `ALTER ... DELETE` can finish between the two reads of one
# oracle check, which then reports a mismatch that is only a race (e.g. 132 rows vs 0 rows
# after `ALTER TABLE t0 DELETE WHERE <true constant>`). The files with `<profiles>` go to
# `users.d`, the rest to `config.d`. Each file is mounted separately, so the directories that
# the entrypoint writes to stay writable.
CONFIG_DIR="$PWD/.claude/clickhouse-config"
MOUNTS=()
for f in "$CONFIG_DIR"/*.xml; do
if grep -q '<profiles>' "$f"; then
MOUNTS+=(-v "$f:/etc/clickhouse-server/users.d/$(basename "$f"):ro")
else
MOUNTS+=(-v "$f:/etc/clickhouse-server/config.d/$(basename "$f"):ro")
fi
done
docker run --ulimit nofile=262144:262144 --name clickhouse-server -p8123:8123 -d \
-e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 -e CLICKHOUSE_SKIP_USER_SETUP=1 \
"${MOUNTS[@]}" \
clickhouse/clickhouse-server:head
until curl -sf http://127.0.0.1:8123/ping 2>/dev/null; do sleep 1; done
# Fail here rather than in a flaky oracle if the overrides did not take effect.
SETTINGS=$(curl -sf http://127.0.0.1:8123/ --data-binary \
"SELECT getSetting('mutations_sync'), getSetting('alter_sync'), getSetting('async_insert') FORMAT TSV")
echo "mutations_sync, alter_sync, async_insert: $SETTINGS"
test "$SETTINGS" = "$(printf '2\t2\tfalse')"
- name: Run Tests
run: CLICKHOUSE_AVAILABLE=true mvn -Djacoco.skip=true -Dtest=ClickHouseBinaryComparisonOperationTest,TestClickHouse,ClickHouseOperatorsVisitorTest,ClickHouseToStringVisitorTest,ClickHouseTypeTest,ClickHouseTypeParserTest,ClickHouseTypeGenerationTest,ClickHouseCastExtensionTest,ClickHouseCODDTestFilterTest,ClickHouseCERTGeneratorTest,ClickHouseTableGeneratorTest test
- name: Show fatal errors
run: docker exec clickhouse-server grep Fatal /var/log/clickhouse-server/clickhouse-server.log || echo No Fatal Errors found
- name: Teardown ClickHouse server
run: |
docker stop clickhouse-server
docker rm clickhouse-server