Skip to content

test(e2e): port upgrade tests to plugin-barman-cloud - #11264

Merged
litaocdl merged 6 commits into
mainfrom
dev/11262
Aug 11, 2026
Merged

litaocdl merged 6 commits into
mainfrom
dev/11262

Conversation

@NiccoloFei

@NiccoloFei NiccoloFei commented Jul 28, 2026 •

Copy link
Copy Markdown
Collaborator

Full-port of the (operator) Upgrade E2Es to plugin-barman-cloud, exercising all 4 upgrade paths.
This is an intentional 1 to 1 port that just replaces in-tree with plugin-barman-cloud, instantiating the E2E test in a new counterpart testing file (like done already for the porting of all the the other plugin-barman-cloud tests).

Once in-tree will be dismissed entirely:

  • the current upgrade_test.go will be deleted and upgrade_plugin_barman_cloud_test.go will be renamed to upgrade_test.go.
  • upgrade/plugin-barman-cloud fixtures will be moved to upgrade/, replacing their in-tree counterpart.

Note: cluster-restore has been modified in behavior in order to be recovered via externalClusters instead of targeting a backup object directly, since that is not supported by plugin-barman-cloud.

Closes #11262

Testing

I suggest reviewing the changes by comparing the new files with their in-tree counterpart, e.g.:

  • upgrade_plugin_barman_cloud_test.go with upgrade_test.go
  • fixtures/upgrade/plugin-barman-cloud/cluster1.yaml.template with fixtures/upgrade/cluster1.yaml.template
  • and so on..

@NiccoloFei
NiccoloFei requested a review from a team July 28, 2026 16:28
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. E2E tests E2E tests tickets for easy triage on release process release-1.28 release-1.29 release-1.30 labels Jul 28, 2026
@cnpg-bot cnpg-bot added the backport-requested ◀️ This pull request should be backported to all supported releases label Jul 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jul 28, 2026
@NiccoloFei
NiccoloFei force-pushed the dev/11262 branch 4 times, most recently from 6b01588 to 868bc7f Compare July 29, 2026 11:49
@cloudnative-pg cloudnative-pg deleted a comment from github-actions Bot Jul 29, 2026
@cloudnative-pg cloudnative-pg deleted a comment from github-actions Bot Jul 29, 2026
@cloudnative-pg cloudnative-pg deleted a comment from github-actions Bot Jul 29, 2026
@cloudnative-pg cloudnative-pg deleted a comment from github-actions Bot Jul 29, 2026
@cloudnative-pg cloudnative-pg deleted a comment from github-actions Bot Jul 29, 2026
@NiccoloFei

Copy link
Copy Markdown
Collaborator Author

/test ft=upgrade

@github-actions

Copy link
Copy Markdown
Contributor

@NiccoloFei

Copy link
Copy Markdown
Collaborator Author

/test ft=upgrade

@github-actions

Copy link
Copy Markdown
Contributor

@armru

armru commented Jul 30, 2026

Copy link
Copy Markdown
Member

/test

@github-actions

Copy link
Copy Markdown
Contributor

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 30, 2026
@litaocdl

Copy link
Copy Markdown
Collaborator

/test ft=upgrade

@github-actions

Copy link
Copy Markdown
Contributor

@litaocdl

Copy link
Copy Markdown
Collaborator

/test ft=upgrade l=k3d,kind

@github-actions

Copy link
Copy Markdown
Contributor

NiccoloFei and others added 6 commits August 11, 2026 09:53
…tore post-upgrade backup check

hack/e2e/run-e2e.sh only installs the plugin-barman-cloud plugin on kind
and k3d, but the upgrade suite ported to it in this file was gated only
on TEST_UPGRADE_TO_V1 and the vendor not being ocp, so its four It blocks
would also run on aks/eks/gke and fail hard trying to install a plugin
that isn't there. The BeforeAll already skips on OpenShift, so add a
matching IsKind()/IsK3D() guard next to it.

The port also dropped the final step of the deleted in-tree spec, which
took a plugin backup after the operator upgrade and checked it completed
through the cluster's backup condition. The only backup left in the file
is created before the upgrade, so nothing here exercises the plugin
backup path once the new operator is running. Restore that check with a
new backup fixture (backup-1.yaml with a different name, since re-applying
the same one would just update the already-completed backup) applied
after the restore step, so it can't be picked up as the base backup for
that restore and quietly break the "backup taken before the upgrade"
guarantee the restore is meant to prove.

