Skip to content

Commit 4eaec8d

Browse files
authored
Merge pull request #1545 from saschagrunert/cri-o-matrix
Add more CRI-O matrix tests
2 parents 600d7b1 + c11f0db commit 4eaec8d

File tree

2 files changed

+52
-33
lines changed

2 files changed

+52
-33
lines changed

.github/workflows/crio.yml

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,27 @@ on:
99
jobs:
1010
test:
1111
strategy:
12+
fail-fast: false
1213
matrix:
1314
suite:
1415
- e2e
1516
- critest
16-
name: ${{matrix.suite}}
17+
oci-runtime:
18+
- crun
19+
- runc
20+
monitor:
21+
- conmon
22+
- conmon-rs
23+
name: ${{matrix.suite}} / ${{matrix.oci-runtime}} / ${{matrix.monitor}}
1724
runs-on: ubuntu-22.04
1825
steps:
26+
- name: Checkout cri-tools
27+
uses: actions/checkout@v4
28+
1929
- name: Install go
2030
uses: actions/setup-go@v5
2131
with:
2232
go-version: '1.22'
23-
cache: false
24-
25-
- name: Setup environment
26-
shell: bash
27-
run: |
28-
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
29-
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
30-
31-
- name: Cache go modules and build cache
32-
uses: actions/cache@v4
33-
with:
34-
path: |
35-
~/go/pkg/mod
36-
~/.cache/go-build
37-
'%LocalAppData%\go-build' # Windows
38-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
39-
restore-keys: ${{ runner.os }}-go-
4033

4134
- name: Setup system
4235
run: |
@@ -55,47 +48,72 @@ jobs:
5548
ginkgo version
5649
sudo cp $(command -v ginkgo) /usr/local/bin
5750
58-
- name: Install CRI-O latest main
51+
- name: Install CRI-O
5952
run: |
6053
curl https://raw.githubusercontent.com/cri-o/packaging/main/get | sudo bash
6154
62-
- name: Configure and start CRI-O
55+
- name: Configure CRI-O
6356
run: |
6457
sudo mkdir -p /etc/crio/crio.conf.d
6558
printf '[crio.runtime]\nlog_level = "debug"\n' | sudo tee /etc/crio/crio.conf.d/01-log-level.conf
66-
printf '[crio.runtime]\nseccomp_use_default_when_empty = false\n' | sudo tee /etc/crio/crio.conf.d/02-seccomp.conf
59+
60+
- name: Configure CRI-O to use conmon-rs intead of the default conmon
61+
if: ${{matrix.monitor == 'conmon-rs'}}
62+
run: |
63+
sudo sed -i -E 's;(monitor_path = ).*;\1"/usr/libexec/crio/conmonrs"\nruntime_type = "pod";g' /etc/crio/crio.conf.d/10-crio.conf
64+
65+
- name: Configure CRI-O to use runc instead of the default crun
66+
if: ${{matrix.oci-runtime == 'runc'}}
67+
run: |
68+
sudo sed -i -E 's;(default_runtime = ).*;\1"runc";g' /etc/crio/crio.conf.d/10-crio.conf
69+
70+
- name: Show the CRI-O config drop-in
71+
run: cat /etc/crio/crio.conf.d/10-crio.conf
72+
73+
- name: Start CRI-O
74+
run: |
6775
sudo systemctl daemon-reload
6876
sudo systemctl start crio
69-
70-
- name: Checkout cri-tools for this commit
71-
uses: actions/checkout@v4
72-
with:
73-
path: ${{github.workspace}}/src/github.com/kubernetes-sigs/cri-tools
77+
sudo crio status config
7478
7579
- name: Build cri-tools
7680
run: |
7781
make
7882
sudo -E PATH=$PATH make install
79-
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools
8083
8184
- name: Run critest
8285
if: ${{matrix.suite == 'critest'}}
86+
shell: bash
8387
run: |
88+
set -euox pipefail
89+
90+
ARGS=()
91+
if [[ "${{matrix.oci-runtime}}" == "crun" && "${{matrix.monitor}}" == "conmon-rs" ]]; then
92+
# TODO: check why these tests fail on that combination
93+
ARGS=(--ginkgo.skip 'SupplementalGroups|AppArmor|RunAsUser')
94+
fi
95+
8496
sudo -E PATH=$PATH critest \
8597
--runtime-endpoint=unix:///var/run/crio/crio.sock \
86-
--ginkgo.flakeAttempts=3 \
87-
--parallel=$(nproc)
88-
sudo journalctl -u crio > cri-o.log
98+
--parallel=$(nproc) \
99+
--ginkgo.flake-attempts=3 \
100+
--ginkgo.randomize-all \
101+
--ginkgo.timeout=2m \
102+
--ginkgo.trace \
103+
--ginkgo.vv \
104+
"${ARGS[@]}"
89105
90106
- name: Run crictl e2e tests
91107
if: ${{matrix.suite == 'e2e'}}
92108
run: |
93109
sudo -E PATH=$PATH make test-e2e \
94110
TESTFLAGS="-crictl-runtime-endpoint=unix://var/run/crio/crio.sock"
95-
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools
111+
112+
- name: Collect CRI-O logs
113+
run: sudo journalctl -u crio > cri-o.log
96114

97115
- name: Upload CRI-O logs
98116
uses: actions/upload-artifact@v4
99117
with:
100-
name: cri-o-${{matrix.version}}-${{github.sha}}.log
118+
name: cri-o-${{matrix.suite}}-${{matrix.oci-runtime}}-${{matrix.monitor}}-${{github.sha}}.log
101119
path: cri-o.log

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ test-e2e: $(GINKGO)
134134
-r \
135135
--randomize-all \
136136
--randomize-suites \
137-
--slow-spec-threshold 60s \
137+
--race \
138+
--vv \
138139
test \
139140
-- \
140141
$(TESTFLAGS)

0 commit comments

Comments
 (0)