From d7bdc80e71c272ba959e118bd372a5647d99c803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Mon, 22 Jul 2024 10:02:11 +0200 Subject: [PATCH] Updated CI integration test --- .github/workflows/ci-integration-tests.yml | 24 ++++++++++------------ puppeteer/agama-integration-tests | 6 +++--- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-integration-tests.yml b/.github/workflows/ci-integration-tests.yml index 5e8bbc944a..45846c5224 100644 --- a/.github/workflows/ci-integration-tests.yml +++ b/.github/workflows/ci-integration-tests.yml @@ -32,14 +32,16 @@ jobs: run: mkdir -p /tmp/log/YaST2 - name: Start container - run: podman run --privileged --detach --name agama --ipc=host -e CI -e GITHUB_ACTIONS -v /dev:/dev -v .:/checkout -v /tmp/log/YaST2:/var/log/YaST2 registry.opensuse.org/systemsmanagement/agama/staging/containers/opensuse/agama-testing:latest + run: podman run --privileged --detach --name agama --ipc=host -e CI -e GITHUB_ACTIONS -v /dev:/dev -v .:/checkout -v /tmp/log/YaST2:/var/log/YaST2 registry.opensuse.org/systemsmanagement/agama/devel/containers/opensuse/agama-testing:latest - name: Environment run: podman exec agama bash -c "env | sort" - - name: Set a testing Agama configuration - # delete all products except TW to skip the product selection at the beginning - run: podman exec agama bash -c "ls /checkout/products.d/*.yaml | grep -v tumbleweed.yaml | xargs rm" + - name: Environment + run: podman exec agama bash -c "pwd" + + - name: Packages + run: podman exec agama bash -c "rpm -qa | sort" - name: Build the frontend run: podman exec agama bash -c "cd /checkout; ./setup-web.sh" @@ -68,13 +70,9 @@ jobs: - name: Run the Agama smoke test run: podman exec agama curl http://localhost - - name: Check Playwright version - run: podman exec agama playwright --version - - - name: Run the Playwright tests - # user authentication is not required when cockpit runs a local session - # run the tests in the Chromium browser - run: podman exec agama bash -c "cd /checkout/playwright && SKIP_LOGIN=true playwright test --trace on --project chromium" + - name: Run the Puppeteer tests + # update the test file from git checkout and run it + run: podman exec agama bash -c "cp /checkout/puppeteer/tests/test_root_password.js /usr/share/agama/integration-tests/tests && agama-integration-tests /usr/share/agama/integration-tests/tests/test_root_password.js" - name: Again show the D-Bus services log # run even when any previous step fails @@ -82,14 +80,14 @@ jobs: run: podman exec agama journalctl - name: Upload the test results - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 # run even when any previous step fails if: always() with: name: test-results retention-days: 30 path: | - playwright/test-results/**/* + puppeteer/log/**/* /tmp/log/YaST2/y2log - name: IRC notification diff --git a/puppeteer/agama-integration-tests b/puppeteer/agama-integration-tests index 2617846ef6..31334a4521 100755 --- a/puppeteer/agama-integration-tests +++ b/puppeteer/agama-integration-tests @@ -6,11 +6,11 @@ set -eu MYDIR=$(realpath "$(dirname "$0")") if [ -e "$MYDIR/../.git/" ]; then - PUPPETEER_SKIP_DOWNLOAD=true npm install --omit=optional - npx mocha --bail "$@" + npm install --omit=optional + npx mocha --bail --slow 10000 "$@" else # set the default load path export NODE_PATH=/usr/share/agama/integration-tests/node_modules # run the CLI script directly, npm/npx might not be installed - /usr/bin/env node /usr/share/agama/integration-tests/node_modules/mocha/bin/mocha.js --bail "$@" + /usr/bin/env node /usr/share/agama/integration-tests/node_modules/mocha/bin/mocha.js --bail --slow 10000 "$@" fi