-
Notifications
You must be signed in to change notification settings - Fork 6
143 lines (136 loc) · 5.2 KB
/
Copy pathtests.yml
File metadata and controls
143 lines (136 loc) · 5.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
name: tests
on:
push:
branches:
- '**'
pull_request:
permissions:
contents: read
jobs:
python:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- run: python -m pip install -e '.[dev]'
- run: python -m compileall -q ch_diag tools tests
- run: ruff check ch_diag tests tools
- run: python tools/normalize_sql_outputs.py --check
- run: ch-diag validate
- run: pytest -q -m 'not browser'
- run: python -m build
clean-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python -m pip install build
- run: python -m build
- name: Install only the wheel in a clean Python 3.10 container
run: >-
docker run --rm
--volume "${PWD}:/src:ro"
--workdir /tmp
python:3.10-slim
sh -ec 'python -m pip install /src/dist/ch_diag-*.whl;
ch-diag validate;
ch-diag item-id-list >/tmp/items.tsv;
test -s /tmp/items.tsv;
python -c "import ch_diag; print(ch_diag.__version__)"'
clickhouse-25-8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python -m pip install -e '.[dev]'
- run: mkdir -p tests/integration/docker/state
- run: ssh-keygen -q -t ed25519 -N '' -f tests/integration/docker/state/id_ed25519
- run: cp tests/integration/docker/state/id_ed25519.pub tests/integration/docker/state/authorized_keys
- run: docker compose -f tests/integration/docker/compose.yaml up -d --build
- name: Wait for ClickHouse
run: |
for attempt in $(seq 1 60); do
if docker exec chdiag-test-25-8 clickhouse-client --query 'SELECT 1'; then
exit 0
fi
sleep 2
done
docker logs chdiag-test-25-8
exit 1
- name: Export test TLS trust anchor
run: docker cp chdiag-test-25-8:/etc/clickhouse-server/tls/server.crt tests/integration/docker/state/server.crt
- run: ssh-keyscan -p 12222 127.0.0.1 > tests/integration/docker/state/known_hosts
- run: >-
CH_DIAG_TEST_HOST=127.0.0.1
CH_DIAG_TEST_PORT=19001
CH_DIAG_TEST_CLUSTER=chdiag_test
CH_DIAG_TEST_TLS_PORT=19440
CH_DIAG_TEST_TLS_CA=tests/integration/docker/state/server.crt
CH_DIAG_TEST_SSH_KEY=tests/integration/docker/state/id_ed25519
CH_DIAG_TEST_SSH_KNOWN_HOSTS=tests/integration/docker/state/known_hosts
pytest -q -m integration tests/integration/test_live_clickhouse.py
- name: SSH one-shot smoke
run: |
ch-diag one-shot \
--host 127.0.0.1 --port 9000 \
--collection-mode remote --target-scope node \
--ssh-host 127.0.0.1 --ssh-port 12222 --ssh-user chdiag \
--ssh-key tests/integration/docker/state/id_ed25519 \
--ssh-known-hosts tests/integration/docker/state/known_hosts \
--item-id overview.server,operating_system.os_release \
--output-format json --out-dir reports/ssh
- name: SSH snapshots smoke
run: |
ch-diag snapshots \
--host 127.0.0.1 --port 9000 \
--collection-mode remote --target-scope node \
--ssh-host 127.0.0.1 --ssh-port 12222 --ssh-user chdiag \
--ssh-key tests/integration/docker/state/id_ed25519 \
--ssh-known-hosts tests/integration/docker/state/known_hosts \
--item-id snapshot_charts_os.os_cpu_utilization,snapshot_charts_clickhouse.query_rate \
--duration 0.4 --interval 0.2 \
--output-format json --out-dir reports/ssh-snapshots
clickhouse-lts:
name: ClickHouse LTS ${{ matrix.branch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch: ['20.3', '20.8', '21.3', '21.8', '22.3', '22.8', '23.3', '23.8', '24.3', '24.8', '25.3', '25.8', '26.3']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- if: runner.arch == 'X64'
run: python -m pip install -e '.[test]'
- name: Run pinned LTS branch
if: runner.arch == 'X64'
run: >-
python tools/run_lts_clickhouse_matrix.py
--branch '${{ matrix.branch }}'
--remove
- name: Explain architecture skip
if: runner.arch != 'X64'
run: echo "The oldest ClickHouse LTS images are linux/amd64 only; runner is ${{ runner.arch }}"
clickhouse-multinode-25-8:
name: ClickHouse 25.8 two replicas + Keeper
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python -m pip install -e '.[test]'
- name: Build, seed and test the real cluster
run: python tools/run_multinode_clickhouse.py --remove