mirror of
https://github.com/SchweizerischeBundesbahnen/open-source-polarion-system-test-repo-template.git
synced 2026-12-04 10:58:42 +00:00
This is a repository template for system tests for SBB Polarion Team projects | Read-only mirror of https://github.com/SchweizerischeBundesbahnen/open-source-polarion-system-test-repo-template — SBB. Issues & pull requests at the source.
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github | ||
| .mvn | ||
| test-data | ||
| tests | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| .tool-versions | ||
| .yamlfix.toml | ||
| CLAUDE.md | ||
| CODING_STANDARDS.md | ||
| CONTRIBUTING.md | ||
| DCO | ||
| Jenkinsfile | ||
| LICENSE | ||
| NOTICE | ||
| pyproject.toml | ||
| README.md | ||
| renovate.json | ||
| sonar-project.properties | ||
| tox.ini | ||
| uv.lock | ||
| zizmor.yml | ||
System Tests Repository Template for Polarion Extensions
This repository is a template for the system-test repositories of SBB Polarion Java extensions
(ch.sbb.polarion.extension.*). It provides the scaffolding to run black-box system tests against a
Polarion instance using the python-sbb-polarion
test harness, plus the CI/CD wiring (GitHub Actions and Jenkins).
Using this template
- Create a new repository from this template (e.g.
ch.sbb.polarion.extension.<name>.st). - Replace the example values (the scaffold ships a minimal worked example that creates a temporary
exampleproject, asserts it exists, and tears it down; search forTEMPLATEto find each spot):tests/constants.py— setEXTENSION_NAMEto your extension's bundle id.tests/extension_test_case.py— parameterizeGenericTestCase[...]with your extension's API class.tests/run.py— set the project id / name / template and the template location.pyproject.toml— setnameanddescription.sonar-project.properties— setsonar.projectKey/badges to your repository..github/workflows/system-tests.yml— pinTC_*versions and images for your extension.
- Add your project template and baselines under
test-data/(seetest-data/project-template/README.md). - Write
tests/test_*.pymodules subclassingExtensionTestCase(tests/test_example_project.pyis an example).
CI
This project uses dual CI:
- GitHub Actions
ci.yml— linting, type checking, and SonarCloud analysis (static checks; no Polarion required).system-tests.yml— system tests against a Polarion instance running in a Docker container. This is the pull request merge gate (thesystem-testscheck is required onmain), so merging does not depend on the availability of a persistent Polarion instance.
- Jenkins (
Jenkinsfile) — the same system tests run on a nightly schedule against a persistent Polarion instance, on themainbranch only. Jenkins is not part of the per-pull-request merge path.
1. Run tests against a prepared Polarion server (local or remote)
In this mode, the tests run against a running Polarion server specified by app_url and authenticated
with app_token.
| Parameter | Default value | Mandatory for external Polarion | Description |
|---|---|---|---|
| app_url | - | yes | Base URL of external Polarion server |
| app_token | - | yes | Authentication token |
IntelliJ
- install the Python plugin
- import the project
- add and configure a Python SDK in the project settings
- run as a normal unit test
Command line example
uv run python tests/run.py --app_url BASE_POLARION_URL --app_token AUTH_TOKEN
2. Run tests against a local Polarion test container
In this mode a Polarion container is created on the fly from a Docker image and the tests run against it.
Prerequisites
- Docker runtime must be available on the machine
- A Polarion Docker image with the specified name must exist locally or in a remote registry
Command line example
uv run python tests/run.py --tc_polarion_image_name=polarion:2606-0
Parameters
| Parameter | Default value | Mandatory for test containers | Description |
|---|---|---|---|
| tc_polarion_image_name | - | yes | Polarion Docker image name. This parameter triggers test-containers mode |
| tc_extension_version | latest | no | Version of the extension under test. By default the latest version from the local Maven repo is used |
| tc_additional_bundles | - | no | Comma-separated list of additional bundles to install, in the form group_id:artifact_id:version |
| tc_admin_utility_version | - | no | Version of the admin-utility extension used to initialize the instance and prepare test data |
| tc_weasyprint_service_image_name | - | no | WeasyPrint service Docker image name (only for extensions that depend on the WeasyPrint service) |
All parameters can also be specified as environment variables (the upper-cased TC_* form).