Skip to content

Commit 344968e

Browse files
Merge pull request #350 from testcontainers/release/0.13
2 parents d02050c + 6fc4505 commit 344968e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3319
-1535
lines changed

.dprintrc.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://dprint.dev/schemas/v0.json",
3+
"projectType": "openSource",
4+
"incremental": true,
5+
"markdown": {
6+
},
7+
"rustfmt": {
8+
"merge_imports": true
9+
},
10+
"includes": ["**/*.{md,rs,toml}"],
11+
"excludes": [
12+
"**/target"
13+
],
14+
"plugins": [
15+
"https://plugins.dprint.dev/markdown-0.5.1.wasm",
16+
"https://plugins.dprint.dev/rustfmt-0.3.0.wasm",
17+
"https://github.com/thomaseizinger/dprint-plugin-cargo-toml/releases/download/0.1.0/cargo-toml-0.1.0.wasm"
18+
]
19+
}

.githooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22

3-
cargo fmt -- --check
3+
dprint check

.github/dependabot.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ updates:
44
directory: "/"
55
schedule:
66
interval: daily
7-
open-pull-requests-limit: 3
7+
open-pull-requests-limit: 20
88
rebase-strategy: disabled
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "daily"

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Continuous Integration
2+
on:
3+
pull_request:
4+
push:
5+
branches: [master, dev, trying, staging]
6+
jobs:
7+
msrv:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Get current MSRV from Cargo.toml
12+
id: current_msrv
13+
run: |
14+
msrv=$(cat Cargo.toml | grep rust-version | sed 's/.* = "//; s/"//')
15+
echo "::set-output name=msrv::$msrv"
16+
- uses: actions-rs/toolchain@v1
17+
id: toolchain
18+
with:
19+
profile: minimal
20+
toolchain: ${{steps.current_msrv.outputs.msrv}}
21+
override: true
22+
- uses: Swatinem/[email protected]
23+
- run: cargo build
24+
test:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v3
28+
- uses: actions-rs/toolchain@v1
29+
id: toolchain
30+
with:
31+
profile: minimal
32+
toolchain: stable
33+
override: true
34+
- uses: Swatinem/[email protected]
35+
- run: cargo test
36+
style:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v3
40+
- uses: dprint/[email protected]
41+
lint:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v3
45+
- uses: actions-rs/toolchain@v1
46+
id: toolchain
47+
with:
48+
profile: minimal
49+
toolchain: stable
50+
override: true
51+
components: clippy
52+
- uses: Swatinem/[email protected]
53+
- run: cargo clippy --all-targets -- -D warnings

.github/workflows/nightly.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Nightly
2+
on: push
3+
jobs:
4+
nightly-tests:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions-rs/toolchain@v1
9+
id: toolchain
10+
with:
11+
profile: minimal
12+
toolchain: nightly
13+
override: true
14+
- uses: Swatinem/[email protected]
15+
- run: cargo test
16+
nightly-lints:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: actions-rs/toolchain@v1
21+
id: toolchain
22+
with:
23+
profile: minimal
24+
toolchain: nightly
25+
override: true
26+
components: clippy
27+
- uses: Swatinem/[email protected]
28+
- run: cargo clippy --all-targets -- -D warnings

.github/workflows/publish-new-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout merge commit
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1818
with:
1919
ref: ${{ github.event.pull_request.merge_commit_sha }}
2020

