Skip to content

refactor: centralize module testing#79

Merged
andre8244 merged 5 commits into
mainfrom
copilot/update-test-module-workflow
Apr 24, 2026
Merged

refactor: centralize module testing#79
andre8244 merged 5 commits into
mainfrom
copilot/update-test-module-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 24, 2026

Centralizes the testing infrastructure to follow the standard conventions from NethServer/dev#7281, replacing the bespoke test runner setup with the shared ns8-github-actions@v1 workflow.

Workflow

  • Replace test-module.yml jobs with a single uses: NethServer/ns8-github-actions/.github/workflows/test-module.yml@v1 call, setting ui_tests_strategy: always

Robot Framework tests

  • Rename tests/collabora.robottests/10__collabora.robot; change Set Suite VariableSet Global Variable for ${module_id} so it propagates across test files
  • Add tests/20__ui.robot using the Browser library to screenshot the Status and Settings pages via the cluster-admin UI

Housekeeping

  • Add tests/outputs/ to .gitignore
  • Replace the "Testing" section in README.md with a link to the ns8-github-actions v1 guide
  • Delete test-module.sh and tests/pythonreq.txt
Original prompt

This PR centralizes the module testing infrastructure for ns8-collabora following the standard testing conventions established in NethServer/dev issue #7281 (NethServer/dev#7281).

Changes to perform:

  1. Update .github/workflows/test-module.yml: Replace with the centralized test module workflow from ns8-mail reference implementation

    • Uses centralized workflow from NethServer/ns8-github-actions at v1 tag
    • Configured with ui_tests_strategy: on_renovate_ui_change
  2. Add Robot Framework UI tests (since ui/src/App.vue exists):

    • Rename tests/collabora.robot to add numeric prefix and change Set Suite Variable to Set Global Variable for module_id variable to make it available to subsequent test files
    • Create new UI tests file with appropriate numeric prefix for UI tests that:
      • Uses Browser library for testing the UI
      • Takes screenshots of Status and Settings pages
      • Properly handles the module variable that was set as global
    • Ensure correct test execution order with proper numeric prefixes
  3. Update testing configuration:

    • Ensure .gitignore contains tests/outputs/ entry
    • Replace "Testing" section in README.md with standard documentation pointing to ns8-github-actions v1 guide
    • Delete test-module.sh if present
    • Delete tests/pythonreq.txt if present

Reference Implementation:

All changes follow the pattern from NethServer/ns8-mail at commit d034d052cb0205da95a4947e2ccd4a20a031a1a9

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Create a PR for the following repositories:

  • Nethserver/ns8-webtop
  • Nethserver/ns8-collabora

PR title and commit message are "refactor: centralize module testing"

PR description is the following:
Ref:

The changes to perform are the following:

  • substitute the content of .github/workflows/test-module.yml with this: https://raw.githubusercontent.com/NethServer/ns8-mail/d034d052cb0205da95a4947e2ccd4a20a031a1a9/.github/workflows/test-module.yml
  • if and only if ui/src/App.vue exists, then add the robot file for ui tests by following these steps:
    • inside tests directory, find the robot file that tests the module installation, it should contain something like "Execute Command add-module". Make sure that output.module_id is available to subsequent test files by using Set Global Variable instead of Set Suite Variable. Take note of the name of the file that installs the module, especially the starting number of its name. If the file name does not start with a number, then let's rename that file to 10__OLDNAME.robot; replace "OLDNAME" with the previous name of the file
    • add a robot file for the ui tests inside the tests directory; the robot file should be named NUMBER__ui.robot or NUMBER__ui.robot (check if existing robot files use one underscore or two in their name). Substitute "NUMBER" with an appropriate number, so that the ui tests are executed after the test that installs the module and before other tests. Example: if the module is installed inside "10__install.robot" and the next test is "20__test.robot", then name the ui tests file as "15__ui.robot". If it exists only one robot file called MODULENAME.robot and it does not have a numeric prefix, then rename it to 10__MODULENAME.robot and use 20__ui.robot for the ui tests.
    • the robot file for the ui tests should have a content similar to this: https://github.com/NethServer/ns8-mail/blob/d034d052cb0205da95a4947e2ccd4a20a031a1a9/tests/15__ui.robot. Make sure that the variable name of the module ID matches. If needed, change MID variable to the one used in Set Global Variable; be sure to change all occurrences: the variable declaration to ${EMPTY} AND the module variable used in the Go To instructions
  • Make sure that .gitignore contains tests/outputs/
  • README.md: replace the "Testing" section with this short section: https://github.com/NethServer/ns8-mail/blob/d034d052cb0205da95a4947e2ccd4a20a031a1a9/README.md?plain=1#L299-L301. Add this section anyway if "Testing" section does not exist. Make sure to put the correct URL, using "v1", AND NOT "main": https://github.com/NethServer/ns8-github-actions/blob/v1/README.md#running-tests-locally
  • Delete test-module.sh if present
  • Delete tests/pythonreq.txt if present

Assistant: I'll create pull requests for both repositories with the specified changes. Let me start by gathering the necessary information and then create the PRs.

Assistant: Now let me fetch the reference materials for the robot file and README section:

Assistant: Now I need to get the tests directory structure and check for robot files, .gitignore, and other files for both repositories:

Assistant: Now let me get the test robot files to understand the structure:

Assistant: Now I'll create PRs for both repositories. I need to:

  1. For webtop: Update `.github/workflows/t...

This pull request was created from Copilot chat.

Agent-Logs-Url: https://github.com/NethServer/ns8-collabora/sessions/0dba9d0b-b450-4dbc-9eb7-c42b8c96c852

Co-authored-by: andre8244 <4612169+andre8244@users.noreply.github.com>
Copilot AI changed the title [WIP] Update testing infrastructure for ns8-collabora module refactor: centralize module testing Apr 24, 2026
Copilot AI requested a review from andre8244 April 24, 2026 13:28
@andre8244
Copy link
Copy Markdown
Contributor

@copilot change ui_tests_strategy: on_renovate_ui_change to always

Agent-Logs-Url: https://github.com/NethServer/ns8-collabora/sessions/62557c02-2c7a-4baf-bf26-b0cf6a5fef42

Co-authored-by: andre8244 <4612169+andre8244@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 24, 2026

@copilot change ui_tests_strategy: on_renovate_ui_change to always

Done in 5207d03.

@github-actions
Copy link
Copy Markdown

UI Test Screenshots rl1

1. Status

1._Status.png

2. Settings

2._Settings.png

@andre8244 andre8244 marked this pull request as ready for review April 24, 2026 16:26
@andre8244 andre8244 merged commit b66175a into main Apr 24, 2026
5 of 7 checks passed
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.

2 participants