Files
library-charts/library/common-test/tests/cnpg/stop_test.yaml
Stavros kois 3816df365a fix stop test
2024-03-10 14:33:59 +02:00

200 lines
4.9 KiB
YAML

suite: cnpg stop test
templates:
- common.yaml
release:
name: test-release-name
namespace: test-release-namespace
tests:
- it: should pass with hibernate
set:
cnpg:
mypg:
enabled: true
user: app
database: app
instances: 2
hibernate: true
pooler:
enabled: true
asserts:
- documentIndex: &clusterDoc 1
isKind:
of: Cluster
- documentIndex: *clusterDoc
isAPIVersion:
of: postgresql.cnpg.io/v1
- documentIndex: *clusterDoc
isSubset:
path: metadata.annotations
content:
cnpg.io/hibernation: "on"
- documentIndex: &poolerDoc 0
isKind:
of: Pooler
- documentIndex: *poolerDoc
isAPIVersion:
of: postgresql.cnpg.io/v1
- documentIndex: *poolerDoc
isSubset:
path: spec
content:
instances: 0
- it: should set hibernate and 0 instances on stopAll
set:
global:
stopAll: true
cnpg:
mypg:
enabled: true
user: app
database: app
hibernate: false
instances: 2
pooler:
enabled: true
asserts:
- documentIndex: *clusterDoc
isKind:
of: Cluster
- documentIndex: *clusterDoc
isAPIVersion:
of: postgresql.cnpg.io/v1
- documentIndex: *clusterDoc
isSubset:
path: metadata.annotations
content:
cnpg.io/hibernation: "on"
- documentIndex: *poolerDoc
isKind:
of: Pooler
- documentIndex: *poolerDoc
isAPIVersion:
of: postgresql.cnpg.io/v1
- documentIndex: *poolerDoc
isSubset:
path: spec
content:
instances: 0
- it: should set hibernate and 0 instances on ixChartContext - isStopped (true)
set:
global:
namespace: ix-something
ixChartContext:
storageClassName: some-storage-class
isStopped: true
cnpg:
mypg:
enabled: true
user: app
database: app
hibernate: false
instances: 2
pooler:
enabled: true
asserts:
- documentIndex: *clusterDoc
isKind:
of: Cluster
- documentIndex: *clusterDoc
isAPIVersion:
of: postgresql.cnpg.io/v1
- documentIndex: *clusterDoc
isSubset:
path: metadata.annotations
content:
cnpg.io/hibernation: "on"
- documentIndex: *poolerDoc
isKind:
of: Pooler
- documentIndex: *poolerDoc
isAPIVersion:
of: postgresql.cnpg.io/v1
- documentIndex: *poolerDoc
isSubset:
path: spec
content:
instances: 0
- it: should not set hibernate and 0 instances on ixChartContext - isStopped (false)
set:
global:
namespace: ix-something
ixChartContext:
storageClassName: some-storage-class
isStopped: false
cnpg:
mypg:
enabled: true
user: app
database: app
hibernate: false
instances: 2
pooler:
enabled: true
asserts:
- documentIndex: &clusterDoc 1
isKind:
of: Cluster
- documentIndex: *clusterDoc
isAPIVersion:
of: postgresql.cnpg.io/v1
- documentIndex: *clusterDoc
isSubset:
path: metadata.annotations
content:
cnpg.io/hibernation: "off"
- documentIndex: &poolerDoc 0
isKind:
of: Pooler
- documentIndex: *poolerDoc
isAPIVersion:
of: postgresql.cnpg.io/v1
- documentIndex: *poolerDoc
isSubset:
path: spec
content:
instances: 2
- it: should not set hibernate and 0 instances on ixChartContext - isStopped (true) and ignoreIsStopped (true)
set:
global:
namespace: ix-something
ignoreIsStopped: true
ixChartContext:
storageClassName: some-storage-class
isStopped: true
cnpg:
mypg:
enabled: true
user: app
database: app
hibernate: false
instances: 2
pooler:
enabled: true
asserts:
- documentIndex: &clusterDoc 1
isKind:
of: Cluster
- documentIndex: *clusterDoc
isAPIVersion:
of: postgresql.cnpg.io/v1
- documentIndex: *clusterDoc
isSubset:
path: metadata.annotations
content:
cnpg.io/hibernation: "off"
- documentIndex: &poolerDoc 0
isKind:
of: Pooler
- documentIndex: *poolerDoc
isAPIVersion:
of: postgresql.cnpg.io/v1
- documentIndex: *poolerDoc
isSubset:
path: spec
content:
instances: 2