Skip to content

K8SPSMDB-1192: Introduce e2e-test pytest wrapper #1962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

jvpasinatto
Copy link
Contributor

@jvpasinatto jvpasinatto commented Jun 6, 2025

K8SPSMDB-1192 Powered by Pull Request Badge

CHANGE DESCRIPTION

This PR adds a wrapper script for running e2e tests with Pytest.
Logs from the tests are captured and only shown on failures alongside the state of K8s nodes at the time.
Test reports are generated and stored by default in the e2e-tests/reports directory.

This PR also adds a github action to run mypy and ruff on the python code.

How to run using uv:

Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

Create venv and install/sync dependencies
uv sync

Run all tests
uv run pytest e2e-tests/test_pytest_wrapper.py -v -s

Run specific test
uv run pytest e2e-tests/test_pytest_wrapper.py -v -s --test-regex '^one-pod$'

Run a test suite
uv run pytest e2e-tests/test_pytest_wrapper.py -v -s --test-suite backups

Run and collect k8s resources
uv run pytest e2e-tests/test_pytest_wrapper.py -v -s --test-regex '^one-pod$' --collect-k8s-resources

@pull-request-size pull-request-size bot added the size/L 100-499 lines label Jun 6, 2025
@pull-request-size pull-request-size bot added size/XL 500-999 lines and removed size/L 100-499 lines labels Jun 12, 2025
@gkech
Copy link
Contributor

gkech commented Jun 12, 2025

I think we need to add to gitignore e2e-tests/__pycache__/

@gkech
Copy link
Contributor

gkech commented Jun 12, 2025

we can maybe add the reports/ directory as well to avoid unintentional report file commits.

@JNKPercona
Copy link
Collaborator

Test Name Result Time
arbiter failure 00:00:00
balancer failure 00:00:00
cross-site-sharded failure 00:00:00
custom-replset-name failure 00:00:00
custom-tls failure 00:00:00
custom-users-roles failure 00:00:00
custom-users-roles-sharded failure 00:00:00
data-at-rest-encryption failure 00:00:00
data-sharded failure 00:00:00
demand-backup failure 00:00:00
demand-backup-eks-credentials-irsa skipped 00:00:00
demand-backup-fs skipped 00:00:00
demand-backup-incremental skipped 00:00:00
demand-backup-incremental-sharded skipped 00:00:00
demand-backup-physical-parallel skipped 00:00:00
demand-backup-physical-aws skipped 00:00:00
demand-backup-physical-azure skipped 00:00:00
demand-backup-physical-gcp skipped 00:00:00
demand-backup-physical-minio skipped 00:00:00
demand-backup-physical-sharded-parallel skipped 00:00:00
demand-backup-physical-sharded-aws skipped 00:00:00
demand-backup-physical-sharded-azure skipped 00:00:00
demand-backup-physical-sharded-gcp skipped 00:00:00
demand-backup-physical-sharded-minio skipped 00:00:00
demand-backup-sharded skipped 00:00:00
expose-sharded skipped 00:00:00
finalizer skipped 00:00:00
ignore-labels-annotations skipped 00:00:00
init-deploy skipped 00:00:00
ldap skipped 00:00:00
ldap-tls skipped 00:00:00
limits skipped 00:00:00
liveness skipped 00:00:00
mongod-major-upgrade skipped 00:00:00
mongod-major-upgrade-sharded skipped 00:00:00
monitoring-2-0 skipped 00:00:00
monitoring-pmm3 skipped 00:00:00
multi-cluster-service skipped 00:00:00
multi-storage skipped 00:00:00
non-voting-and-hidden skipped 00:00:00
one-pod skipped 00:00:00
operator-self-healing-chaos skipped 00:00:00
pitr skipped 00:00:00
pitr-physical skipped 00:00:00
pitr-sharded skipped 00:00:00
pitr-physical-backup-source skipped 00:00:00
preinit-updates skipped 00:00:00
pvc-resize skipped 00:00:00
recover-no-primary skipped 00:00:00
replset-overrides skipped 00:00:00
rs-shard-migration skipped 00:00:00
scaling skipped 00:00:00
scheduled-backup skipped 00:00:00
security-context skipped 00:00:00
self-healing-chaos skipped 00:00:00
service-per-pod skipped 00:00:00
serviceless-external-nodes skipped 00:00:00
smart-update skipped 00:00:00
split-horizon skipped 00:00:00
stable-resource-version skipped 00:00:00
storage skipped 00:00:00
tls-issue-cert-manager skipped 00:00:00
upgrade skipped 00:00:00
upgrade-consistency skipped 00:00:00
upgrade-consistency-sharded-tls skipped 00:00:00
upgrade-sharded skipped 00:00:00
users skipped 00:00:00
version-service skipped 00:00:00
We run 10 out of 68

commit: 7b2055f
image: perconalab/percona-server-mongodb-operator:PR-1962-7b2055fc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants