Skip to content

K8SPSMDB-1219: Minor test improvements #1871

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

Merged
merged 17 commits into from
Mar 28, 2025
Merged

K8SPSMDB-1219: Minor test improvements #1871

merged 17 commits into from
Mar 28, 2025

Conversation

egegunes
Copy link
Contributor

@egegunes egegunes commented Mar 20, 2025

K8SPSMDB-1219 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
Short explanation of the problem.

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Short explanation of the solution we are providing with this PR.

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/S 10-29 lines label Mar 20, 2025
@github-actions github-actions bot added the tests label Mar 20, 2025
@pull-request-size pull-request-size bot added size/XXL 1000+ lines and removed size/S 10-29 lines labels Mar 25, 2025
hors and others added 10 commits March 27, 2025 08:48
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@egegunes egegunes marked this pull request as ready for review March 27, 2025 07:23
write_document "-2nd"
run_backup $backup_name_minio 2 physical
compare_latest_restorable_time "${cluster}-rs0" "${backup_name_minio}-2"
check_recovery "${backup_name_minio}-2" latest "" "-2th" "$cluster" backupSource
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe here we want to use 3rd? Mentioning this because we have both find-2th.json and find-3rd.json which are identical, but the find-3rd is the right syntax. Also one of these files I think is redundant.

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed 6a9a86d

@@ -1691,6 +1727,92 @@ format_date() {
echo $(TZ=UTC $date -d@${timestamp} '+%Y-%m-%d %H:%M:%S')
}

get_bucket_name() {
local bucket_name=$1
Copy link
Contributor

@gkech gkech Mar 27, 2025

Choose a reason for hiding this comment

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

This variable should be backup_name given the following kubectl command In L.1733, and how it is used here | $sed -e "s|BUCKET-NAME|$(get_bucket_name "$backup_name")|" \

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed 6a9a86d

check_recovery "${backup_name_minio}-2" latest "" "-2th" "$cluster" backupSource

desc 'disable pitr'
kubectl patch psmdb "some-name" --type='merge' --patch '{"spec": {"backup": {"pitr": {"enabled": false}}}}'
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: Instead of hardcoding some-name throughout this function, we can use the variable cluster

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed 6a9a86d

@@ -304,6 +304,7 @@ func (r *ReconcilePerconaServerMongoDBRestore) getBackup(ctx context.Context, cr
Namespace: cr.Namespace,
},
Spec: psmdbv1.PerconaServerMongoDBBackupSpec{
Type: cr.Spec.BackupSource.Type,
Copy link
Contributor

Choose a reason for hiding this comment

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

From what I understand, adding this is mostly for consistency, right? Couldn't understand how we use it with this PR's changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, this is a bug fix. after incremental backup changes, physical restores using backup source was broken and this fixes it

@hors hors requested a review from gkech March 27, 2025 14:24
gkech
gkech previously approved these changes Mar 27, 2025
@JNKPercona
Copy link
Collaborator

Test name Status
arbiter passed
balancer passed
cross-site-sharded passed
custom-replset-name passed
custom-tls passed
custom-users-roles passed
custom-users-roles-sharded passed
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 passed
demand-backup-physical-sharded 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
multi-cluster-service passed
multi-storage passed
non-voting passed
one-pod passed
operator-self-healing-chaos passed
pitr passed
pitr-physical passed
pitr-sharded passed
pitr-physical-backup-source passed
preinit-updates passed
pvc-resize passed
recover-no-primary passed
replset-overrides passed
rs-shard-migration passed
scaling passed
scheduled-backup passed
security-context passed
self-healing-chaos passed
service-per-pod passed
serviceless-external-nodes passed
smart-update passed
split-horizon passed
stable-resource-version passed
storage passed
tls-issue-cert-manager passed
upgrade passed
upgrade-consistency passed
upgrade-consistency-sharded-tls passed
upgrade-sharded passed
users passed
version-service passed
We run 59 out of 59

commit: e37af0d
image: perconalab/percona-server-mongodb-operator:PR-1871-e37af0db

@hors hors merged commit b630efb into main Mar 28, 2025
19 checks passed
@hors hors deleted the K8SPSMDB-1219 branch March 28, 2025 10:29
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