🔀 Merge pull request #113 from Schneegans/feature/advanced-ci

This commit is contained in:
Simon Schneegans
2022-03-04 04:53:36 +01:00
committed by GitHub
148 changed files with 328 additions and 50 deletions
+24 -2
View File
@@ -16,8 +16,8 @@ LOCALES_MO = $(patsubst po/%.po,locale/%/LC_MESSAGES/$(NAME).mo,$(LOCALES_PO
ZIP_CONTENT = $(JS_FILES) $(LOCALES_MO) resources/$(NAME).gresource \
schemas/gschemas.compiled metadata.json LICENSE
# These five recipes can be invoked by the user.
.PHONY: zip install uninstall pot clean
# These seven recipes can be invoked by the user.
.PHONY: zip install uninstall pot clean test references
# The zip recipes only bundles the extension without installing it.
zip: $(ZIP_NAME)
@@ -41,6 +41,28 @@ pot: $(JS_FILES) $(UI_FILES)
--output=po/$(NAME).pot \
$(JS_FILES) $(UI_FILES)
# This runs several tests in containerized versions of GNOME Shell.
test:
@ for version in 32 33 34 35 36 ; do \
for session in "gnome-xsession" "gnome-wayland-nested" ; do \
echo ; \
echo "Running Tests on Fedora $$version ($$session)." ; \
echo ; \
./tests/run-test.sh -s $$session -v $$version ; \
done \
done
# This re-generates all reference images required by the tests.
references:
@ for version in 32 33 34 35 36 ; do \
for session in "gnome-xsession" "gnome-wayland-nested" ; do \
echo ; \
echo "Generating References for Fedora $$version ($$session)." ; \
echo ; \
./tests/generate-references.sh -s $$session -v $$version ; \
done \
done
# This removes all temporary files created with the other recipes.
clean:
rm -rf $(ZIP_NAME) \
+8
View File
@@ -1,5 +1,13 @@
# Changelog of the Burn-My-Windows Extension
## [Burn My Window 13](https://github.com/schneegans/Burn-My-Windows/releases/tag/v13)
**Release Date:** TBD
#### Enhancements
* The continuous integration tests have been significantly enhanced. Now, all window-open and window-close animations are visually tested on all supported GNOME versions and on X11 / Wayland (summing up to a total of 136 test cases).
## [Burn My Window 12](https://github.com/schneegans/Burn-My-Windows/releases/tag/v12)
**Release Date:** 2022-02-19
+12 -5
View File
@@ -381,11 +381,16 @@ class Extension {
// ----------------------------------------------------------- tweak actor transitions
// If we are currently performing integration test, all animations are set to a fixed
// duration and show a fixed frame from the middle of the animation.
const testMode = this._settings.get_boolean('test-mode');
// The following is used to tweak the ongoing transitions of a window actor. Usually
// windows are faded in / out scaled up / down slightly by GNOME Shell. Here, we allow
// modifications to this behavior by the effects.
const config = this._currentEffect.tweakTransition(actor, this._settings, forOpening);
const duration =
const duration = testMode ?
5000 :
this._settings.get_int(this._currentEffect.getNick() + '-animation-time');
// All animations are relative to the window's center.
@@ -416,9 +421,10 @@ class Extension {
// Tweak the transition according to the config object. For some reason, there are
// rare cases, where no transition is set up. This happens from time to time...
if (transition) {
const middle = (config[property].to + config[property].from) / 2;
transition.set_duration(duration);
transition.set_to(config[property].to);
transition.set_from(config[property].from);
transition.set_to(testMode ? middle : config[property].to);
transition.set_from(testMode ? middle : config[property].from);
transition.set_progress_mode(config[property].mode);
}
}
@@ -454,8 +460,9 @@ class Extension {
// Update uniforms at each frame.
transition.connect('new-frame', (t) => {
shader.set_uniform_value('uProgress', t.get_progress());
shader.set_uniform_value('uTime', 0.001 * t.get_elapsed_time());
shader.set_uniform_value('uProgress', testMode ? 0.5 : t.get_progress());
shader.set_uniform_value(
'uTime', testMode ? duration / 2 : 0.001 * t.get_elapsed_time());
shader.set_uniform_value('uSizeX', actor.width);
shader.set_uniform_value('uSizeY', actor.height);
});
@@ -25,6 +25,12 @@
<description>The effect with this nick will be used for the next window-open animation.</description>
</key>
<key name="test-mode" type="b">
<default>false</default>
<summary>Test Mode</summary>
<description>If set to true, all animations will show only one still frame to allow for continuous integration tests.</description>
</key>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- Fire Options -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+5 -1
View File
@@ -150,6 +150,9 @@ if (utils.isInShellProcess()) {
epicenterY = localY / actor.height;
}
// If we are currently performing integration test, the animation uses a fixed seed.
const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
// Inject some common shader snippets.
@@ -157,7 +160,8 @@ if (utils.isInShellProcess()) {
uniform sampler2D uShardTexture;
const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
${testMode ? 0 : Math.random()});
const float SHARD_SCALE = ${settings.get_double('broken-glass-scale')};
const float SHARD_LAYERS = 5;
const float BLOW_FORCE = ${settings.get_double('broken-glass-blow-force')};
+5 -1
View File
@@ -117,6 +117,9 @@ if (utils.isInShellProcess()) {
const color = Clutter.Color.from_string(settings.get_string('energize-a-color'))[1];
// If we are currently performing integration test, the animation uses a fixed seed.
const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
// Inject some common shader snippets.
@@ -124,7 +127,8 @@ if (utils.isInShellProcess()) {
${shaderSnippets.noise()}
${shaderSnippets.edgeMask()}
const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
${testMode ? 0 : Math.random()});
const float FADE_IN_TIME = 0.3;
const float FADE_OUT_TIME = 0.6;
const float HEART_FADE_TIME = 0.3;
+5 -1
View File
@@ -117,6 +117,9 @@ if (utils.isInShellProcess()) {
const color = Clutter.Color.from_string(settings.get_string('energize-b-color'))[1];
// If we are currently performing integration test, the animation uses a fixed seed.
const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
// Inject some common shader snippets.
@@ -124,7 +127,8 @@ if (utils.isInShellProcess()) {
${shaderSnippets.noise()}
${shaderSnippets.edgeMask()}
const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
${testMode ? 0 : Math.random()});
const float SHOWER_TIME = 0.3;
const float SHOWER_WIDTH = 0.3;
const float STREAK_TIME = 0.6;
+5 -1
View File
@@ -132,6 +132,9 @@ if (utils.isInShellProcess()) {
const color =
Clutter.Color.from_string(settings.get_string('claw-scratch-color'))[1];
// If we are currently performing integration test, the animation uses a fixed seed.
const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
// Inject some common shader snippets.
@@ -141,7 +144,8 @@ if (utils.isInShellProcess()) {
// See assets/README.md for how this texture was created.
uniform sampler2D uClawTexture;
const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
${testMode ? 0 : Math.random()});
const float CLAW_SIZE = ${settings.get_double('claw-scratch-scale')};
const float NUM_CLAWS = ${settings.get_int('claw-scratch-count')};
const float WARP_INTENSITY = 1.0 + ${settings.get_double('claw-scratch-warp')};
+5 -1
View File
@@ -118,6 +118,9 @@ if (utils.isInShellProcess()) {
const color = Clutter.Color.from_string(settings.get_string('wisps-color'))[1];
// If we are currently performing integration test, the animation uses a fixed seed.
const testMode = settings.get_boolean('test-mode');
this.set_shader_source(`
// Inject some common shader snippets.
@@ -125,7 +128,8 @@ if (utils.isInShellProcess()) {
${shaderSnippets.noise()}
${shaderSnippets.edgeMask()}
const vec2 SEED = vec2(${Math.random()}, ${Math.random()});
const vec2 SEED = vec2(${testMode ? 0 : Math.random()},
${testMode ? 0 : Math.random()});
const float WISPS_RADIUS = 20.0;
const float WISPS_SPEED = 10.0;
const float WISPS_SPACING = 40 + WISPS_RADIUS;
+183
View File
@@ -0,0 +1,183 @@
#!/bin/bash
# -------------------------------------------------------------------------------------- #
# ) ( #
# ( /( ( ( ) ( ( ( ( )\ ) ( ( #
# )\()) ))\ )( ( ( )\ ) )\))( )\ ( (()/( ( )\))( ( #
# ((_)\ /((_|()\ )\ ) )\ '(()/( ((_)()((_) )\ ) ((_)))\((_)()\ )\ #
# | |(_|_))( ((_)_(_/( _((_)) )(_)) _(()((_|_)_(_/( _| |((_)(()((_|(_) #
# | '_ \ || | '_| ' \)) | ' \()| || | \ V V / | ' \)) _` / _ \ V V (_-< #
# |_.__/\_,_|_| |_||_| |_|_|_| \_, | \_/\_/|_|_||_|\__,_\___/\_/\_//__/ #
# |__/ #
# Copyright (c) 2021 Simon Schneegans #
# Released under the GPLv3 or later. See LICENSE file for details. #
# -------------------------------------------------------------------------------------- #
# This script is used to generate the reference images required for the run-tests.sh
# script. To do this, it installs the extension in a fedora-based container running GNOME
# Shell on xvfb. It requires the burn-my-windows@schneegans.github.com.zip file which is
# expected to be present in the repository root. Therefore you have to call "make" before
# this script.
#
# The scripts supports two arguments:
#
# -v fedora_version: This determines the version of GNOME Shell to test agains.
# -v 32: GNOME Shell 3.36
# -v 33: GNOME Shell 3.38
# -v 34: GNOME Shell 40
# -v 35: GNOME Shell 41
# -s session: This can either be "gnome-xsession" or "gnome-wayland-nested".
# Exit on error.
set -e
usage() {
echo "Usage: $0 -v fedora_version -s session" >&2
}
FEDORA_VERSION=33
SESSION="gnome-xsession"
while getopts "v:s:h" opt; do
case $opt in
v) FEDORA_VERSION="${OPTARG}";;
s) SESSION="${OPTARG}";;
h) usage; exit 0;;
*) usage; exit 1;;
esac
done
# Go to the repo root.
cd "$( cd "$( dirname "$0" )" && pwd )/.." || \
{ echo "ERROR: Could not find the repo root."; exit 1; }
IMAGE="ghcr.io/schneegans/gnome-shell-pod-${FEDORA_VERSION}"
EXTENSION="burn-my-windows@schneegans.github.com"
# All references images of the effects are captured at & cropped to this region
# in the center of the screen. This is kind of arbitrary, but has been choosen so that
# something is visible from each effect.
CROP="100x100+910+480"
# Run the container. For more info, visit https://github.com/Schneegans/gnome-shell-pod.
POD=$(podman run --rm --cap-add=SYS_NICE --cap-add=IPC_LOCK -td "${IMAGE}")
# Properly shutdown podman when this script is exited.
quit() {
podman kill "${POD}"
wait
}
trap quit INT TERM EXIT
# -------------------------------------------------------------------------------- methods
# This function is used below to execute any shell command inside the running container.
do_in_pod() {
podman exec --user gnomeshell --workdir /home/gnomeshell "${POD}" set-env.sh "$@"
}
# This simulates the given keystroke in the container. Simply calling "xdotool key $1"
# sometimes fails to be recognized. Maybe the default 12ms between key-down and key-up
# are too short for xvfb...
send_keystroke() {
do_in_pod xdotool keydown "${1}"
sleep 0.5
do_in_pod xdotool keyup "${1}"
}
# This can be used to set a gsettings key of the extension.
set_setting() {
do_in_pod gsettings --schemadir /home/gnomeshell/.local/share/gnome-shell/extensions/burn-my-windows@schneegans.github.com/schemas \
set org.gnome.shell.extensions.burn-my-windows "${1}" "${2}"
}
# This makes a screen capture (cropped to $CROP) inside the container and stores it
# on the host relative to this script with the given file name.
capture() {
do_in_pod import -window root -crop $CROP out.png
podman cp "${POD}":/home/gnomeshell/out.png "${1}"
}
# This opens the extensions preferences dialog and captures two images: One during the
# window-open animation, and one during the window-close animation. The sleeps are a bit
# excessive, but it's difficult to get consistent results with shorter sleeps. The
# animations are shown for five seconds, so we also have to make sure that one animation
# is finished before starting the next one.
capture_effect() {
echo "Capturing ${1} effect."
set_setting "open-preview-effect" "${1}"
set_setting "close-preview-effect" "${1}"
sleep 2
do_in_pod gnome-extensions prefs "${EXTENSION}"
sleep 2
capture "tests/references/${1}-open-${SESSION}-${FEDORA_VERSION}.png"
send_keystroke "Alt+F4"
sleep 2
capture "tests/references/${1}-close-${SESSION}-${FEDORA_VERSION}.png"
sleep 2
}
# ----------------------------------------------------- wait for the container to start up
echo "Waiting for D-Bus."
do_in_pod wait-user-bus.sh > /dev/null 2>&1
# ----------------------------------------------------- install the to-be-tested extension
echo "Installing extension."
podman cp "tests/references" "${POD}:/home/gnomeshell/references"
podman cp "${EXTENSION}.zip" "${POD}:/home/gnomeshell"
do_in_pod gnome-extensions install "${EXTENSION}.zip"
# ---------------------------------------------------------------------- start GNOME Shell
# Starting with GNOME 40, there is a "Welcome Tour" dialog popping up at first launch.
# We disable this beforehand.
if [[ "${FEDORA_VERSION}" -gt 33 ]]; then
echo "Disabling welcome tour."
do_in_pod gsettings set org.gnome.shell welcome-dialog-last-shown-version "999" || true
fi
echo "Starting $(do_in_pod gnome-shell --version)."
do_in_pod systemctl --user start "${SESSION}@:99"
sleep 10
# Enable the extension.
do_in_pod gnome-extensions enable "${EXTENSION}"
# Starting with GNOME 40, the overview is the default mode. We close this here by hitting
# the super key.
if [[ "${FEDORA_VERSION}" -gt 33 ]]; then
echo "Closing Overview."
send_keystroke "super"
fi
# Wait until the extension is enabled and the overview closed.
sleep 3
# --------------------------------------------------------------------- capture the images
# The test mode ensures that the animations are "frozen" and do not change in time.
echo "Entering test mode."
set_setting "test-mode" true
do_in_pod gsettings set org.gnome.mutter center-new-windows true
capture_effect "energize-a"
capture_effect "energize-b"
capture_effect "fire"
capture_effect "tv"
capture_effect "wisps"
if [[ "${FEDORA_VERSION}" -gt 33 ]]; then
capture_effect "trex"
capture_effect "broken-glass"
capture_effect "matrix"
fi
echo "All reference images generated successfully."
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Some files were not shown because too many files have changed in this diff Show More