Skip to content

Periodic webui e2e tests #241

Periodic webui e2e tests

Periodic webui e2e tests #241

# ======================================
# 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