Skip to content

Commit 6380e8e

Browse files
committed
Merge remote-tracking branch 'origin/master' into qase-test-upload
2 parents e69e88f + 59d85e2 commit 6380e8e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+903
-382
lines changed

.DS_Store

-8 KB
Binary file not shown.

.github/workflows/e2e.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ jobs:
3636
strategy:
3737
fail-fast: false
3838
matrix:
39-
# TODO fix embeddedmirror and add it to the matrix
40-
etest: [startup, s3, btrfs, externalip, privateregistry, wasm]
39+
etest: [startup, s3, btrfs, externalip, privateregistry, embeddedmirror, wasm]
4140
max-parallel: 3
4241
steps:
4342
- name: "Checkout"
@@ -116,4 +115,4 @@ jobs:
116115
chmod +x ./dist/artifacts/k3s
117116
. ./tests/docker/test-helpers
118117
. ./tests/docker/test-run-${{ matrix.dtest }}
119-
echo "Did test-run-${{ matrix.dtest }} pass $?"
118+
echo "Did test-run-${{ matrix.dtest }} pass $?"
+178-101
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
name: Nightly Install
22
on:
3-
push: {}
4-
# schedule:
5-
# - cron: "0 0 * * 1-5"
6-
# workflow_dispatch: {}
3+
schedule:
4+
- cron: "0 0 * * 1-5"
5+
workflow_dispatch: {}
76

