Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup default image when cleaning up containers #918

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions postgres-appliance/tests/README

This file was deleted.

21 changes: 21 additions & 0 deletions postgres-appliance/tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Run tests

After building the image, you can test your image by:

1. Setting up the environment variable `SPILO_TEST_IMAGE` to test the specific image. If unset, the default will be `spilo`.
```
export SPILO_TEST_IMAGE=<your_spilo_image>
```
2. Run the test:
```
bash test_spilo.sh
```
To enable debugging for an entire script when it runs:
```
bash -x test_spilo.sh
```

The test will create multiple containers. They will be cleaned up by the last line before running `main` in `test_spilo.sh`. To keep and debug the containers after running the test, this part can be commented.
```
trap cleanup QUIT TERM EXIT
```
2 changes: 1 addition & 1 deletion postgres-appliance/tests/test_spilo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ readonly TIMEOUT=120

function cleanup() {
stop_containers
docker ps -q --filter="ancestor=${SPILO_TEST_IMAGE}" --filter="name=${PREFIX}" | xargs docker rm -f
docker ps -q --filter="ancestor=${SPILO_TEST_IMAGE:-spilo}" --filter="name=${PREFIX}" | xargs docker rm -f
}

function get_non_leader() {
Expand Down