Skip to content

Commit 013e20e

Browse files
NiccoloFeiarmru
andauthored
test: adjust E2E tests to run with minimal images (cloudnative-pg#7655)
Minor adjustments to a few E2E tests to be able to run the testing suite using a -minimal image, specifically: - Avoid referencing locales that are not available in minimal images - Label Replica Cluster E2Es which require bootstrapping from a backup with LabelBackupRestore. This is useful because it allows running E2Es excluding all the tests that require backup/recovery capabilities, given that -minimal images do not contain Barman cloud. They can be skipped by setting FEATURE_TYPE=!backup-restore Closes cloudnative-pg#7654 Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
1 parent 447a079 commit 013e20e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

tests/e2e/fixtures/declarative_databases/database.yaml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
spec:
66
name: declarative
77
owner: app
8-
localeCType: "en_US.utf8"
8+
localeCType: C
99
localeCollate: C
1010
encoding: SQL_ASCII
1111
template: template0

tests/e2e/fixtures/initdb/cluster-custom-locale.yaml.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ spec:
2525
owner: app
2626
options:
2727
- "--locale"
28-
- "en_US.utf8"
28+
- "C"
2929

3030
# Persistent storage configuration
3131
storage:

tests/e2e/initdb_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ var _ = Describe("InitDB settings", Label(tests.LabelSmoke, tests.LabelBasic), f
176176
}, "postgres",
177177
"select datcollate from pg_catalog.pg_database where datname='template0'")
178178
Expect(err).ToNot(HaveOccurred())
179-
Expect(stdout, err).To(Equal("en_US.utf8\n"))
179+
Expect(strings.TrimSpace(stdout), err).To(Equal("C"))
180180
})
181181
})
182182
})

tests/e2e/replica_mode_cluster_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ var _ = Describe("Replica Mode", Label(tests.LabelReplication), func() {
269269
})
270270
})
271271

272-
Context("archive mode set to 'always' on designated primary", func() {
272+
Context("archive mode set to 'always' on designated primary", Label(tests.LabelBackupRestore), func() {
273273
It("verifies replica cluster can archive WALs from the designated primary", func() {
274274
const (
275275
replicaClusterSample = fixturesDir + replicaModeClusterDir + "cluster-replica-archive-mode-always.yaml.template"
@@ -340,7 +340,7 @@ var _ = Describe("Replica Mode", Label(tests.LabelReplication), func() {
340340
})
341341
})
342342

343-
Context("can bootstrap a replica cluster from a backup", Ordered, func() {
343+
Context("can bootstrap a replica cluster from a backup", Label(tests.LabelBackupRestore), Ordered, func() {
344344
const (
345345
clusterSample = fixturesDir + replicaModeClusterDir + "cluster-replica-src-with-backup.yaml.template"
346346
namespacePrefix = "replica-cluster-from-backup"
@@ -492,7 +492,7 @@ var _ = Describe("Replica Mode", Label(tests.LabelReplication), func() {
492492

493493
// In this test we create a replica cluster from a backup and then promote it to a primary.
494494
// We expect the original primary to be demoted to a replica and be able to follow the new primary.
495-
var _ = Describe("Replica switchover", Label(tests.LabelReplication), Ordered, func() {
495+
var _ = Describe("Replica switchover", Label(tests.LabelReplication, tests.LabelBackupRestore), Ordered, func() {
496496
const (
497497
replicaSwitchoverClusterDir = "/replica_mode_cluster/"
498498
namespacePrefix = "replica-switchover"

0 commit comments

Comments
 (0)