Skip to content

Conversation

BON4
Copy link
Contributor

@BON4 BON4 commented May 4, 2024

Issue #468

This pull request is based on the same PR but for VM postgresql-operator

All this cases should be covered:

  • Test Application. VM resources is removed after application removal. Install app, remove app (removal test), check no garbage left.
  • Test Unit. Re-Installation. Remove unit with --force --no-wait, storage should be detached.
  • Test Unit. Garbage ignorance. Charm should deploy in dirty environment with garbage storage.
  • Test Application. Application should deploy in dirty environment with garbage storage from another application.

marceloneppel and others added 30 commits March 11, 2023 00:15
* Mark unstable tests

* Reorganize TLS test to use unstable mark

* Mark test_redeploy_charm_same_model as unstable
* Fix duplicate K8S service ports names

* Fix expected resources list
* Update postgresql_provider.py

* fix linting

---------

Co-authored-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
… backup (canonical#114)

* Initial code for backing up on replicas

* Add initial TLS settings on primary

* Adjust pgBackRest configuration to use standbys

* Implement working TLS server

* Fix TLS errors

* Fix stanza retrieval, restore test and unit test

* Enable Mattermost test

* Fix backup settings check

* Revert S3 settings

* Add TLS check

* Reorganize TLS server logic

* Fix multiple primaries situation

* Remove log calls

* Turn off connectivity only on replicas

* Use planned units when checking whether there are replicas

* Revert last change

* Improve TLS flag documentation

* Improve logic that controls backups on standbys
…es (canonical#115)

* Add Tutorial and Landing page and update README and CONTRIBUTING guides
* Add renovate.json

* Team config

* Regex tweaks

* Pin exact versions

* Scaledown includes

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dragomir Penev <dragomir.penev@canonical.com>
* Add On S3 Credentials Changed Hook diagram

* Add On Restore Hook diagram

* Add On List Backups Hook diagram

* Add On Create Backup Hook diagram

* Add note about restore status

* Add note about TLS settings change
---------

Co-authored-by: Alex Lutay <1928266+taurus-forever@users.noreply.github.com>
* Update Python dependencies

* Add cryptography build dependency

* Holding rfc3986

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dragomir Penev <dragomir.penev@canonical.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Update Python dependencies

* Holding httpcore

* Enforcing httpx versions instead of ignoring pinned deps

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dragomir Penev <dragomir.penev@canonical.com>
* Initial switch

* Use stable tls-certificates-operator

* Temporarily manually installing ca-certs

* Revert "Temporarily manually installing ca-certs"

This reverts commit 2fd47db.

* Read version from the Rock image

* Switch to GHCR Rock
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
https://warthogs.atlassian.net/browse/DPE-1456

---------

Co-authored-by: Dragomir Penev <dragomir.penev@canonical.com>
* Update Python dependencies

* Update httpx dep checks

* Update lock and requirements

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dragomir Penev <dragomir.penev@canonical.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…l#142)

As discussed, let's keep README as small as possible and
use Discourse for detailed manuals.
…rash tests (canonical#136)

* Enable sync mode

* Remove custom conf

* Add new expected k8s endpoint to helper function

* Fix TLS test

* Add pebble health check

* Fix freeze db test

* Enable restart db test

* Remove commented code

* Fix unit tests

* Add missing tests

* Improve TLS management

* Add health check update

* Remove health check

* Add health check

* Prevent multiple primaries

* Remove unused code

* Check max number written

* Check writes on all instances

* Remove master_start_timeout setting

* Improve logs retrieval

* Add CA chain to trusted certificates

* Revert "Remove master_start_timeout setting"

This reverts commit 84d810d.

* Use the right PG process in the HA tests

* Fix order in test

* Remove unused call to SIGCONT

* Enable restart DB test

* Add initial full cluster crash test

* Add remaining cluster restart and crash tests

* Kill right process

* Create helper function for duplicate code

* Add telemetry step

* Increase replan timeout

* Stabilize tests

* Change tester application connection

* Add timeout to the database operations

* Remove telemetry step

* Add prints

* Add back the last written value file

* Pin packaging version

* Fix PostgreSQL DB process full cluster restart/crash

* Fix helper for freeze DB process test

* Add sleep

* Reduce extended pebble restart delay

* Remove prints

* Remove sleep

* Fix poetry lock

* Separate signal logic

* Improve loop wait setting change

* Change calls order

* Improve description about timeout

* Rename boolean functions according the best practices

---------

Co-authored-by: Dragomir Penev <dragomir.penev@canonical.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Enable sync mode

* Remove custom conf

* Add new expected k8s endpoint to helper function

* Fix TLS test

* Add pebble health check

* Fix freeze db test

* Enable restart db test

* Remove commented code

* Fix unit tests

* Add missing tests

* Add helpers

* Improve TLS management

* Add health check update

* Remove health check

* Add health check

* Prevent multiple primaries

* Remove unused code

* Add network cut test

* Add initial test structure

* Update test steps

* Fix test to make it work

* Remove unused code

* Uncomment code

* Remove unused code

* Add checks for member isolation

* Improve description about timeout

* Simplify shell scripts

* Fix chaos mesh scripts

---------

Co-authored-by: Dragomir Penev <dragomir.penev@canonical.com>
marceloneppel and others added 21 commits April 4, 2024 08:33
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…cal#435)

* Add primary status message after cluster bootstrap

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Add and update unit tests

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Remove _set_primary_status_message method

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

---------

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…-trust` flag (canonical#440)

* improve error message for trust flag

* fix message text

* fix docstring

* fix explanation

* add integration test for new trust behavior

* test different app name for deploy

* fix bug

* enable rbac from inside test

* fix typo

* use sudo with microk8s enable

* remove check true

* fix linting

* test subprocess call

* remove fast-forward

* test connectivity and enable rbac

* fix integration test + update endpoints

* revert poetry lock change

* reposition endpoint update in event

* reposition cleanup resource call
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
… secrets in every test (canonical#452)

* convert all tests to pytest

* remove secret remove hook

* Revert "remove secret remove hook"
* Update Rock

* Renovate tweaks

* Slower ffwd

* Check only for blocked status

* Update agents

* Port can_connect from VM

* Check update_config result

* Still handle psycopg2 exceptions

* Wrong check

* Check all units

* Restart connection check

* Lock file maintenance Python dependencies

* Don't release retart hook until PG is back up

* Increase restart need atempts

* New rock

* Check PG is up

* Revert tweaks

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…o 16 (canonical#454)

* update libs

* fix unit tests

* add peer check

* adapt src code and unit tests

* separate tests in 2 versions

* review suggestions

* add new review suggestions
* Rerender and reenable pgbackrest config and service

* Charm lib bump

* Delete pod test

* Add logs

* Don't log config file
* Add async replication implementation

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Backup standby pgdata folder

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Improve comments and logs

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Remove unused constant

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Remove warning log call and add optional type hint

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Revert poetry.lock

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

* Revert poetry.lock

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>

---------

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@BON4 BON4 marked this pull request as ready for review May 15, 2024 21:34
@BON4 BON4 closed this May 20, 2024
@BON4 BON4 force-pushed the test-charmed-postgresql-k8s-smoke-test branch from 9146fd1 to f7d7ee2 Compare May 20, 2024 17:08
@BON4 BON4 deleted the test-charmed-postgresql-k8s-smoke-test branch May 20, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.