docker-volume-backup/test
dependabot[bot] 94e59a102e
Bump github.com/Azure/azure-sdk-for-go/sdk/storage/azblob from 1.4.1 to 1.5.0 (#495)
* Bump github.com/Azure/azure-sdk-for-go/sdk/storage/azblob

Bumps [github.com/Azure/azure-sdk-for-go/sdk/storage/azblob](https://github.com/Azure/azure-sdk-for-go) from 1.4.1 to 1.5.0.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/storage/azblob/v1.4.1...sdk/azcore/v1.5.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/storage/azblob
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update azurite image to match updated client capabilities

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Frederik Ring <frederik.ring@gmail.com>
2024-11-19 13:27:36 +01:00
..
age-passphrase feat: allow backups to be encrypted with age (#432) 2024-08-19 22:49:49 +02:00
age-publickey feat: allow backups to be encrypted with age (#432) 2024-08-19 22:49:49 +02:00
azure Bump github.com/Azure/azure-sdk-for-go/sdk/storage/azblob from 1.4.1 to 1.5.0 (#495) 2024-11-19 13:27:36 +01:00
certs version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
cli Exclude specific backends from pruning (#262) 2023-08-27 19:19:11 +02:00
collision version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
commands version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
confd version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
dropbox version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
extend version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
gpg version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
gpg-asym Feature: PGP Asymmetric Encryption (#456) 2024-08-11 10:11:23 +02:00
ignore version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
local version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
lock version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
nonroot version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
notifications version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
ownership version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
pgzip Replace Gzip with PGzip (#266) 2023-09-03 16:49:52 +02:00
proxy version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
pruning version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
s3 version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
secrets version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
services version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
ssh version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
swarm version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
tar Add "none" compression type (#457) 2024-08-11 10:11:09 +02:00
user version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
webdav version key in compose file is deprecated (#445) 2024-07-23 20:47:45 +02:00
zstd Run tests Docker in Docker (#261) 2023-09-02 15:17:46 +02:00
Dockerfile feat: allow backups to be encrypted with age (#432) 2024-08-19 22:49:49 +02:00
README.md Run tests Docker in Docker (#261) 2023-09-02 15:17:46 +02:00
test.sh Guard DinD docker info call with timeout (#315) 2023-12-12 20:28:13 +01:00
util.sh Allow backup to be run as non-root user 2024-02-22 17:42:53 +01:00

Integration Tests

Running tests

The main entry point for running tests is the ./test.sh script. It can be used to run the entire test suite, or just a single test case.

Run all tests

./test.sh

Run a single test case

./test.sh <directory-name>

Configuring a test run

In addition to the match pattern, which can be given as the first positional argument, certain behavior can be changed by setting environment variables:

BUILD_IMAGE

When set, the test script will build an up-to-date docker-volume-backup image from the current state of your source tree, and run the tests against it.

BUILD_IMAGE=1 ./test.sh

The default behavior is not to build an image, and instead look for a version on your host system.

IMAGE_TAG

Setting this value lets you run tests against different existing images, so you can compare behavior:

IMAGE_TAG=v2.30.0 ./test.sh

NO_IMAGE_CACHE

When set, images from remote registries will not be cached and shared between sandbox containers.

NO_IMAGE_CACHE=1 ./test.sh

By default, two local images are created that persist the image data and provide it to containers at runtime.

Understanding the test setup

The test setup runs each test case in an isolated Docker container, which itself is running an otherwise unused Docker daemon. This means, tests can rely on noone else using that daemon, making expectations about the number of running containers and so forth. As the sandbox container is also expected to be torn down post test, the scripts do not need to do any clean up or similar.

Anatomy of a test case

The test.sh script looks for an exectuable file called run.sh in each directory. When found, it is executed and signals success by returning a 0 exit code. Any other exit code is considered a failure and will halt execution of further tests.

There is an util.sh file containing a few commonly used helpers which can be used by putting the following prelude to a new test case:

cd "$(dirname "$0")"
. ../util.sh
current_test=$(basename $(pwd))