Skip to content

Commit 42b9165

Browse files
authored
Merge branch 'main' into fix/wait-for-log-consumers
2 parents 9b4eea2 + 1aefb1c commit 42b9165

Some content is hidden

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

88 files changed

+6877
-751
lines changed

.cargo/audit.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[advisories]
2+
ignore = [
3+
# This advisory comes from `russh -> rsa` which is optional dependency
4+
"RUSTSEC-2023-0071",
5+
]
6+
7+
[output]
8+
deny = ["warnings"]
9+
quiet = false

.github/workflows/audit.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Security audit
2+
on:
3+
workflow_dispatch:
4+
push:
5+
paths:
6+
- '**/Cargo.toml'
7+
- '**/Cargo.lock'
8+
jobs:
9+
security_audit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Generate Cargo.lock if doesn't exist
14+
run: |
15+
if [ ! -f Cargo.lock ]; then
16+
cargo generate-lockfile
17+
fi
18+
- uses: rustsec/[email protected]
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
merge_group:
66
push:
7-
branches: [ main ]
7+
branches: [main]
88

99
concurrency:
1010
group: ${{ github.ref }}
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout sources
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v5
2020
- uses: Swatinem/rust-cache@v2
2121
- name: Get current MSRV from Cargo.toml
2222
id: current_msrv
@@ -32,7 +32,7 @@ jobs:
3232
with:
3333
tool: cargo-hack
3434
- name: Build
35-
run: cargo hack build --each-feature --keep-going
35+
run: cargo hack build --feature-powerset --depth 2 --clean-per-run
3636

3737
test:
3838
name: Test
@@ -43,9 +43,14 @@ jobs:
4343
toolchain:
4444
- stable
4545
- nightly
46+
partition:
47+
- 1/4
48+
- 2/4
49+
- 3/4
50+
- 4/4
4651
steps:
4752
- name: Checkout sources
48-
uses: actions/checkout@v4
53+
uses: actions/checkout@v5
4954
- uses: Swatinem/rust-cache@v2
5055
- name: Setup Rust
5156
uses: dtolnay/rust-toolchain@master
@@ -62,14 +67,14 @@ jobs:
6267
with:
6368
tool: cargo-hack
6469
- name: Tests
65-
run: cargo hack test --each-feature --clean-per-run
70+
run: cargo hack test --feature-powerset --depth 2 --clean-per-run --partition ${{ matrix.partition }}
6671

6772
fmt:
6873
name: Rustfmt check
6974
runs-on: ubuntu-latest
7075
steps:
7176
- name: Checkout sources
72-
uses: actions/checkout@v4
77+
uses: actions/checkout@v5
7378
- uses: Swatinem/rust-cache@v2
7479
- uses: actions-rs/toolchain@v1
7580
with:
@@ -94,7 +99,7 @@ jobs:
9499
- nightly
95100
steps:
96101
- name: Checkout sources
97-
uses: actions/checkout@v4
102+
uses: actions/checkout@v5
98103
- uses: Swatinem/rust-cache@v2
99104
- name: Setup Rust
100105
uses: dtolnay/rust-toolchain@master
@@ -112,7 +117,7 @@ jobs:
112117
runs-on: ubuntu-latest
113118
if: github.event_name == 'pull_request'
114119
steps:
115-
- uses: actions/checkout@v4
120+
- uses: actions/checkout@v5
116121
with:
117122
fetch-depth: 0
118123
- uses: CondeNast/[email protected]

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout repository
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v5
1818
with:
1919
fetch-depth: 0
2020
- name: Install Rust toolchain

