Skip to content

Add UI test workflow for Renovate dependency-update PRs#179

Open
Copilot wants to merge 9 commits intomainfrom
copilot/add-ci-workflow-ui-tests
Open

Add UI test workflow for Renovate dependency-update PRs#179
Copilot wants to merge 9 commits intomainfrom
copilot/add-ci-workflow-ui-tests

Conversation

Copy link

Copilot AI commented Feb 27, 2026

This pull request introduces automated UI testing for Renovate PRs affecting the ui directory. It adds a GitHub Actions workflow that triggers on Renovate PRs, a shell script to run Robot Framework tests in a container, and the necessary test files and dependencies. The changes enable end-to-end testing of UI modules in a controlled environment.

Automated UI testing workflow:

  • Added .github/workflows/test-renovate-ui.yml to run UI tests automatically on Renovate PRs targeting the ui directory. This workflow checks the PR author, builds/publishes images, gathers module info, and executes UI tests using DigitalOcean infrastructure.

Test execution and environment setup:

  • Introduced ui/test-ui.sh script to run Robot Framework tests in a container, passing SSH credentials and module image information, and collecting test outputs.
  • Added ui/tests/pythonreq.txt listing Python dependencies for Robot Framework and its libraries.

Test suite and outputs:

  • Added ui/tests/test_ui.robot containing Robot Framework test cases for module installation, UI login, screenshot capture, and module removal.
  • Updated .gitignore to exclude test output files (tests/outputs).

Co-authored-by: andre8244 <4612169+andre8244@users.noreply.github.com>
Copilot AI changed the title [WIP] Add CI workflow for UI tests on Renovate PRs Add UI test workflow for Renovate dependency-update PRs Feb 27, 2026
@andre8244 andre8244 force-pushed the copilot/add-ci-workflow-ui-tests branch from ec3c3d0 to af43452 Compare February 27, 2026 16:58
@andre8244 andre8244 force-pushed the copilot/add-ci-workflow-ui-tests branch from af43452 to ce57756 Compare February 27, 2026 17:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an automated UI end-to-end testing pipeline intended to run on Renovate dependency-update PRs affecting the ui/ directory, using Robot Framework tests executed in a container and run on DigitalOcean-based CI infrastructure.

Changes:

  • Added a GitHub Actions workflow to trigger UI tests for Renovate PRs that touch ui/**.
  • Added a ui/test-ui.sh runner script plus Robot Framework test suite and Python dependencies.
  • Updated ui/.gitignore to exclude Robot Framework output artifacts.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
.github/workflows/test-renovate-ui.yml New workflow to gate execution to Renovate PRs and run UI tests via reusable DO-infra workflow.
ui/test-ui.sh New containerized runner script to execute Robot Framework UI tests and collect outputs.
ui/tests/test_ui.robot New Robot Framework suite to install a module, log into UI, take screenshots, and remove the module.
ui/tests/pythonreq.txt Python dependencies for the Robot Framework test container.
ui/.gitignore Ignore generated test output directory under ui/tests/outputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


podman run -i \
--network=host \
--volume=.:/home/pwuser/ns8-module:z \
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script installs Python deps on every run but does not use the site-packages volume cache that test-module.sh uses, which will slow down CI and increase external dependency flakiness. Consider adding the same cached volume mount (or another cache mechanism) for pip install artifacts.

Suggested change
--volume=.:/home/pwuser/ns8-module:z \
--volume=.:/home/pwuser/ns8-module:z \
--volume=./.pip-cache:/home/pwuser/.cache/pip:z \

Copilot uses AI. Check for mistakes.
Suite Setup Connect to the node

*** Variables ***
${SSH_KEYFILE} %{HOME}/.ssh/id_ecdsa
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${SSH_KEYFILE} defaults to %{HOME}/.ssh/id_ecdsa, but ui/test-ui.sh defaults to id_rsa and CI passes SSH_KEYFILE explicitly via -v. To avoid local/CI mismatches, consider removing the hard-coded default here (rely on the passed-in variable) or aligning it with the script default.

Suggested change
${SSH_KEYFILE} %{HOME}/.ssh/id_ecdsa
${SSH_KEYFILE} %{HOME}/.ssh/id_rsa

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +3
robotframework
robotframework-sshlibrary
robotframework-browser
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test container installs Python dependencies from pythonreq.txt without pinning versions, meaning each run may pull arbitrary new releases of robotframework, robotframework-sshlibrary, or robotframework-browser from PyPI into an environment that has access to SSH credentials and your cluster. If any of these packages (or their transitive dependencies) are compromised in the future, the attack code would automatically execute in CI with the ability to exfiltrate secrets or tamper with test results. Pin these packages to specific, vetted versions (or hashes) to ensure only known-good artifacts are used in the test pipeline.

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +33
ssh_key="$(< $SSH_KEYFILE)"

cleanup() {
set +e
podman cp rf-core-runner:/home/pwuser/outputs tests/
podman stop rf-core-runner
podman rm rf-core-runner
}

trap cleanup EXIT

podman run -i \
--network=host \
--volume=.:/home/pwuser/ns8-module:z \
--name rf-core-runner ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable:19.11.0 \
bash -l -s <<EOF
set -e
echo "$ssh_key" > /home/pwuser/ns8-key
pip install -q -r /home/pwuser/ns8-module/tests/pythonreq.txt
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script runs a third-party container image ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable:19.11.0 with --network=host and passes in the private SSH key contents via ssh_key, giving that image direct access to secrets and your test infrastructure. Because the image is pinned only by a mutable tag and comes from an external organization, a compromised or hijacked image could exfiltrate the SSH key or tamper with tests without any integrity check. Pin this image to an immutable digest (and/or vendor it under your own namespace) and restrict secrets exposure so that only trusted, first-party images ever see private keys.

Copilot uses AI. Check for mistakes.
@andre8244 andre8244 marked this pull request as ready for review March 2, 2026 09:14
@andre8244 andre8244 requested a review from DavidePrincipi March 2, 2026 09:14
Copy link
Member

@DavidePrincipi DavidePrincipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check

  • allowed branch name
  • test output directory path

workflow_dispatch:
pull_request:
branches:
- main
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workflow must run on renovate branches. IIRC this is the branch prefix:

Suggested change
- main
- renovate-*

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we should put the name of the base branch, i.e. the branch we are merging into

andre8244 and others added 5 commits March 3, 2026 10:53
Co-authored-by: Davide Principi <davide.principi@nethesis.it>
Co-authored-by: Davide Principi <davide.principi@nethesis.it>
@andre8244 andre8244 requested a review from DavidePrincipi March 3, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants