From 5e657a9a5284b84448828657656a6a9214ca6f36 Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Mon, 17 Aug 2026 10:21:05 +0200 Subject: [PATCH 1/3] Upgraded MariaDB to 12.3.2 --- energy-tests/Dockerfile-mariadb | 2 +- energy-tests/compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/energy-tests/Dockerfile-mariadb b/energy-tests/Dockerfile-mariadb index ee69078469..ea9a5ffc4e 100644 --- a/energy-tests/Dockerfile-mariadb +++ b/energy-tests/Dockerfile-mariadb @@ -1,3 +1,3 @@ -FROM mariadb:10.8.2-focal +FROM mariadb:12.3.2-noble COPY ./wordpress-dump.sql /docker-entrypoint-initdb.d/wordpress-dump.sql EXPOSE 3306 diff --git a/energy-tests/compose.yml b/energy-tests/compose.yml index 87b139c3aa..35d9f4a9f7 100644 --- a/energy-tests/compose.yml +++ b/energy-tests/compose.yml @@ -16,7 +16,7 @@ services: - 3306 healthcheck: test: [ - "CMD", "bash", "-c", "mysqladmin ping -h localhost -u wordpress -pwordpress | grep \"mysqld is alive\"" + "CMD", "bash", "-c", "mariadb -h localhost -u wordpress -pwordpress -e 'SELECT 1' >/dev/null 2>&1" ] interval: "1h" # effectively turns repeated healthchecks during runtime off start_period: "60s" From cffd211ebf80ae971dc002f2300521fa1df317da Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Mon, 17 Aug 2026 11:00:55 +0200 Subject: [PATCH 2/3] Moving to latest for all Docker Images now that we have container dependency inspection --- energy-tests/Dockerfile-mariadb | 2 +- energy-tests/Dockerfile-wordpress | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/energy-tests/Dockerfile-mariadb b/energy-tests/Dockerfile-mariadb index ea9a5ffc4e..9ff0e09aa9 100644 --- a/energy-tests/Dockerfile-mariadb +++ b/energy-tests/Dockerfile-mariadb @@ -1,3 +1,3 @@ -FROM mariadb:12.3.2-noble +FROM mariadb:latest COPY ./wordpress-dump.sql /docker-entrypoint-initdb.d/wordpress-dump.sql EXPOSE 3306 diff --git a/energy-tests/Dockerfile-wordpress b/energy-tests/Dockerfile-wordpress index f3c86bb00d..fe046d61a5 100644 --- a/energy-tests/Dockerfile-wordpress +++ b/energy-tests/Dockerfile-wordpress @@ -1,4 +1,4 @@ -FROM wordpress:7.0.4-php8.3-apache +FROM wordpress:latest EXPOSE 9875 COPY ./html /var/www/html COPY ./wordpress.conf /etc/apache2/sites-enabled/wordpress.conf From ca1ea52d4afa7e0e402bfd41da222dc13a0a5964 Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Mon, 17 Aug 2026 11:01:49 +0200 Subject: [PATCH 3/3] Playwright rewrite --- .../{puppeteer-flow.js => playwright-flow.js} | 20 +++++++++--------- energy-tests/usage_scenario.yml | 21 ++++++++++--------- 2 files changed, 21 insertions(+), 20 deletions(-) rename energy-tests/{puppeteer-flow.js => playwright-flow.js} (81%) diff --git a/energy-tests/puppeteer-flow.js b/energy-tests/playwright-flow.js similarity index 81% rename from energy-tests/puppeteer-flow.js rename to energy-tests/playwright-flow.js index 9ce15d9ee1..1303d3c9ea 100644 --- a/energy-tests/puppeteer-flow.js +++ b/energy-tests/playwright-flow.js @@ -1,19 +1,19 @@ -const puppeteer = require("puppeteer"); +const { chromium } = require("playwright"); const microtime = require("microtime"); (async () => { console.log(microtime.now()," Launching Browser"); - const browser = await puppeteer.launch({ - defaultViewport: { - width: 1920, - height: 1080, - }, + const browser = await chromium.launch({ headless: true, - executablePath: "/usr/bin/chromium-browser", args: ["--no-sandbox", "--disable-setuid-sandbox"], // Otherwise it won't run on Docker }); - const page = await browser.newPage(); + const page = await browser.newPage({ + viewport: { + width: 1920, + height: 1080, + }, + }); const dimensions = await page.evaluate(() => { return { width: document.documentElement.clientWidth, @@ -25,7 +25,7 @@ const microtime = require("microtime"); console.log(microtime.now()," Home Page"); await page.goto("http://gcb-wordpress-apache:9875", { - waitUntil: "networkidle2", + waitUntil: "networkidle", }); console.log(microtime.now(),"GMT_SCI_R=1"); @@ -40,7 +40,7 @@ const microtime = require("microtime"); console.log(microtime.now()," Long Text Page"); await page.click("a[href='http://gcb-wordpress-apache:9875/?page_id=36']"); - await page.waitForXPath('//*[contains(text(), "Lorem ipsum dolor sit amet")]') + await page.waitForSelector('xpath=//*[contains(text(), "Lorem ipsum dolor sit amet")]'); console.log(microtime.now(),"GMT_SCI_R=1"); console.log(microtime.now()," Closing Browser"); diff --git a/energy-tests/usage_scenario.yml b/energy-tests/usage_scenario.yml index ec477ad433..91b07d850b 100644 --- a/energy-tests/usage_scenario.yml +++ b/energy-tests/usage_scenario.yml @@ -1,7 +1,7 @@ --- -name: Wordpress Data Puppeteer Scenario +name: Wordpress Data Playwright Scenario author: Arne Tarara -description: Wordpress sample with pre-populated DB (pages and plugins) where a simple Puppeteer flow is executed +description: Wordpress sample with pre-populated DB (pages and plugins) where a simple Playwright flow is executed compose-file: !include compose.yml @@ -25,10 +25,11 @@ services: networks: - gcb-wordpress-mariadb-network folder-destination: "/tmp/repo" - gcb-puppeteer: - image: greencoding/puppeteer-chrome + gcb-playwright: + image: mcr.microsoft.com/playwright:jammy setup-commands: - - command: cp /tmp/repo/energy-tests/puppeteer-flow.js /var/www/puppeteer-flow.js + - command: cp /tmp/repo/energy-tests/playwright-flow.js /var/www/playwright-flow.js + - command: npm install playwright microtime --prefix /var/www networks: - gcb-wordpress-mariadb-network depends_on: @@ -37,11 +38,11 @@ services: flow: - name: Check Website - container: gcb-puppeteer + container: gcb-playwright commands: - type: console - command: node /var/www/puppeteer-flow.js - note: Starting Puppeteer Flow + command: node /var/www/playwright-flow.js + note: Starting Playwright Flow log-stdout: true read-notes-stdout: true read-sci-stdout: true @@ -49,8 +50,8 @@ flow: command: sleep 30 note: Idling - type: console - command: node /var/www/puppeteer-flow.js - note: Starting Puppeteer Flow again + command: node /var/www/playwright-flow.js + note: Starting Playwright Flow again log-stdout: true read-notes-stdout: true read-sci-stdout: true