plans: add gating tests
This tmt[0] test runs the playwright tests as gating tests. Having the gating tests upstream avoids duplication across fedora and centos dist-git repositories, and running them upstream should keep them in working order. Only add x86_64 for now, the aarch runners seem to be a bit too slow. [0]: https://tmt.readthedocs.io/en/stable/index.html
This commit is contained in:
parent
e0dd33fdc9
commit
0e7f5d9e7b
5 changed files with 51 additions and 17 deletions
1
.fmf/version
Normal file
1
.fmf/version
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
1
|
||||||
10
packit.yaml
10
packit.yaml
|
|
@ -16,6 +16,15 @@ srpm_build_deps:
|
||||||
- npm
|
- npm
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
- job: tests
|
||||||
|
identifier: self
|
||||||
|
trigger: pull_request
|
||||||
|
tmt_plan: /plans/all/main
|
||||||
|
targets:
|
||||||
|
- centos-stream-10
|
||||||
|
- fedora-41
|
||||||
|
- fedora-42
|
||||||
|
|
||||||
- job: copr_build
|
- job: copr_build
|
||||||
trigger: pull_request
|
trigger: pull_request
|
||||||
targets: &build_targets
|
targets: &build_targets
|
||||||
|
|
@ -24,7 +33,6 @@ jobs:
|
||||||
- centos-stream-10
|
- centos-stream-10
|
||||||
- centos-stream-10-aarch64
|
- centos-stream-10-aarch64
|
||||||
- fedora-all
|
- fedora-all
|
||||||
- fedora-all-aarch64
|
|
||||||
|
|
||||||
- job: copr_build
|
- job: copr_build
|
||||||
trigger: commit
|
trigger: commit
|
||||||
|
|
|
||||||
14
plans/all.fmf
Normal file
14
plans/all.fmf
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
summary: cockpit-image-builder playwright tests
|
||||||
|
prepare:
|
||||||
|
how: install
|
||||||
|
package:
|
||||||
|
- cockpit-image-builder
|
||||||
|
discover:
|
||||||
|
how: fmf
|
||||||
|
execute:
|
||||||
|
how: tmt
|
||||||
|
|
||||||
|
/main:
|
||||||
|
summary: playwright tests
|
||||||
|
discover+:
|
||||||
|
test: /schutzbot/playwright
|
||||||
8
schutzbot/playwright.fmf
Normal file
8
schutzbot/playwright.fmf
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
summary: run playwright tests
|
||||||
|
test: ./playwright_tests.sh
|
||||||
|
require:
|
||||||
|
- cockpit-image-builder
|
||||||
|
- podman
|
||||||
|
- nodejs
|
||||||
|
- nodejs-npm
|
||||||
|
duration: 30m
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# As playwright isn't supported on fedora/el, install dependencies
|
TMT_SOURCE_DIR=${TMT_SOURCE_DIR:-}
|
||||||
# beforehand.
|
if [ -n "$TMT_SOURCE_DIR" ]; then
|
||||||
sudo dnf install -y \
|
# Move to the directory with sources
|
||||||
alsa-lib \
|
cd "${TMT_SOURCE_DIR}/cockpit-image-builder"
|
||||||
libXrandr-devel \
|
npm ci
|
||||||
libXdamage-devel \
|
elif [ "${CI:-}" != "true" ]; then
|
||||||
libXcomposite-devel \
|
# packit drops us into the schutzbot directory
|
||||||
at-spi2-atk-devel \
|
cd ../
|
||||||
cups \
|
npm ci
|
||||||
atk
|
fi
|
||||||
|
|
||||||
sudo systemctl enable --now cockpit.socket
|
sudo systemctl enable --now cockpit.socket
|
||||||
|
|
||||||
|
|
@ -19,10 +19,13 @@ sudo usermod -aG wheel admin
|
||||||
echo "admin ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee "/etc/sudoers.d/admin-nopasswd"
|
echo "admin ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee "/etc/sudoers.d/admin-nopasswd"
|
||||||
|
|
||||||
function upload_artifacts {
|
function upload_artifacts {
|
||||||
mkdir -p /tmp/artifacts/extra-screenshots
|
if [ -n "${TMT_TEST_DATA:-}" ]; then
|
||||||
|
mv playwright-report "$TMT_TEST_DATA"/playwright-report
|
||||||
|
else
|
||||||
USER="$(whoami)"
|
USER="$(whoami)"
|
||||||
sudo chown -R "$USER:$USER" playwright-report
|
sudo chown -R "$USER:$USER" playwright-report
|
||||||
mv playwright-report /tmp/artifacts/
|
mv playwright-report /tmp/artifacts/
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
trap upload_artifacts EXIT
|
trap upload_artifacts EXIT
|
||||||
|
|
||||||
|
|
@ -73,8 +76,8 @@ sudo podman run \
|
||||||
-e "CI=true" \
|
-e "CI=true" \
|
||||||
-e "PLAYWRIGHT_USER=admin" \
|
-e "PLAYWRIGHT_USER=admin" \
|
||||||
-e "PLAYWRIGHT_PASSWORD=foobar" \
|
-e "PLAYWRIGHT_PASSWORD=foobar" \
|
||||||
-e "CURRENTS_PROJECT_ID=$CURRENTS_PROJECT_ID" \
|
-e "CURRENTS_PROJECT_ID=${CURRENTS_PROJECT_ID:-}" \
|
||||||
-e "CURRENTS_RECORD_KEY=$CURRENTS_RECORD_KEY" \
|
-e "CURRENTS_RECORD_KEY=${CURRENTS_RECORD_KEY:-}" \
|
||||||
--net=host \
|
--net=host \
|
||||||
-v "$PWD:/tests" \
|
-v "$PWD:/tests" \
|
||||||
-v '/etc:/etc' \
|
-v '/etc:/etc' \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue