Skip to content

Commit

Permalink
Updated CI integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jul 22, 2024
1 parent 2976ebf commit d7bdc80
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
24 changes: 11 additions & 13 deletions .github/workflows/ci-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -68,28 +70,24 @@ 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
if: always()
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
Expand Down
6 changes: 3 additions & 3 deletions puppeteer/agama-integration-tests
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d7bdc80

Please sign in to comment.