-
Notifications
You must be signed in to change notification settings - Fork 359
170 lines (152 loc) · 5.7 KB
/
webui-periodic.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
# ======================================
# WARNING!
# THIS FILE IS GENERATED FROM A TEMPLATE
# DO NOT EDIT THIS FILE MANUALLY!
# ======================================
# The template is located in: webui-periodic.yml.j2
# Run webui e2e tests periodically in Permian
name: Periodic webui e2e tests
on:
schedule:
- cron: 0 23 * * *
workflow_dispatch:
permissions:
contents: read
jobs:
scenario:
name: Webui periodic
runs-on: [self-hosted, kstest]
# Don't run scheduled workflows on forks.
if: github.event_name != 'schedule' || github.repository == 'rhinstaller/anaconda'
timeout-minutes: 65
env:
# ocp-master-xxl: 32GB RAM / 4GB RAM per VM
TEST_JOBS: 8
# The timeout should be a few minutes less then the job's timeout-minutes
# so that we get partial results and logs in case of the timeout.
LAUNCHER_TIMEOUT_MINUTES: 60
# URL to the unpacked installation image
CONTAINER_TAG: master
ISO_BUILD_CONTAINER_NAME: 'quay.io/rhinstaller/anaconda-iso-creator'
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 *
# The test library is in anaconda repository
- name: Clone anaconda repository
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0
path: anaconda
# TODO: use main branch when the webui workflow is merged there
- name: Clone Permian repository
uses: actions/checkout@v4
with:
repository: rhinstaller/permian
path: permian
ref: devel
- name: Clone tplib repository
uses: actions/checkout@v4
with:
repository: rhinstaller/tplib
path: tplib
- name: Build anaconda-rpm container (for RPM build)
working-directory: ./anaconda
run: |
# set static tag to avoid complications when looking what tag is used
make -f Makefile.am anaconda-rpm-build CI_TAG=$CONTAINER_TAG
- name: Build Anaconda RPM files
working-directory: ./anaconda
run: |
# output of the build will be stored in ./result/build/01-rpm-build/*.rpm
make -f Makefile.am container-rpms-scratch CI_TAG=$CONTAINER_TAG
mkdir -p ./anaconda_rpms/
cp -av ./result/build/01-rpm-build/*.rpm ./anaconda_rpms/
- name: Build anaconda-iso-creator container image
working-directory: ./anaconda
run: |
# set static tag to avoid complications when looking what tag is used
sudo make -f Makefile.am anaconda-iso-creator-build CI_TAG=$CONTAINER_TAG
- name: Build the boot.iso
working-directory: ./anaconda
run: |
mkdir -p images
# /var/tmp tmpfs speeds up lorax and avoids https://bugzilla.redhat.com/show_bug.cgi?id=1906364
sudo podman run -i --rm --privileged \
--tmpfs /var/tmp:rw,mode=1777 \
-v `pwd`/anaconda_rpms:/anaconda-rpms:ro \
-v `pwd`/images:/images:z \
--entrypoint /lorax-build-webui \
$ISO_BUILD_CONTAINER_NAME:$CONTAINER_TAG
- name: Clean up after lorax
if: always()
run: |
# remove container images together with the container
sudo podman rmi -f $ISO_BUILD_CONTAINER_NAME:$CONTAINER_TAG || true
sudo podman rmi -f $RPM_BUILD_CONTAINER_NAME:$CONTAINER_TAG || true
- name: Create Permian settings file
working-directory: ./permian
run: |
cat <<EOF > settings.ini
[AnacondaWebUI]
anaconda_repo=file://${{ github.workspace }}/anaconda
hypervisor_vm_limit=${{ env.TEST_JOBS }}
test_timeout=${{ env.LAUNCHER_TIMEOUT_MINUTES }}
[library]
directPath=${{ github.workspace }}/anaconda/ui/webui/test/end2end
EOF
- name: Run webui end2end tests
working-directory: ./permian
run: |
PYTHONPATH=${PYTHONPATH:-}:${{ github.workspace }}/tplib \
./pipeline --debug-log permian.log \
--settings settings.ini \
-o github.repository=${{ github.repository }} \
-o github.token=${{ secrets.GITHUB_TOKEN }} \
run_event '{
"type":"github.webui.e2e.scheduled",
"bootIso": {
"x86_64": "file://${{ github.workspace }}/anaconda/images/boot.iso"
}
}'
- name: Collect logs
if: always()
uses: actions/upload-artifact@v3
with:
name: 'logs'
path: |
permian/permian.log
permian/local_logs/
permian/pipeline_data
permian/static/
permian/index.html
permian/xunit*.xml
permian/*.dump
# Permian exit code doesn't reflect the test results
- name: Check tests results
if: always()
working-directory: ./permian
shell: bash {0}
run: |
ls xunit*.xml > /dev/null
if [ $? -ne 0 ]; then
exit 112
fi
fails=$( grep -E '<failure .* type="failure"/>|<error .* type="error"/>' xunit*.xml )
if [ -n "$fails" ]; then
exit 111
else
exit 0
fi
- name: Upload image artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: images
path: |
anaconda/images/boot.iso