87
permissions:
98
contents: read
@@ -19,122 +18,200 @@ jobs:
1918
channel: [stable, latest]
2019
vm: [rocky-8, fedora, opensuse-leap, ubuntu-2204]
2120
max-parallel: 4
22-
# defaults:
23-
# run:
24-
# working-directory: tests/install/${{ matrix.vm }}
21+
defaults:
22+
run:
23+
working-directory: tests/install/${{ matrix.vm }}
2524
env:
2625
INSTALL_K3S_CHANNEL: ${{ matrix.channel }}
26+
LOG_FILE: /tmp/k3s-install-test-results.log
2727
steps:
2828
- name: "Checkout"
2929
uses: actions/checkout@v4
3030
with: {fetch-depth: 1}
31-
# - name: Set up vagrant and libvirt
32-
# uses: ./.github/actions/vagrant-setup
33-
# - name: "Vagrant Cache"
34-
# uses: actions/cache@v4
35-
# with:
36-
# path: |
37-
# ~/.vagrant.d/boxes
38-
# key: vagrant-box-${{ matrix.vm }}
39-
# id: vagrant-cache
40-
# - name: "Vagrant Plugin(s)"
41-
# run: vagrant plugin install vagrant-k3s vagrant-reload
42-
# - name: "Vagrant Up ⏩ Install K3s"
43-
# run: vagrant up
44-
# - name: "⏳ Node"
45-
# run: vagrant provision --provision-with=k3s-wait-for-node
46-
# - name: "⏳ CoreDNS"
47-
# run: vagrant provision --provision-with=k3s-wait-for-coredns
48-
# - name: "⏳ Local Storage"
49-
# run: vagrant provision --provision-with=k3s-wait-for-local-storage
50-
# continue-on-error: true
51-
# - name: "⏳ Metrics Server"
52-
# run: vagrant provision --provision-with=k3s-wait-for-metrics-server
53-
# continue-on-error: true
54-
# - name: "⏳ Traefik"
55-
# run: vagrant provision --provision-with=k3s-wait-for-traefik
56-
# continue-on-error: true
57-
# - name: "k3s-status"
58-
# run: vagrant provision --provision-with=k3s-status
59-
# - name: "k3s-procps"
60-
# run: vagrant provision --provision-with=k3s-procps
31+
- name: Set up vagrant and libvirt
32+
uses: ./.github/actions/vagrant-setup
33+
- name: "Vagrant Cache"
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.vagrant.d/boxes
38+
key: vagrant-box-${{ matrix.vm }}
39+
id: vagrant-cache
40+
- name: "Vagrant Plugin(s)"
41+
run: vagrant plugin install vagrant-k3s vagrant-reload
42+
- name: "Vagrant Up ⏩ Install K3s"
43+
run: |
44+
if vagrant up; then
45+
echo "Vagrant Up ⏩ Install K3s: success" | tee -a ${{ env.LOG_FILE }}
46+
else
47+
echo "Vagrant Up ⏩ Install K3s: failure" | tee -a ${{ env.LOG_FILE }}
48+
exit 1
49+
fi
50+
- name: "⏳ Node"
51+
run: |
52+
if vagrant provision --provision-with=k3s-wait-for-node; then
53+
echo "Node provision: success" | tee -a ${{ env.LOG_FILE }}
54+
else
55+
echo "Node provision: failure" | tee -a ${{ env.LOG_FILE }}
56+
exit 1
57+
fi
58+
- name: "⏳ CoreDNS"
59+
run: |
60+
if vagrant provision --provision-with=k3s-wait-for-coredns; then
61+
echo "CoreDNS provision: success" | tee -a ${{ env.LOG_FILE }}
62+
else
63+
echo "CoreDNS provision: failure" | tee -a ${{ env.LOG_FILE }}
64+
exit 1
65+
fi
66+
- name: "⏳ Local Storage"
67+
run: |
68+
vagrant provision --provision-with=k3s-wait-for-local-storage && \
69+
echo "Local Storage provision: success" | tee -a ${{ env.LOG_FILE }} || \
70+
echo "Local Storage provision: failure" | tee -a ${{ env.LOG_FILE }}
71+
continue-on-error: true
72+
- name: "⏳ Metrics Server"
73+
run: |
74+
vagrant provision --provision-with=k3s-wait-for-metrics-server && \
75+
echo "Metrics Server provision: success" | tee -a ${{ env.LOG_FILE }} || \
76+
echo "Metrics Server provision: failure" | tee -a ${{ env.LOG_FILE }}
77+
continue-on-error: true
78+
- name: "⏳ Traefik"
79+
run: |
80+
vagrant provision --provision-with=k3s-wait-for-traefik && \
81+
echo "Traefik provision: success" | tee -a ${{ env.LOG_FILE }} || \
82+
echo "Traefik provision: failure" | tee -a ${{ env.LOG_FILE }}
83+
continue-on-error: true
84+
- name: "k3s-status"
85+
run: |
86+
if vagrant provision --provision-with=k3s-status; then
87+
echo "k3s-status: success" | tee -a ${{ env.LOG_FILE }}
88+
else
89+
echo "k3s-status: failure" | tee -a ${{ env.LOG_FILE }}
90+
exit 1
91+
fi
92+
- name: "k3s-procps"
93+
run: |
94+
if vagrant provision --provision-with=k3s-procps; then
95+
echo "k3s-procps: success" | tee -a ${{ env.LOG_FILE }}
96+
else
97+
echo "k3s-procps: failure" | tee -a ${{ env.LOG_FILE }}
98+
exit 1
99+
fi
61100
62-
- name: Create Qase Run
63-
id: qase
101+
- name: "Qase Results environment setup"
102+
if: always()
64103
env:
104+
QASE_RUN_NAME: "K3s Nightly Install-${{ matrix.vm }}(${{ matrix.channel }})"
65105
QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}
106+
PROJECT_CODE: "K3SRKE2"
107+
CASE_ID_LIST: "108,109,110,111,112,113,114,115"
66108
run: |
67-
sudo apt-get install jq
68-
# create a QASE_RUN_NAME DINAMICALLY
69-
QASE_RUN_NAME="Install K3s on ${{ matrix.vm }}"
70-
71-
# create a run ID
72-
RESPONSE=$(curl --request POST \
73-
--url https://api.qase.io/v1/run/DEMO \
74-
--header 'Token: $QASE_API_TOKEN' \
75-
--header 'accept: application/json' \
76-
--header 'content-type: application/json' \
77-
--data '
78-
{
79-
"cases": [
80-
0,
81-
1
82-
],
83-
"is_autotest": true,
84-
"title": "'"$QASE_RUN_NAME"'",
85-
}'
86-
)
87-
88-
# set the run ID as an output variable
89-
RUN_ID=$(echo $RESPONSE | jq -r '.result.id')
90-
91-
# Print the RUN_ID to verify
92-
echo "The RUN_ID is: $RUN_ID"
93-
94-
# Set the run ID as an output variable using the environment file
95-
echo "QASE_RUN_ID=$RUN_ID" >> $GITHUB_ENV
109+
echo "QASE_RUN_NAME=${{ env.QASE_RUN_NAME }}" >> $GITHUB_ENV
110+
echo "PROJECT_CODE=${{ env.PROJECT_CODE }}" >> $GITHUB_ENV
111+
echo "CASE_ID_LIST=${{ env.CASE_ID_LIST }}" >> $GITHUB_ENV
112+
113+
- name: "Create Qase Run"
114+
if: always()
115+
id: create-qase-run
116+
env:
117+
QASE_RUN_NAME: ${{ env.QASE_RUN_NAME }}
118+
CASE_ID_LIST: ${{ env.CASE_ID_LIST }}
119+
QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}
120+
run: |
121+
# Create a run ID
122+
RUN_ID_RESPONSE=$(curl --request POST \
123+
--url "https://api.qase.io/v1/run/$PROJECT_CODE" \
124+
--header "Token: $QASE_API_TOKEN" \
125+
--header "accept: application/json" \
126+
--header "content-type: application/json" \
127+
--data '{
128+
"cases": ['"$CASE_ID_LIST"'],
129+
"title": "'"$QASE_RUN_NAME"'"
130+
}')
131+
echo "Run ID response: $RUN_ID_RESPONSE"
96132
97-
## step
133+
# set the run ID as an output variable
134+
RUN_ID=$(echo $RUN_ID_RESPONSE | jq -r '.result.id')
98135
136+
if [ -z "$RUN_ID" ] || [ "$RUN_ID" == "null" ]; then
137+
echo "Failed to create Qase run"
138+
fi
99139
100-
# complete the run
101-
COMPLETE_RUN=$(curl --request POST \
102-
--url https://api.qase.io/v1/run/K3SRKE2/$RUN_ID/complete \
103-
--header 'Token: $QASE_API_TOKEN' \
104-
--header 'accept: application/json'
105-
)
140+
# Set the run ID as an output variable using the environment file
141+
echo "QASE_RUN_ID=$RUN_ID" >> $GITHUB_ENV
142+
continue-on-error: true
143+
144+
- name: Process Test Results
145+
if: always()
146+
id: process-test-results
147+
env:
148+
CASE_ID_LIST: ${{ env.CASE_ID_LIST }}
149+
run: |
150+
GITHUB_RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
151+
COMMENT_LINK="In case of failure in GitHub Actions run. See details here: $GITHUB_RUN_URL"
152+
153+
IFS=',' read -r -a CASE_IDS <<< "$CASE_ID_LIST"
154+
COUNTER=0
155+
results='[]'
156+
157+
while IFS= read -r line; do
158+
TEST_NAME=$(echo "$line" | awk -F': ' '{print $1}')
159+
TEST_STATUS=$(echo "$line" | awk -F': ' '{print $2}')
160+
TEST_CASE_ID=${CASE_IDS[$COUNTER]}
161+
162+
COUNTER=$((COUNTER + 1))
163+
if [ $COUNTER -ge ${#CASE_IDS[@]} ]; then
164+
COUNTER=0
165+
fi
106166
107-
RUN_STATUS=$(echo $COMPLETE_RUN | jq -r '.status')
108-
if [[ $RUN_STATUS != true ]]; then
109-
echo "Failed to complete the run"
110-
fi
167+
if [ "$TEST_STATUS" == "success" ]; then
168+
STATUS="passed"
169+
else
170+
STATUS="failed"
171+
fi
111172
112-
# # make run public
113-
# PUBLISH_RUN=$(curl --request PATCH \
114-
# --url https://api.qase.io/v1/run/K3SRKE2/$RUN_ID/public \
115-
# --header 'Token: $QASE_API_TOKEN' \
116-
# --header 'accept: application/json' \
117-
# --header 'content-type: application/json' \
118-
# --data '{"status":true}'
119-
# )
120-
#
121-
# REPORT_URL=$(echo $PUBLISH_RUN | jq -r '.result.url')
122-
# if [[ -n "${REPORT_URL}" ]]; then
123-
# echo report url: ${REPORT_URL}
124-
# echo "## QASE Reporting" >> ${GITHUB_STEP_SUMMARY}
125-
# echo "Public Qase report: ${REPORT_URL}" >> ${GITHUB_STEP_SUMMARY}
126-
# fi
173+
results=$(echo "$results" | jq --arg case_id "$TEST_CASE_ID" --arg status "$STATUS" --arg comment "$COMMENT_LINK" \
174+
'. + [{ "case_id": ($case_id|tonumber), "status": $status, "comment": $comment }]')
175+
done < /tmp/k3s-install-test-results.log
127176
128-
- name: Run Tests and Upload Results to Qase
177+
echo "$results" > results.json
178+
continue-on-error: true
179+
180+
- name: Publish Test Results
181+
if: always()
129182
env:
183+
RUN_ID: ${{ env.QASE_RUN_ID }}
184+
PROJECT_CODE: ${{ env.PROJECT_CODE }}
130185
QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}
131-
QASE_RUN_ID: ${{ env.QASE_RUN_ID }}
132186
run: |
133-
echo "Run K3s Smoke Test"
134-
#Example: ./run-tests.sh and capture results in a file, e.g., test-results.json
135-
./run-tests.sh > test-results.json
187+
results=$(cat results.json)
188+
RESPONSE=$(curl --request POST \
189+
--url "https://api.qase.io/v1/result/${PROJECT_CODE}/${RUN_ID}/bulk" \
190+
--header "Token: $QASE_API_TOKEN" \
191+
--header 'accept: application/json' \
192+
--header "Content-Type: application/json" \
193+
--data "{\"results\": $results}")
136194
137-
195+
echo "Publish test results response: $RESPONSE"
196+
continue-on-error: true
197+
198+
- name: Complete Qase Run
199+
if: always()
200+
env:
201+
RUN_ID: ${{ env.QASE_RUN_ID }}
202+
PROJECT_CODE: ${{ env.PROJECT_CODE }}
203+
QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}
204+
run: |
205+
COMPLETE_RUN=$(curl --request POST \
206+
--url "https://api.qase.io/v1/run/${PROJECT_CODE}/${RUN_ID}/complete" \
207+
--header "Token: $QASE_API_TOKEN" \
208+
--header 'accept: application/json')
138209
139-
210+
RUN_STATUS=$(echo $COMPLETE_RUN | jq -r '.status')
211+
if [[ $RUN_STATUS != true ]]; then
212+
echo "Failed to complete the run"
213+
else
214+
echo "Run completed successfully"
215+
fi
216+
continue-on-error: true
140217

