Skip to content

Commit 4ba1c33

Browse files
Merge pull request #524 from testcontainers/release/0.15
2 parents f7a5f8f + 9196260 commit 4ba1c33

Some content is hidden

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

48 files changed

+503
-1862
lines changed

.github/docker.override.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This is a systemd unit override file that enables the Docker Remote API on localhost.
2+
# To take effect, it should be placed at /etc/systemd/system/docker.service.d/override.conf.
3+
[Service]
4+
ExecStart=
5+
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://127.0.0.1:2375

.github/workflows/ci.yml

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,66 @@
11
name: Continuous Integration
2+
23
on:
34
pull_request:
5+
merge_group:
46
push:
5-
branches: [master, dev, trying, staging]
7+
branches: [master, dev]
8+
69
jobs:
710
msrv:
811
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
cargo-cmd:
16+
- build --all-features
17+
- build --no-default-features
918
steps:
10-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1120
- name: Get current MSRV from Cargo.toml
1221
id: current_msrv
1322
run: |
1423
msrv=$(cat testcontainers/Cargo.toml | grep rust-version | sed 's/.* = "//; s/"//')
1524
echo "::set-output name=msrv::$msrv"
16-
- uses: actions-rs/toolchain@v1
17-
id: toolchain
25+
- uses: dtolnay/rust-toolchain@master
1826
with:
19-
profile: minimal
2027
toolchain: ${{steps.current_msrv.outputs.msrv}}
21-
override: true
22-
- uses: Swatinem/[email protected]
23-
- run: cargo build
28+
- uses: Swatinem/[email protected]
29+
- run: cargo ${{ matrix['cargo-cmd'] }}
30+
2431
test:
2532
runs-on: ubuntu-latest
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
cargo-cmd:
37+
- test --all-features
38+
- test --no-default-features
2639
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
40+
- uses: actions/checkout@v4
41+
- name: Enable Docker Remote API on Localhost
42+
shell: bash
43+
run: |
44+
sudo mkdir -p /etc/systemd/system/docker.service.d/
45+
sudo cp ./.github/docker.override.conf /etc/systemd/system/docker.service.d/override.conf
46+
sudo systemctl daemon-reload
47+
sudo systemctl restart docker
48+
- uses: dtolnay/rust-toolchain@stable
49+
- uses: Swatinem/[email protected]
50+
- run: cargo ${{ matrix['cargo-cmd'] }}
51+
3652
style:
3753
runs-on: ubuntu-latest
3854
steps:
39-
- uses: actions/checkout@v3
40-
- uses: dprint/[email protected]
55+
- uses: actions/checkout@v4
56+
- uses: dprint/[email protected]
57+
4158
lint:
4259
runs-on: ubuntu-latest
4360
steps:
44-
- uses: actions/checkout@v3
45-
- uses: actions-rs/toolchain@v1
46-
id: toolchain
61+
- uses: actions/checkout@v4
62+
- uses: dtolnay/[email protected]
4763
with:
48-
profile: minimal
49-
toolchain: stable
50-
override: true
5164
components: clippy
52-
- uses: Swatinem/rust-cache@v1.4.0
65+
- uses: Swatinem/rust-cache@v2.7.0
5366
- run: cargo clippy --all-targets -- -D warnings

