-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5611 from os-autoinst/openqa-in-5-minutes
Add recording how to run openQA test in 5 minutes
- Loading branch information
Showing
6 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
openqa-in-5-minutes.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# syntax=docker/dockerfile:1.3 | ||
FROM opensuse/tumbleweed:latest | ||
|
||
# Install recording prerequisites | ||
RUN zypper in -y asciinema cargo gcc make fira-code-fonts | ||
RUN cargo install autocast && \ | ||
ln -s /root/.cargo/bin/autocast /usr/local/bin/ | ||
RUN cargo install --git https://github.com/asciinema/agg && \ | ||
ln -s /root/.cargo/bin/agg /usr/local/bin/ | ||
|
||
# Install utilities used in the recording | ||
RUN zypper in -y bat jq retry wget | ||
|
||
# Use http://www.brow.sh to show the web in terminal | ||
RUN zypper in -y firefox | ||
RUN wget -O /usr/local/bin/browsh https://github.com/browsh-org/browsh/releases/download/v1.8.2/browsh_1.8.2_linux_amd64 && \ | ||
chmod +x /usr/local/bin/browsh | ||
RUN mkdir -p /root/.config/browsh | ||
COPY <<EOF /root/.config/browsh/config.toml | ||
browsh_supporter = "I have shown my support for Browsh" | ||
[firefox] | ||
path = "/usr/bin/firefox" | ||
EOF | ||
|
||
RUN mkdir -p /work | ||
VOLUME /work | ||
WORKDIR /work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
YAML_FILES=$(wildcard *.yaml) | ||
GIF_FILES=$(YAML_FILES:.yaml=.gif) | ||
THEME=monokai | ||
BAT_THEME=Monokai Extended | ||
|
||
.PHONY: all | ||
all: build run | ||
|
||
.PHONY: cast | ||
cast: $(GIF_FILES) | ||
|
||
%.cast:%.yaml | ||
autocast --overwrite $< $@ | ||
|
||
%.gif: %.cast | ||
agg --theme $(THEME) $< $@ | ||
|
||
.PHONY: build | ||
build: | ||
podman build . -t autocast | ||
|
||
.PHONY: run | ||
run: | ||
podman run -e BAT_THEME="$(BAT_THEME)" --rm -ti -v .:/work --privileged --device /dev/kvm autocast make cast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
--- | ||
settings: | ||
width: 80 | ||
height: 24 | ||
title: How to run an openQA test in 5 minutes | ||
timeout: 300s | ||
type_speed: 50ms | ||
environment_capture: | ||
- HOME | ||
- BAT_THEME | ||
instructions: | ||
- !Command | ||
command: "# Install podman" | ||
- !Command | ||
command: | ||
- zypper in -y podman | ||
- !Command | ||
# Workaround to hide some warnings due to having podman inside podman | ||
command: | ||
- alias podman='podman --log-level error' | ||
hidden: true | ||
- !Command | ||
# Make sure the image will be downloaded, because that looks nice in the video | ||
command: | ||
- podman rmi | ||
- registry.opensuse.org/devel/openqa/containers/openqa-single-instance | ||
hidden: true | ||
- !Marker Pull openQA container | ||
- !Command | ||
command: "# Pull and run openQA single instance container" | ||
- !Command | ||
command: | ||
- podman run --rm -ti --name openqa --detach | ||
- --env skip_suse_tests="" --env skip_suse_specifics="" | ||
- --device /dev/kvm -p 1080:80 -p 1443:443 | ||
- registry.opensuse.org/devel/openqa/containers/openqa-single-instance | ||
- !Command | ||
# Workaround for healtchecks not working without systemd inside recording container | ||
command: >- | ||
( nohup retry -r 20 -s 10 -- podman healthcheck run openqa &> /dev/null & ) | ||
hidden: true | ||
- !Command | ||
command: podman wait --condition healthy openqa | ||
- !Marker Clone job from openqa.opensuse.org | ||
- !Command | ||
command: "# Clone any job from openqa.opensuse.org" | ||
- !Command | ||
command: | ||
- podman exec openqa | ||
- openqa-clone-job https://openqa.opensuse.org/tests/4109159 | ||
- !Command | ||
command: | ||
- podman exec -ti openqa | ||
- openqa-cli monitor 1 | ||
- !Wait 3s | ||
- !Marker Prepare scenario definition | ||
- !Command | ||
command: "# Create scenario definition" | ||
- !Command | ||
command: | ||
- wget -qO scenario-definitions.yaml | ||
- https://raw.githubusercontent.com/os-autoinst/os-autoinst-distri-example/main/scenario-definitions.yaml | ||
- !Command | ||
command: bat scenario-definitions.yaml | ||
- !Command | ||
command: >- | ||
podman cp scenario-definitions.yaml openqa:scenario-definitions.yaml | ||
- !Marker Schedule product | ||
- !Command | ||
command: "# Schedule the product" | ||
- !Command | ||
command: | ||
- podman exec -ti openqa | ||
- openqa-cli schedule --monitor | ||
- --param-file SCENARIO_DEFINITIONS_YAML=scenario-definitions.yaml | ||
- DISTRI=example VERSION=0 FLAVOR=DVD ARCH=x86_64 | ||
- TEST=simple_boot _GROUP_ID=0 BUILD=test | ||
- CASEDIR=https://github.com/os-autoinst/os-autoinst-distri-example.git | ||
- NEEDLES_DIR=%%CASEDIR%%/needles | ||
- !Command | ||
command: podman exec openqa openqa-cli api jobs/2 | jq -r .job.result | ||
- !Marker openQA web UI | ||
- !Command | ||
command: "# We can also use the local web UI" | ||
- !Command | ||
command: >- | ||
alias xdg-open='browsh --time-limit 5 --startup-url' | ||
hidden: true | ||
- !Command | ||
command: >- | ||
xdg-open http://localhost:1080/t2 | ||
- !Command | ||
command: pkill firefox | ||
hidden: true | ||
- !Marker Clean up | ||
- !Command | ||
command: rm -f scenario-definitions.yaml | ||
hidden: true | ||
- !Command | ||
command: "# Stop the container to remove all data" | ||
- !Command | ||
command: podman stop openqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
openqa-in-5-minutes.gif |