.golangci.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
]
1111
},
1212
"run": {
13-
"skip-dirs": [
13+
"deadline": "5m"
14+
},
15+
"issues": {
16+
"exclude-dirs": [
1417
"build",
1518
"contrib",
1619
"manifests",
1720
"package",
1821
"scripts",
1922
"vendor"
2023
],
21-
"skip-files": [
24+
"exclude-files": [
2225
"/zz_generated_"
2326
],
24-
"deadline": "5m"
25-
},
26-
"issues": {
2727
"exclude-rules": [
2828
{
2929
"linters": "typecheck",
@@ -43,4 +43,4 @@
4343
}
4444
]
4545
}
46-
}
46+
}

Dockerfile.dapper

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN apk -U --no-cache add \
2222
RUN python3 -m pip install awscli
2323

2424
# Install Trivy
25-
ENV TRIVY_VERSION="0.50.1"
25+
ENV TRIVY_VERSION="0.51.4"
2626
RUN case "$(go env GOARCH)" in \
2727
arm64) TRIVY_ARCH="ARM64" ;; \
2828
amd64) TRIVY_ARCH="64bit" ;; \

channel.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Example channels config
22
channels:
33
- name: stable
4-
latest: v1.29.4+k3s1
4+
latest: v1.29.5+k3s1
55
- name: latest
66
latestRegexp: .*
77
excludeRegexp: (^[^+]+-|v1\.25\.5\+k3s1|v1\.26\.0\+k3s1)

conformance/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.18
1+
FROM alpine:3.20
22
ENV SONOBUOY_VERSION 0.57.1
33
RUN apk add curl tar gzip
44
RUN curl -sfL https://github.com/vmware-tanzu/sonobuoy/releases/download/v${SONOBUOY_VERSION}/sonobuoy_${SONOBUOY_VERSION}_linux_amd64.tar.gz | tar xvzf - -C /usr/bin

0 commit comments

Comments
 (0)