-
Notifications
You must be signed in to change notification settings - Fork 36
224 lines (202 loc) · 8.54 KB
/
scenarios-permian.yml
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# Run all kickstart tests for all active branches in Permian
name: Daily run in Permian
on:
schedule:
# run after daily-boot-iso.yml
- cron: 0 23 * * *
workflow_dispatch:
permissions:
contents: read
jobs:
scenario:
name: Scenario in Permian
runs-on: [self-hosted, kstest]
strategy:
matrix:
scenario: [daily-iso, rhel8, rhel9]
fail-fast: false
# these settings depend on the infrastructure; on upshift ocp-master-xxl they take about 4 hours
timeout-minutes: 560
env:
TEST_JOBS: 16
GITHUB_TOKEN: /home/github/github-token
# The timeout should be ~20 minutes less then the job's timeout-minutes
# so that we get partial results and logs in case of the timeout.
LAUNCHER_TIMEOUT_MINUTES: 540
steps:
# self-hosted runners don't do this automatically; also useful to keep stuff around for debugging
# need to run sudo as the launch script and the container create root/other user owned files
- name: Clean up previous run
run: |
sudo podman ps -q --all --filter='ancestor=kstest-runner' | xargs -tr sudo podman rm -f
sudo podman volume rm --all || true
sudo rm -rf *
- name: Clone repository
uses: actions/[email protected]
with:
path: kickstart-tests
- name: Generate test cases
working-directory: ./kickstart-tests
run: scripts/generate-testcases.py -t ./testlib/test_cases/kstest-template.tc.yaml.j2 . -o ./testlib/test_cases
- name: Generate test plan for the scenario
working-directory: ./kickstart-tests
run: |
set -eux
TESTPLAN="./testlib/test_plans/daily-${{ matrix.scenario }}.plan.yaml"
TEMPLATE="${TESTPLAN}.j2"
if [ "${{ matrix.scenario }}" == "daily-iso" ]; then
VARIABLE="SKIP_TESTTYPES_DAILY_ISO"
elif [ "${{ matrix.scenario }}" == "rhel8" ]; then
VARIABLE="SKIP_TESTTYPES_RHEL8"
elif [ "${{ matrix.scenario }}" == "rhel9" ]; then
VARIABLE="SKIP_TESTTYPES_RHEL9"
fi
if [ -e ${TEMPLATE} ] && [ -n ${VARIABLE} ]; then
scripts/generate-testplan.py \
-t ${TEMPLATE} \
-f ./containers/runner/skip-testtypes \
-s ${VARIABLE} \
-o ${TESTPLAN} \
--verbose
fi
- name: Clone Permian repository
uses: actions/[email protected]
with:
repository: rhinstaller/permian
path: permian
ref: main
- name: Clone tplib repository
uses: actions/[email protected]
with:
repository: rhinstaller/tplib
path: tplib
# use the latest official packages for the nightly runs
- name: Clean up squid cache
run: sudo containers/squid.sh clean
working-directory: ./kickstart-tests
- name: Ensure http proxy is running
run: sudo containers/squid.sh start
working-directory: ./kickstart-tests
- name: Set platform from scenario
id: platform_from_scenario
run: |
set -eux
if [ "${{ matrix.scenario }}" == "daily-iso" ] || [ "${{ matrix.scenario }}" == "minimal" ]; then
echo "platform=fedora_rawhide" >> $GITHUB_OUTPUT
elif [ "${{ matrix.scenario }}" == "rhel8" ]; then
echo "platform=rhel8" >> $GITHUB_OUTPUT
elif [ "${{ matrix.scenario }}" == "rhel9" ]; then
echo "platform=rhel9" >> $GITHUB_OUTPUT
else
echo "Scenario ${{ matrix.scenario }} can't be mapped to platform"
exit 1
fi
# Fetch boot.iso and configiure its local location
- name: Set boot.iso from scenario
id: boot_iso_from_scenario
run: |
set -eux
BOOT_ISO_PATH="${{ github.workspace }}/${{ matrix.scenario }}.boot.iso"
BOOT_ISO_URL="file://$BOOT_ISO_PATH"
if [ "${{ matrix.scenario }}" == "daily-iso" ] || [ "${{ matrix.scenario }}" == "minimal" ]; then
${{ github.workspace }}/kickstart-tests/containers/runner/fetch_daily_iso.sh $GITHUB_TOKEN $BOOT_ISO_PATH
echo "boot_iso=\"bootIso\":{\"x86_64\":\"${BOOT_ISO_URL}\"}," >> $GITHUB_OUTPUT
else
echo "Boot.iso URL for ${{ matrix.scenario }} not configured"
echo "boot_iso=" >> $GITHUB_OUTPUT
fi
# Configure location of installation repositories for the scenario
# Also default boot.iso is defined by the value of urls.installation_tree
# of kstestParams event structure.
- name: Set installation_tree for the scenario
id: set_installation_urls
run: |
set -eux
if [ "${{ matrix.scenario }}" == "rhel8" ]; then
echo "installation_tree=http://download.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/BaseOS/x86_64/os" >> $GITHUB_OUTPUT
echo "modular_url=http://download.eng.bos.redhat.com/rhel-8/nightly/RHEL-8/latest-RHEL-8.10.0/compose/AppStream/x86_64/os" >> $GITHUB_OUTPUT
elif [ "${{ matrix.scenario }}" == "rhel9" ]; then
echo "installation_tree=http://download.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/BaseOS/x86_64/os" >> $GITHUB_OUTPUT
echo "modular_url=http://download.eng.bos.redhat.com/rhel-9/nightly/RHEL-9/latest-RHEL-9.4.0/compose/AppStream/x86_64/os" >> $GITHUB_OUTPUT
else
echo "Installation tree location for ${{ matrix.scenario }} not configured"
if [ -z "${{ steps.boot_iso_from_scenario.outputs.boot_iso }}" ]; then
echo "No boot.iso source is defined"
exit 2
fi
echo "installation_tree=" >> $GITHUB_OUTPUT
echo "modular_url=" >> $GITHUB_OUTPUT
fi
- name: Create Permian settings file
working-directory: ./permian
run: |
cat <<EOF > settings.ini
[kickstart_test]
timeout=${LAUNCHER_TIMEOUT_MINUTES}m
retry_on_failure=True
kstest_local_repo=${{ github.workspace }}/kickstart-tests
# gh#795
added_boot_options=inst.xtimeout=100
[library]
directPath=${{ github.workspace }}/kickstart-tests/testlib
EOF
- name: Run scenario ${{ matrix.scenario }} in container
working-directory: ./permian
run: |
sudo --preserve-env=TEST_JOBS \
PYTHONPATH=${PYTHONPATH:-}:${{ github.workspace }}/tplib \
./pipeline --debug-log permian.log \
--settings settings.ini \
--override workflows.dry_run=False \
run_event '{
"type":"github.scheduled.daily.kstest.${{ matrix.scenario }}",
${{ steps.boot_iso_from_scenario.outputs.boot_iso }}
"kstestParams":{
"platform":"${{ steps.platform_from_scenario.outputs.platform }}",
"urls":{
"x86_64":{
"installation_tree":"${{ steps.set_installation_urls.outputs.installation_tree }}",
"modular_url":"${{ steps.set_installation_urls.outputs.modular_url }}"
}
}
}
}'
# Permian hides the exit code of launcher, so error out this step manually based on logs
rc=$( awk '/Runner return code: /{ print $4 }' permian.log)
if [ -n "$rc" ]; then
exit $rc
else
exit 111
fi
- name: Collect anaconda logs
if: always()
uses: actions/upload-artifact@v3
with:
name: 'logs-${{ matrix.scenario }}'
# skip the /anaconda subdirectories, too large
path: |
kickstart-tests/data/logs/kstest*.log
kickstart-tests/data/logs/kstest.log.json
kickstart-tests/data/logs/kstest-*/*.log
kickstart-tests/data/logs/kstest-*/anaconda/lorax-packages.log
- name: Collect json summary
if: always()
uses: actions/upload-artifact@v3
with:
name: 'summary-${{ matrix.scenario }}'
path: |
kickstart-tests/data/logs/kstest.log.json
- name: Collect Permian logs
if: always()
uses: actions/upload-artifact@v3
with:
name: 'logs-permian-${{ matrix.scenario }}'
path: |
permian/permian.log
- name: Collect Permian xunit reporter results
if: always()
uses: actions/upload-artifact@v3
with:
name: 'results-xunit-${{ matrix.scenario }}'
path: |
permian/xunit-*.xml