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 11 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 passed 00:12:40
balancer passed 00:22:37
cross-site-sharded passed 00:17:54
custom-replset-name passed 00:10:48
custom-tls passed 00:14:11
custom-users-roles passed 00:10:13
custom-users-roles-sharded passed 00:11:30
data-at-rest-encryption passed 00:12:02
data-sharded passed 00:25:33
demand-backup passed 00:14:05
demand-backup-eks-credentials-irsa passed 00:00:05
demand-backup-fs passed 00:23:57
demand-backup-incremental passed 00:47:16
demand-backup-incremental-sharded passed 01:00:19
demand-backup-physical-parallel passed 00:07:44
demand-backup-physical-aws passed 00:12:24
demand-backup-physical-azure passed 00:11:17
demand-backup-physical-gcp passed 00:11:25
demand-backup-physical-minio passed 00:21:11
demand-backup-physical-sharded-parallel passed 00:09:15
demand-backup-physical-sharded-aws passed 00:17:45
demand-backup-physical-sharded-azure passed 00:17:28
demand-backup-physical-sharded-gcp passed 00:18:30
demand-backup-physical-sharded-minio passed 00:17:45
demand-backup-sharded passed 00:25:29
expose-sharded passed 00:32:47
finalizer passed 00:09:49
ignore-labels-annotations passed 00:07:09
init-deploy passed 00:14:50
ldap passed 00:07:58
ldap-tls passed 00:10:53
limits passed 00:06:13
liveness passed 00:08:19
mongod-major-upgrade passed 00:12:08
mongod-major-upgrade-sharded passed 00:26:34
monitoring-2-0 passed 00:25:21
monitoring-pmm3 passed 00:28:41
multi-cluster-service failure 01:29:34
multi-storage passed 00:19:30
non-voting-and-hidden passed 00:16:08
one-pod passed 00:07:30
operator-self-healing-chaos passed 00:12:28
pitr passed 00:21:58
pitr-physical passed 00:59:36
pitr-sharded passed 00:20:19
pitr-physical-backup-source passed 00:54:52
preinit-updates passed 00:04:55
pvc-resize passed 00:13:05
recover-no-primary passed 00:26:51
replset-overrides passed 00:17:18
rs-shard-migration passed 00:13:20
scaling passed 00:11:12
scheduled-backup passed 00:17:09
security-context passed 00:06:57
self-healing-chaos passed 00:17:27
service-per-pod passed 00:19:03
serviceless-external-nodes passed 00:06:51
smart-update passed 00:08:05
split-horizon passed 00:07:38
stable-resource-version passed 00:04:23
storage passed 00:07:56
tls-issue-cert-manager passed 00:30:05
upgrade passed 00:09:29
upgrade-consistency passed 00:04:52
upgrade-consistency-sharded-tls passed 00:54:04
upgrade-sharded passed 00:20:19
users passed 00:16:49
version-service passed 00:27:24
We run 68 out of 68

commit: b0fe7cc
image: perconalab/percona-server-mongodb-operator:PR-1962-b0fe7cc8

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.

3 participants