**Description** <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> https://github.com/tensorchord/cloudnative-pgvecto.rs Is depricated and VectorChord serves as the successor to [pgvecto.rs](https://github.com/tensorchord/pgvecto.rs) with better stability and performance. https://github.com/tensorchord/cloudnative-vectorchord Also needed when you want to use for example immich with this database extension type. ⚒️ Fixes # <!--(issue)--> **⚙️ Type of change** - [x] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code - [ ] 📜 Documentation Changes **🧪 How Has This Been Tested?** <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> Added the tests in the common. **📃 Notes:** <!-- Please enter any other relevant information here --> **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [x] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made changes to the documentation - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning - [x] I made sure the title starts with `feat(chart-name):`, `fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or `fix(docs):` **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._
299 lines
8.1 KiB
YAML
299 lines
8.1 KiB
YAML
suite: cnpg cluster validation test
|
|
templates:
|
|
- common.yaml
|
|
release:
|
|
name: test-release-name
|
|
namespace: test-release-namespace
|
|
tests:
|
|
- it: should fail without user
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
database: test-db
|
|
password: test-password
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG - Expected a non-empty [user] key
|
|
|
|
- it: should fail without database
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
password: test-password
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG - Expected a non-empty [database] key
|
|
|
|
- it: should fail without password
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG - Expected a non-empty [password] key
|
|
|
|
- it: should fail with invalid pgVersion
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
pgVersion: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG - Expected [pgVersion] to be one of [15, 16], but got [invalid]
|
|
|
|
- it: should fail with hibernate not a bool
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
hibernate: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG - Expected [hibernate] to be a boolean, but got [string]
|
|
|
|
- it: should fail with invalid mode
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
mode: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Cluster - Expected [mode] to be one of [standalone, replica, recovery], but got [invalid]
|
|
|
|
- it: should fail with invalid type
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
type: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Cluster - Expected [type] to be one of [postgres, postgis, timescaledb, vectors, vectorchord], but got [invalid]
|
|
|
|
- it: should fail with invalid log level
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
cluster:
|
|
logLevel: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Cluster - Expected [cluster.logLevel] to be one of [error, warning, info, debug, trace], but got [invalid]
|
|
|
|
- it: should fail with invalid primaryUpdateStrategy
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
cluster:
|
|
primaryUpdateStrategy: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Cluster - Expected [cluster.primaryUpdateStrategy] to be one of [supervised, unsupervised], but got [invalid]
|
|
|
|
- it: should fail with invalid primaryUpdateMethod
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
cluster:
|
|
primaryUpdateMethod: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Cluster - Expected [cluster.primaryUpdateMethod] to be one of [switchover, restart], but got [invalid]
|
|
|
|
- it: should fail with invalid walSegmentSize
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
cluster:
|
|
initdb:
|
|
walSegmentSize: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Cluster - Expected [cluster.initdb.walSegmentSize] to be an integer, but got [string]
|
|
|
|
- it: should fail with too large walSegmentSize
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
cluster:
|
|
initdb:
|
|
walSegmentSize: 1025
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Cluster - Expected [cluster.initdb.walSegmentSize] to be between 1 and 1024, but got [1025]
|
|
|
|
- it: should fail without recovery object when mode is recovery
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
mode: recovery
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Recovery - Expected a non-empty [recovery] key
|
|
|
|
- it: should fail with revision in recovery not a string
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
mode: recovery
|
|
recovery:
|
|
method: backup
|
|
backupName: some-backup-name
|
|
revision: 5
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Recovery - Expected [recovery.revision] to be a string, got [float64]
|
|
|
|
- it: should fail with invalid recovery method
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
mode: recovery
|
|
recovery:
|
|
method: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Recovery - Expected [recovery.method] to be one of [backup, object_store, pg_basebackup], but got [invalid]
|
|
|
|
- it: should fail without backupName on recovery method backup
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
mode: recovery
|
|
recovery:
|
|
method: backup
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Recovery - Expected a non-empty [recovery.backupName] key
|
|
|
|
- it: should fail with revision in backups not a string
|
|
set:
|
|
credentials:
|
|
test: &test
|
|
type: s3
|
|
accessKey: some-access-key
|
|
secretKey: some-secret-key
|
|
bucket: some-bucket
|
|
url: http://some-url
|
|
encrKey: some-encr-key
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
backups:
|
|
enabled: true
|
|
credentials: test
|
|
revision: 5
|
|
target: primary
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Backup - Expected [backups.revision] to be a string, got [float64]
|
|
|
|
- it: should fail with invalid target when backups are enabled
|
|
set:
|
|
credentials:
|
|
test: *test
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
backups:
|
|
enabled: true
|
|
credentials: test
|
|
target: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Backup - Expected [backups.target] to be one of [primary, prefer-standby], but got [invalid]
|
|
|
|
- it: should fail with invalid retentionPolicy when backups are enabled
|
|
set:
|
|
credentials:
|
|
test: *test
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
backups:
|
|
enabled: true
|
|
credentials: test
|
|
target: primary
|
|
retentionPolicy: invalid
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG Backup - Expected [backups.retentionPolicy] to match regex [^[1-9][0-9]*[dwm]$], got [invalid]
|
|
|
|
- it: should fail with instances less than 1
|
|
set:
|
|
cnpg:
|
|
my-pg:
|
|
enabled: true
|
|
instances: 0
|
|
user: test-user
|
|
database: test-db
|
|
password: test-password
|
|
asserts:
|
|
- failedTemplate:
|
|
errorMessage: CNPG - Expected [instances] to be greater than 0, but got [0]
|