@@ -65,7 +65,7 @@ jobs:
6565
echo "::set-output name=version::$VERSION"
6666
6767
- name: Create pull request for merging release-branch back into dev
68-
uses: thomaseizinger/create-pull-request@1.0.0
68+
uses: thomaseizinger/create-pull-request@1.2.2
6969
with:
7070
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7171
head: release/${{ steps.extract-version.outputs.version }}

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 85 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,77 +7,129 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.13.0] - 2022-04-04
11+
12+
### Added
13+
14+
- A new client implementation that talks to the Docker daemon via **HTTP**.
15+
This implementation is available as `testcontainers::clients::Http` and provides an **async** interface.
16+
As of now, this implementation is guarded behind the `experimental` feature-flag and not yet guaranteed to work flawlessly.
17+
- Allow using `podman` CLI in addition to `docker`
18+
- The `TESTCONTAINERS` environment variable to control what happens to containers and networks at the end of a test.
19+
The default value is `remove` which deletes all containers and networks that were used in the test.
20+
By setting the value to `keep`, containers and networks will not be deleted but kept **running**.
21+
You will have to **stop** and **delete** those yourself eventually.
22+
- Upgrade default bitcoin-core image version to 0.21.0. This allows us to remove `-debug` for bitcoind and replace it with
23+
`-startupnotify=echo ...`. More details on bitcoind 0.21.0 can be found [here](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.21.0.md).
24+
Note: This release also removed the default wallet.
25+
- `expose_port` functionality to `Image` trait.
26+
- `Google Cloud SDK` image
27+
- `RabbitMQ` image
28+
- `WaitFor::Healthcheck` container ready condition, which corresponds with the [healthcheck](https://docs.docker.com/engine/reference/builder/#healthcheck) status.
29+
- `MinIO` image
30+
31+
### Changed
32+
33+
- How images express when a container is ready: Instead of implementing `wait_until_ready`, images now need to implement `ready_conditions` which returns a list of `WaitFor` instances.
34+
- Return value of `get_host_port` from `Option<u16>` to `u16`.
35+
If the port cannot be resolved, this function will now **panic**.
36+
- MSRV bumped to 1.46.
37+
- Make `Docker` trait `pub(crate)`.
38+
This reduces the API surface of the crate which allows for fewer breaking changes in the future.
39+
All functionality from `Docker` (start, stop, rm, and ports) is available on a container directly.
40+
- `descriptor` is broken down into `name` and `tag` within `Image` trait.
41+
- Bump `MongoDB`-image default version to `5.0.6`.
42+
43+
### Removed
44+
45+
- `DYNAMODB_ADDITIONAL_SLEEP_PERIOD` variable from `dynamodb_local` image.
46+
Previously, we had a fallback of 2 seconds if this variable was not defined.
47+
We now wait for 2 seconds unconditionally after the specified message has been found.
48+
- Support for the `KEEP_CONTAINERS` env variable.
49+
The functionality of `KEEP_CONTAINERS=true` is superseded by `TESTCONTAINERS=keep`.
50+
- `with_entrypoint` from the `Image` trait.
51+
This functionality is not used within the library.
52+
Images that need this kind of customization can always implement it on their own type directly but there is no need to force it onto them.
53+
- `Image::EnvVars` and `Image::Volumes` associated types.
54+
The respective functions `Image::env_vars` and `Image::volumes` still exist but now return a trait object that must implement `Iterator<Item = (&String, &String)`.
55+
This allows us to provide a default implementation which reduces the boilerplate in defining new images.
56+
- `args` and `with_args` from `Image` trait.
57+
58+
### Fixed
59+
60+
- Removing a docker container did not error if failed. This was fixed by asserting the daemon's response instead of
61+
just the status code: If a docker container was removed correctly using `rm -f -v <ID>` <ID> is printed on stdout.
62+
<ID> can either be the container name or its ID which is used within testcontainer-rs.
63+
- Fixed clippy warnings of camel case names containing a capitalized acronym.
64+
1065
## [0.12.0] - 2021-01-27
1166

1267
### Added
1368

14-
- Allow custom version for postgres image
15-
- Remove `derivative` dependency
16-
- `OrientDB` image
17-
- `Zookeeper` image
69+
- Allow custom version for postgres image
70+
- Remove `derivative` dependency
71+
- `OrientDB` image
72+
- `Zookeeper` image
1873

1974
### Changed
2075

21-
- Move port mapping logic to `RunArgs` instead of each Image.
76+
- Move port mapping logic to `RunArgs` instead of each Image.
2277

2378
## [0.11.0] - 2020-09-30
2479

2580
### Added
2681

27-
- `Docker::run_with_args` method. This allows naming a container and assigning it to a specific docker network. The docker
28-
network will be created if it doesn't exist yet. Once the client is dropped, the network will be removed again if it
29-
has previously been created. A network that already existed will not be removed.
30-
- Address-type argument to `coblox/bitcoin-core` Image.
31-
We are setting `bech32` as a default here.
32-
This is different from the default of `bitcoind`.
82+
- `Docker::run_with_args` method. This allows naming a container and assigning it to a specific docker network. The docker
83+
network will be created if it doesn't exist yet. Once the client is dropped, the network will be removed again if it
84+
has previously been created. A network that already existed will not be removed.
85+
- Address-type argument to `coblox/bitcoin-core` Image.
86+
We are setting `bech32` as a default here.
87+
This is different from the default of `bitcoind`.
3388

3489
### Fixed
3590

36-
- Block the thread until containers have been successfully removed.
37-
Previously, this was done in a fire-and-forget way and hence led to containers not being removed in certain situations.
91+
- Block the thread until containers have been successfully removed.
92+
Previously, this was done in a fire-and-forget way and hence led to containers not being removed in certain situations.
3893

3994
### Changed
4095

41-
- MSRV is now 1.41.0
96+
- MSRV is now 1.41.0
4297

4398
## [0.10.0] - 2020-08-20
4499

45100
### Added
46101

47-
- Mongo image.
48-
- Support for the `fallbackfee` argument for the `bitcoin-core` image.
49-
- Ability to customize the `entrypoint` used by the image.
50-
- Ability to start a container once stopped.
51-
102+
- Mongo image.
103+
- Support for the `fallbackfee` argument for the `bitcoin-core` image.
104+
- Ability to customize the `entrypoint` used by the image.
105+
- Ability to start a container once stopped.
106+
52107
### Changed
53108

54-
- MSRV bumped to 1.36 from 1.32.
55-
- Change postgres image authentication POSTGRES_HOST_AUTH_METHOD rather than username and password.
56-
- Bumped bitcoin-core default tag to 0.20.0.
109+
- MSRV bumped to 1.36 from 1.32.
110+
- Change postgres image authentication POSTGRES_HOST_AUTH_METHOD rather than username and password.
111+
- Bumped bitcoin-core default tag to 0.20.0.
57112

58113
## [0.9.1] - 2020-03-24
59114

60115
### Added
61116

62-
- A changelog
63-
- Support volumes on containers
117+
- A changelog
118+
- Support volumes on containers
64119

65120
### Changed
66121

67-
- **Breaking**: `Container#get_host_port` now only accepts a `u16` instead of a `u32`.
68-
`u16` captures all possible port values.
122+
- **Breaking**: `Container#get_host_port` now only accepts a `u16` instead of a `u32`.
123+
`u16` captures all possible port values.
69124

70125
### Fixes
71126

72-
- Provide a default password for the postgres image.
73-
There seems to be an unfortunate breaking change in the postgres image that we need to cater for.
74-
75-
[Unreleased]: https://github.com/testcontainers/testcontainers-rs/compare/0.12.0...HEAD
127+
- Provide a default password for the postgres image.
128+
There seems to be an unfortunate breaking change in the postgres image that we need to cater for.
76129

130+
[Unreleased]: https://github.com/testcontainers/testcontainers-rs/compare/0.13.0...HEAD
131+
[0.13.0]: https://github.com/testcontainers/testcontainers-rs/compare/0.12.0...0.13.0
77132
[0.12.0]: https://github.com/testcontainers/testcontainers-rs/compare/0.11.0...0.12.0
78-
79133
[0.11.0]: https://github.com/testcontainers/testcontainers-rs/compare/0.10.0...0.11.0
80-
81134
[0.10.0]: https://github.com/testcontainers/testcontainers-rs/compare/0.9.1...0.10.0
82-
83135
[0.9.1]: https://github.com/testcontainers/testcontainers-rs/compare/0.8.1...0.9.1

CONTRIBUTING.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,25 @@ Please follow this convention while developing new images.
1212

1313
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
1414

15+
## Formatting
16+
17+
While developing, please make sure that your code is formatted using `dprint fmt`.
18+
You can install `dprint` in various ways: https://dprint.dev/install/
19+
20+
## Commits
21+
22+
Strive for creating atomic commits.
23+
That is, commits should capture a single feature, including its tests.
24+
Ideally, each commits passes all CI checks (builds, tests, formatting, linter, ...).
25+
26+
When in doubt, squashing everything into a single but larger commit is preferable over commits that don't compile or are otherwise incomplete.
27+
28+
For writing good commit messages, you may find [this](https://chris.beams.io/posts/git-commit/) guide helpful.
29+
1530
## Git hooks
1631

17-
While developing, please make sure that your code is formatted using `cargo-fmt`.
18-
You can easily do that by using the pre-defined `git` hooks:
32+
To ensure every commit is properly formatted, you can opt into pre-defined `git` hooks:
33+
1934
```bash
2035
git config core.hookspath .githooks
2136
```

0 commit comments

Comments
 (0)