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.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-12-04 03:35:21 +00:00
.github fix(deps): update dependency ch.sbb.polarion.extensions:ch.sbb.polarion.extension.admin-utility to v5.1.0 2026-12-03 11:35:55 +00:00
.mvn chore: remove unnecessary comments from settings.xml 2026-06-29 09:46:23 +02:00
test-data feat: adapt repository into a Polarion extension system-test template (#3) 2026-06-24 14:23:34 +02:00
tests chore: use generic GenericTestCase from python-sbb-polarion 5.0.0 (#23) 2026-10-28 16:21:54 +01:00
.gitignore chore: add logs directory to .gitignore 2026-06-29 09:46:10 +02:00
.pre-commit-config.yaml chore(deps): update pre-commit hook commitizen-tools/commitizen to v4.20.1 2026-11-27 12:23:48 +00:00
.tool-versions fix: bump certifi to 2026.10.19 in the lock file (#21) 2026-10-21 19:37:59 +02:00
.yamlfix.toml Initial commit 2026-06-23 20:52:03 +02:00
CLAUDE.md chore: replace mypy with ty for type checking (#24) 2026-11-03 11:29:47 +01:00
CODING_STANDARDS.md chore: replace mypy with ty for type checking (#24) 2026-11-03 11:29:47 +01:00
CONTRIBUTING.md docs: align CONTRIBUTING.md wording with a Polarion system-test repo (#6) 2026-06-24 14:36:55 +02:00
DCO Initial commit 2026-06-23 20:52:03 +02:00
Jenkinsfile chore: neutralize infra wording and tidy CI config for template use (#8) 2026-06-24 16:25:15 +02:00
LICENSE Initial commit 2026-06-23 20:52:03 +02:00
NOTICE Initial commit 2026-06-23 20:52:03 +02:00
pyproject.toml fix(deps): update dependency ty to v0.0.115 2026-12-04 03:35:21 +00:00
README.md chore: use generic GenericTestCase from python-sbb-polarion 5.0.0 (#23) 2026-10-28 16:21:54 +01:00
renovate.json ci: track test-data as the extension under test (#27) 2026-11-13 16:29:33 +01:00
sonar-project.properties fix: bump certifi to 2026.10.19 in the lock file (#21) 2026-10-21 19:37:59 +02:00
tox.ini chore: replace mypy with ty for type checking (#24) 2026-11-03 11:29:47 +01:00
uv.lock fix(deps): update dependency ty to v0.0.115 2026-12-04 03:35:21 +00:00
zizmor.yml feat: adapt repository into a Polarion extension system-test template (#3) 2026-06-24 14:23:34 +02:00

Quality Gate Status Bugs Code Smells Duplicated Lines (%) Lines of Code Reliability Rating Security Rating Maintainability Rating Vulnerabilities

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

  1. Create a new repository from this template (e.g. ch.sbb.polarion.extension.<name>.st).
  2. Replace the example values (the scaffold ships a minimal worked example that creates a temporary example project, asserts it exists, and tears it down; search for TEMPLATE to find each spot):
    • tests/constants.py — set EXTENSION_NAME to your extension's bundle id.
    • tests/extension_test_case.py — parameterize GenericTestCase[...] with your extension's API class.
    • tests/run.py — set the project id / name / template and the template location.
    • pyproject.toml — set name and description.
    • sonar-project.properties — set sonar.projectKey/badges to your repository.
    • .github/workflows/system-tests.yml — pin TC_* versions and images for your extension.
  3. Add your project template and baselines under test-data/ (see test-data/project-template/README.md).
  4. Write tests/test_*.py modules subclassing ExtensionTestCase (tests/test_example_project.py is 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 (the system-tests check is required on main), 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 the main branch 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).