Skip to content

Conversation

jvpasinatto
Copy link
Contributor

@jvpasinatto jvpasinatto commented Sep 23, 2025

CLOUD-929 Powered by Pull Request Badge

CHANGE DESCRIPTION

This PR sets up the initial groundwork for transitioning to pytest as our testing framework. It includes:

  • Conversion of init-deploy and finalizer tests to pytest
  • Addition of a GitHub Action to check Python code quality

Create virtual environment and install dependencies:
uv sync --locked

Run all tests:
uv run pytest

Run a specific test
uv run pytest e2e-tests/init-deploy

Enabling debug logging:
uv run pytest --log-level=DEBUG

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported MongoDB version?
  • Does the change support oldest and newest supported Kubernetes version?

@pull-request-size pull-request-size bot added the size/XXL 1000+ lines label Sep 23, 2025
@@ -0,0 +1,718 @@
import os

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a set of tools like:
kubernetes.py
mongo.py
git.py


# TODO: consider using Python for filtering instead of yq
yq_filter = f"""
del(.metadata.ownerReferences[].apiVersion) |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be nice in a separated file perhaps



@pytest.fixture(scope="class")
def deploy_chaos_mesh(namespace):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could have separate file for helm installed dependencies and use a generic function with parameters to install a helm chart since subprocess is going to be used fot it

@JNKPercona
Copy link
Collaborator

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

commit: c784bf0
image: perconalab/percona-server-mongodb-operator:PR-2058-c784bf01

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