CHANGELOG.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,117 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.25.2] - 2025-10-27
6+
### Details
7+
#### Features
8+
- Platform config passing through ImageExt trait ([#838](https://github.com/testcontainers/testcontainers-rs/pull/838))
9+
10+
#### Miscellaneous Tasks
11+
- Remove usage of reqwest hickory dns feature ([#860](https://github.com/testcontainers/testcontainers-rs/pull/860))
12+
- Drop weak dependencies due to cargo bug ([#862](https://github.com/testcontainers/testcontainers-rs/pull/862))
13+
14+
## [0.25.1] - 2025-10-27
15+
### Details
16+
#### Bug Fixes
17+
- Replace tokio-tar with astral-tokio-tar ([#852](https://github.com/testcontainers/testcontainers-rs/pull/852))
18+
19+
#### Documentation
20+
- Rustdoc for builder API ([#820](https://github.com/testcontainers/testcontainers-rs/pull/820))
21+
22+
#### Features
23+
- Use DOCKER_DEFAULT_PLATFORM env var to specify platform ([#800](https://github.com/testcontainers/testcontainers-rs/pull/800))
24+
- Fallback to platform linux/amd64 when image pull fails ([#837](https://github.com/testcontainers/testcontainers-rs/pull/837))
25+
- Add support for devices request ([#832](https://github.com/testcontainers/testcontainers-rs/pull/832))
26+
- Add configurable tmpfs mount sizes ([#853](https://github.com/testcontainers/testcontainers-rs/pull/853))
27+
- Support `http_wait` functionallity without tls dependencies ([#850](https://github.com/testcontainers/testcontainers-rs/pull/850))
28+
- Add container hostname support ([#848](https://github.com/testcontainers/testcontainers-rs/pull/848))
29+
- Expose host ports between host and containers via ssh sidecar ([#846](https://github.com/testcontainers/testcontainers-rs/pull/846))
30+
31+
#### Miscellaneous Tasks
32+
- Update bollard-stubs requirement from =1.48.3-rc.28.0.4 to =1.49.0-rc.28.3.3 ([#828](https://github.com/testcontainers/testcontainers-rs/pull/828))
33+
34+
#### Refactor
35+
- Remove bollard_stubs dependency as bollard re-exports it ([#844](https://github.com/testcontainers/testcontainers-rs/pull/844))
36+
37+
#### Testing
38+
- Avoid flakiness in `platform` test
39+
- Switch to testcontainers/helloworld and reduce some flakiness ([#855](https://github.com/testcontainers/testcontainers-rs/pull/855))
40+
41+
## [0.25.0] - 2025-07-27
42+
### Details
43+
#### Bug Fixes
44+
- Make tls features optional ([#806](https://github.com/testcontainers/testcontainers-rs/pull/806))
45+
- Add `Send` trait to `stderr` & `stdout` of `ExecResult` ([#809](https://github.com/testcontainers/testcontainers-rs/pull/809))
46+
- Added new parse rule for correctly parsing ports without protocol specifier ([#812](https://github.com/testcontainers/testcontainers-rs/pull/812))
47+
48+
#### Features
49+
- Allow ready conditions customization via ImageExt ([#794](https://github.com/testcontainers/testcontainers-rs/pull/794))
50+
- Allow to wait for log line on either stdout or stderr ([#795](https://github.com/testcontainers/testcontainers-rs/pull/795))
51+
- Add `Container*::exit_code` ([#791](https://github.com/testcontainers/testcontainers-rs/pull/791))
52+
- Add `Container*::is_running` ([#790](https://github.com/testcontainers/testcontainers-rs/pull/790))
53+
- Add custom health check support for containers ([#816](https://github.com/testcontainers/testcontainers-rs/pull/816))
54+
- Introduce container builder api ([#801](https://github.com/testcontainers/testcontainers-rs/pull/801))
55+
56+
#### Miscellaneous Tasks
57+
- [] Update bollard to 1.19.1 ([#817](https://github.com/testcontainers/testcontainers-rs/pull/817))
58+
59+
#### Refactor
60+
- Testimages and tests to use builder API ([#804](https://github.com/testcontainers/testcontainers-rs/pull/804))
61+
## [0.24.0] - 2025-05-04
62+
### Details
63+
#### Features
64+
- Support waiting for commands exit regardless of exit code (#771)
65+
- Add user configuration for container commands (#784)
66+
- Add option to stop containers with a timeout (#779)
67+
- Support `pause` and `unpause` container (#785)
68+
- Allow `security_opt` and `readonly_rootfs` to be configured (#787)
69+
70+
#### Miscellaneous Tasks
71+
- Update etcetera requirement from 0.8.0 to 0.9.0 (#773)
72+
- Update etcetera requirement from 0.9.0 to 0.10.0 (#775)
73+
## [0.23.3] - 2025-02-19
74+
### Details
75+
#### Bug Fixes
76+
- Proper handling of possible stdin in logs stream (#769)
77+
78+
#### Features
79+
- Re-export bollard
80+
## [0.23.2] - 2025-02-06
81+
### Details
82+
#### Documentation
83+
- Add examples of `ImageExt` usage and cover `GenericImage` (#747)
84+
85+
#### Features
86+
- Add `cap_add` and `cap_drop` support (#726)
87+
- Add support for user-configured labels (#756)
88+
- Reusable containers (#757)
89+
- Add image hook to run commands before ready (#766)
90+
91+
#### Miscellaneous Tasks
92+
- Update thiserror requirement from 1.0.60 to 2.0.3 (#754)
93+
- Bump the bollard dep to latest (#759)
94+
95+
#### Testing
96+
- Deflake the test `start_containers_in_parallel` (#748)
97+
## [0.23.1] - 2024-09-26
98+
### Details
99+
#### Features
100+
- Expose configured bollard client ([#740](https://github.com/testcontainers/testcontainers-rs/pull/740))
101+
## [0.23.0] - 2024-09-25
102+
### Details
103+
#### Bug Fixes
104+
- Expose public `copy` types ([#734](https://github.com/testcontainers/testcontainers-rs/pull/734))
105+
- Typo in an error variant ([#738](https://github.com/testcontainers/testcontainers-rs/pull/738))
106+
107+
#### Features
108+
- Support copy files to container ([#730](https://github.com/testcontainers/testcontainers-rs/pull/730))
109+
- Support copying directories to container ([#735](https://github.com/testcontainers/testcontainers-rs/pull/735))
110+
111+
#### Miscellaneous Tasks
112+
- Copy-to-container interface improvements ([#732](https://github.com/testcontainers/testcontainers-rs/pull/732))
113+
114+
#### Refactor
115+
- Replace dirs crate with etcetera ([#736](https://github.com/testcontainers/testcontainers-rs/pull/736))
5116
## [0.22.0] - 2024-08-30
6117
### Details
7118
#### Bug Fixes

Cargo.toml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
[workspace]
22
resolver = "2"
3-
members = [
4-
"testcontainers",
5-
"testimages",
6-
]
3+
members = ["testcontainers"]
4+
exclude = ["testimages/no_expose_port", "testimages/simple-web-server"]
75

86
[workspace.package]
9-
authors = ["Thomas Eizinger", "Artem Medvedev <[email protected]>", "Mervyn McCreight"]
7+
authors = [
8+
"Thomas Eizinger",
9+
"Artem Medvedev <[email protected]>",
10+
"Mervyn McCreight",
11+
]
1012
edition = "2021"
11-
keywords = ["docker", "testcontainers"]
13+
keywords = ["docker", "testcontainers", "docker-compose"]
1214
license = "MIT OR Apache-2.0"
1315
readme = "README.md"
1416
repository = "https://github.com/testcontainers/testcontainers-rs"
15-
rust-version = "1.75"
17+
rust-version = "1.88"
1618

17-
[workspace.dependencies]
18-
testimages = { path = "testimages" }
19+
[patch.crates-io]
20+
bollard = { git = "https://github.com/DDtKey/bollard.git", branch = "fix/providerless-session" }

Pipfile.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,35 @@ The crate provides an API for working with containers in a test environment.
2222
- Blocking API (under `blocking` feature)
2323

2424
```rust
25-
use testcontainers::{core::{IntoContainerPort, WaitFor}, runners::SyncRunner, GenericImage};
25+
use testcontainers::{core::{IntoContainerPort, WaitFor}, runners::SyncRunner, GenericImage, ImageExt};
2626

2727
#[test]
2828
fn test_redis() {
2929
let container = GenericImage::new("redis", "7.2.4")
3030
.with_exposed_port(6379.tcp())
3131
.with_wait_for(WaitFor::message_on_stdout("Ready to accept connections"))
32+
.with_network("bridge")
33+
.with_env_var("DEBUG", "1")
3234
.start()
33-
.expect("Redis started");
35+
.expect("Failed to start Redis");
3436
}
3537
```
3638

3739
- Async API
3840

3941
```rust
40-
use testcontainers::{core::{IntoContainerPort, WaitFor}, runners::AsyncRunner, GenericImage};
42+
use testcontainers::{core::{IntoContainerPort, WaitFor}, runners::AsyncRunner, GenericImage, ImageExt};
4143

4244
#[tokio::test]
4345
async fn test_redis() {
4446
let container = GenericImage::new("redis", "7.2.4")
4547
.with_exposed_port(6379.tcp())
4648
.with_wait_for(WaitFor::message_on_stdout("Ready to accept connections"))
49+
.with_network("bridge")
50+
.with_env_var("DEBUG", "1")
4751
.start()
4852
.await
49-
.expect("Redis started");
53+
.expect("Failed to start Redis");
5054
}
5155
```
5256

0 commit comments

Comments
 (0)