Signed-off-by: Armando Ruocco <[email protected]>
We use unique namespace name as objectStore name and destinationPath name, each test case share
unique objectstore and destinationPath name, so we do not need to cleanup the files on storage.
Refactor the cleanup function name to reflect its content.

Signed-off-by: Tao Li <[email protected]>
@litaocdl
litaocdl merged commit 2e46c22 into main Aug 11, 2026
36 checks passed
@litaocdl
litaocdl deleted the dev/11262 branch August 11, 2026 02:10
cnpg-bot pushed a commit that referenced this pull request Aug 11, 2026
Full port the (operator) `Upgrade` E2Es to use plugin-barman-cloud,
exercising all 4 upgrade paths.

Signed-off-by: Niccolò Fei <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Tao Li <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Co-authored-by: Tao Li <[email protected]>
(cherry picked from commit 2e46c22)
cnpg-bot pushed a commit that referenced this pull request Aug 11, 2026
Full port the (operator) `Upgrade` E2Es to use plugin-barman-cloud,
exercising all 4 upgrade paths.

Signed-off-by: Niccolò Fei <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Tao Li <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Co-authored-by: Tao Li <[email protected]>
(cherry picked from commit 2e46c22)
cnpg-bot pushed a commit that referenced this pull request Aug 11, 2026
Full port the (operator) `Upgrade` E2Es to use plugin-barman-cloud,
exercising all 4 upgrade paths.

Signed-off-by: Niccolò Fei <[email protected]>
Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Tao Li <[email protected]>
Co-authored-by: Armando Ruocco <[email protected]>
Co-authored-by: Tao Li <[email protected]>
(cherry picked from commit 2e46c22)
fcanovai added a commit that referenced this pull request Aug 25, 2026
…ration

tests/e2e/upgrade_plugin_barman_cloud_test.go was added to main by
"test(e2e): port upgrade tests to plugin-barman-cloud" (#11264) as a copy
of upgrade_test.go, after the suite had been moved onto the configuration
file. It therefore kept reading the process environment, which nothing
populates any more, with two consequences.

Its skip gate tested TEST_SKIP_UPGRADE, a variable the run-e2e scripts
stopped exporting once they started writing skipUpgradeSuite into the
configuration. The gate never fired, so this Ordered/Serial spec ran
during the main suite invocation, where the operator manifests it needs
are not generated.

Its SERVER_NAME, OBJECT_STORE_NAME and RECOVERY_* values were published
with os.Setenv, but GetYAMLContent no longer merges os.Environ() into the
substitution map: it builds it from the configuration and the template
variable registry. envsubst fails hard on an unknown variable, so
rendering cluster1, cluster2 and cluster-restore would have failed.

Read the skip flag and the registry pull secret from the configuration,
and register the template values through config.SetTemplateVariable, as
upgrade_test.go already does.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Francesco Canovai <[email protected]>
fcanovai added a commit that referenced this pull request Aug 27, 2026
…ration

tests/e2e/upgrade_plugin_barman_cloud_test.go was added to main by
"test(e2e): port upgrade tests to plugin-barman-cloud" (#11264) as a copy
of upgrade_test.go, after the suite had been moved onto the configuration
file. It therefore kept reading the process environment, which nothing
populates any more, with two consequences.

Its skip gate tested TEST_SKIP_UPGRADE, a variable the run-e2e scripts
stopped exporting once they started writing skipUpgradeSuite into the
configuration. The gate never fired, so this Ordered/Serial spec ran
during the main suite invocation, where the operator manifests it needs
are not generated.

Its SERVER_NAME, OBJECT_STORE_NAME and RECOVERY_* values were published
with os.Setenv, but GetYAMLContent no longer merges os.Environ() into the
substitution map: it builds it from the configuration and the template
variable registry. envsubst fails hard on an unknown variable, so
rendering cluster1, cluster2 and cluster-restore would have failed.

Read the skip flag and the registry pull secret from the configuration,
and register the template values through config.SetTemplateVariable, as
upgrade_test.go already does.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Francesco Canovai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases E2E tests E2E tests tickets for easy triage on release process lgtm This PR has been approved by a maintainer ok to merge 👌 This PR can be merged release-1.28 release-1.30 size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: E2E - port upgrade tests to plugin-barman-cloud

4 participants