.github/workflows/nightly.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ jobs:
44
nightly-tests:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v3
7+
- uses: actions/checkout@v4
88
- uses: actions-rs/toolchain@v1
99
id: toolchain
1010
with:
1111
profile: minimal
1212
toolchain: nightly
1313
override: true
14-
- uses: Swatinem/rust-cache@v1.4.0
14+
- uses: Swatinem/rust-cache@v2.7.0
1515
- run: cargo test
1616
nightly-lints:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- uses: actions-rs/toolchain@v1
2121
id: toolchain
2222
with:
2323
profile: minimal
2424
toolchain: nightly
2525
override: true
2626
components: clippy
27-
- uses: Swatinem/rust-cache@v1.4.0
27+
- uses: Swatinem/rust-cache@v2.7.0
2828
- 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@v3
17+
uses: actions/checkout@v4
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.2.2
68+
uses: thomaseizinger/create-pull-request@1.3.1
6969
with:
7070
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7171
head: release/${{ steps.extract-version.outputs.version }}

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,27 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [0.15.0] - 2023-09-28
9+
10+
### Added
11+
12+
- Added `privileged` parameter to `RunnableImage`
13+
- Added `shm_size` (shared memory size) parameter to `RunnableImage`
14+
- Added logging of an error when starting a container fails
15+
16+
### Changed
17+
18+
- `Container::exec` changed to be synchronous and return `ExecOutput`
19+
- MSRV is now 1.63.
20+
- Fixed `get_bridge_ip_address` not to use outdated properties
21+
- `Docker` trait is declared to be `Send + Sync`
22+
23+
### Removed
24+
25+
- Removed all pre-defined images from the library to escape unbounded maintenance work.
26+
See https://github.com/testcontainers/testcontainers-rs/issues/471 for details.
27+
- Removed explicit support for podman.
28+
See https://github.com/testcontainers/testcontainers-rs/issues/422 for details.
929

1030
## [0.14.0] - 2022-05-30
1131

CONTRIBUTING.md

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

33
First, thank you for contributing to `testcontainers-rs`.
44

5-
Most likely, your contribution is about adding support for a new docker image.
6-
Docker images are contained within the [images](./src/images) folder.
7-
Each file represents a docker image.
8-
The files follow the name of the image on DockerHub.
9-
Please follow this convention while developing new images.
10-
115
## Licensing
126

137
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.

DESIGN_PRINCIPLES.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Design principles
2+
3+
This document aims to capture the design principles that went into this library.
4+
It should serve as a reference point when making decisions on what features to include or exclude.
5+
6+
## Simple
7+
8+
One of the most important goals that we want to adhere to is creating a _simple_ API.
9+
Overall, this means keeping the API as small as possible to get the task done.
10+
When in doubt, we'd rather not add flags or configuration options for certain use cases.
11+
12+
Tests should be easier to write, easy to understand and easy to maintain.
13+
`testcontainers` aims to support this as much as possible.
14+
Having too many configuration options makes it harder for users to achieve this goal.
15+
16+
Another advantage of a small, public API is that we have to make fewer breaking changes.
17+
This makes upgrades easier for our users.
18+
19+
## Reliable
20+
21+
Tests need to be reliable to provide value.
22+
We strive to make `testcontainers` as reliable as possible and try to control as many aspects of the container to make sure they work consistently.
23+
24+
One consequence of this decision is that the container _tag_ is typically not configurable for images that ship with `testcontainers`.
25+
Whilst an image behind a tag can also change, image authors tend to preserve compatibility there.
26+
If we were to allow users to change the `tag` of an image, we wouldn't be able to guarantee that it works because we cannot test all combinations.
27+
28+
## Ease of use
29+
30+
The library should be easy to use.
31+
For example, users should be able to make their own implementation of `Image` without much boilerplate.
32+
In fact, the path forward may very well be that we stop shipping a lot of images in the crate and instead require users to create their own images.

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,19 @@ Testcontainers-rs is the official Rust language fork of [http://testcontainers.o
1111

1212
## Usage
1313

14+
### `testcontainers` is the core crate
15+
16+
The crate provides an API for working with containers in a test environment.
17+
1418
1. Depend on `testcontainers`
15-
2. Import `use testcontainers::*`.
19+
2. Implement `testcontainers::core::Image` for necessary docker-images
20+
3. Run it with any available client `testcontainers::clients::*`
21+
22+
### Ready-to-use images
23+
24+
The easiest way to use `testcontainers` is to depend on ready-to-use images (aka modules).
1625

17-
Check [the integration tests](./testcontainers/tests) on how to use the library.
26+
Modules are available as a community-maintained crate: [testcontainers-modules](https://github.com/testcontainers/testcontainers-rs-modules-community)
1827

1928
## License
2029

bors.toml

Lines changed: 0 additions & 1 deletion
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)