Skip to content

Commit 225622c

Browse files
Merge branch 'main' into ubuntu-24.04
2 parents 73af340 + 7f40327 commit 225622c

109 files changed

Lines changed: 4134 additions & 4554 deletions

File tree

Some content is hidden

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

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// Features to add to the dev container. More info: https://containers.dev/features.
99
"features": {
10-
"ghcr.io/devcontainers/features/node:1": {
10+
"ghcr.io/devcontainers/features/node:2": {
1111
"version": "24"
1212
},
1313
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}

.github/workflows/checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
strategy:
108108
fail-fast: false
109109
matrix:
110-
node-version: [20.x, 22.x, 24.x]
110+
node-version: [22.x, 24.x]
111111
runs-on: ubuntu-24.04
112112
steps:
113113
- name: Code checkout
@@ -143,7 +143,7 @@ jobs:
143143
fail-fast: false
144144
matrix:
145145
module: ${{ fromJSON(needs.detect-modules.outputs.modules) }}
146-
node-version: [20.x, 22.x, 24.x]
146+
node-version: [22.x, 24.x]
147147
container-runtime: [docker, podman]
148148
uses: ./.github/workflows/test-template.yml
149149
with:

.github/workflows/close-inactive-issues.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
days-before-issue-stale: 90
1717
days-before-issue-close: 30
1818
stale-issue-label: "stale"
19+
exempt-issue-labels: "never-stale"
1920
stale-issue-message: "This issue is stale because it has been open for 90 days with no activity."
2021
close-issue-message: "This issue was closed because it has been inactive for 30 days since being marked as stale."
2122
days-before-pr-stale: -1

.github/workflows/test-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ jobs:
5454
workspace: "${{ inputs.workspace }}"
5555

5656
- name: Run tests
57-
run: npm run test:ci -- --coverage.include=${{ steps.npm-install.outputs.workspace_path }} ${{ steps.npm-install.outputs.workspace_path }}
57+
run: npm run test:ci -- --coverage.include="${{ steps.npm-install.outputs.workspace_path }}/**/*.ts" ${{ steps.npm-install.outputs.workspace_path }}
5858
env:
5959
CI: true

AGENTS.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,27 @@
55
This is a working guide for contributors and coding agents in this repository.
66
It captures practical rules that prevent avoidable CI and PR churn.
77

8+
## Instruction precedence
9+
10+
- Repository-specific instructions in this file override generic coding-agent defaults, skills, and templates.
11+
- If a generic workflow conflicts with this file, follow this file.
12+
13+
## Repository Layout
14+
15+
- This repository is an npm workspaces monorepo.
16+
- root package: `testcontainers-monorepo`
17+
- workspaces: `packages/testcontainers` and `packages/modules/*`
18+
- shared lockfile: root `package-lock.json` (workspace installs update this single file)
19+
- For workspace-scoped dependency changes, prefer targeted commands to reduce lockfile churn:
20+
- `npm install -w @testcontainers/<module>`
21+
- `npm uninstall -w @testcontainers/<module> <package>`
22+
823
## Development Expectations
924

1025
- If a public API changes, update the relevant docs in the same PR.
1126
- If new types are made part of the public API, export them from the package's `index.ts` in the same PR.
1227
- If new learnings or misunderstandings are discovered, propose an `AGENTS.md` update in the same PR.
28+
- In docs Markdown, keep `<!--codeinclude-->` blocks tight with no blank lines between the markers and the include line, or the rendered snippet will contain blank lines between code lines.
1329
- Tests should verify observable behavior changes, not only internal/config state.
1430
- Example: for a security option, assert a real secure/insecure behavior difference.
1531
- Test-only helper files under `src` (for example `*-test-utils.ts`) must be explicitly excluded from package `tsconfig.build.json` so they are not emitted into `build` and accidentally published.
@@ -21,7 +37,7 @@ It captures practical rules that prevent avoidable CI and PR churn.
2137
## Permission and Escalation
2238

2339
- `npm install` requires escalated permissions for outbound network access to npm registries.
24-
- `npm test` commands should b`e run with escalation so tests can access the Docker socket.
40+
- `npm test` commands should be run with escalation so tests can access the Docker socket.
2541

2642
### Escalation hygiene
2743

@@ -40,7 +56,9 @@ It captures practical rules that prevent avoidable CI and PR churn.
4056
- Never bypass signing (for example, do not use `--no-gpg-sign`).
4157
- If signing fails (for example, passphrase/key issues), stop and ask the user to resolve signing, then retry.
4258
8. Push branch. Ask for explicit user permission before any force push.
43-
9. Open PR against `main` using a human-readable title (no `feat(...)` / `fix(...)` prefixes).
59+
9. Open PR against `main` using a human-readable title (no `feat(...)` / `fix(...)` prefixes, and no agent-identifying prefixes or suffixes).
60+
- Default to a ready-for-review PR. Only open or keep a PR in draft when the user explicitly asks for a draft.
61+
- When using `gh` to create/edit PR descriptions, prefer `--body-file <path>` over inline `--body`; this avoids shell command substitution issues when the body contains backticks.
4462
10. Add labels for both change type and semantic version impact.
4563
11. Ensure PR body includes:
4664
- summary of changes
@@ -73,6 +91,6 @@ It captures practical rules that prevent avoidable CI and PR churn.
7391
- docs-only change: `documentation` + usually `patch`
7492
- dependency update: `dependencies` + impact label based on user-facing effect
7593

76-
## Practical Note
94+
## Lockfile Hygiene
7795

7896
- Recheck `package-lock.json` after `npm install` for unrelated drift and revert unrelated changes.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Then access the docs at [http://localhost:8000](http://localhost:8000).
3131

3232
#### Using Python
3333

34-
* Ensure that you have Python 3.8.0 or higher.
34+
* Ensure that you have Python 3.11.0 or higher.
3535
* Set up a virtualenv and run `pip install -r requirements.txt` in the `testcontainers-node` root directory.
3636
* Once Python dependencies have been installed, run `mkdocs serve` to start a local auto-updating MkDocs server.
3737

docs/features/compose.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,19 @@ const environment = await new DockerComposeEnvironment(composeFilePath, composeF
144144
.up();
145145
```
146146

147+
### With auto cleanup disabled
148+
149+
By default Testcontainers registers the compose project with Ryuk so the stack is torn down automatically when the process exits. You can disable that registration for a specific compose stack:
150+
151+
```js
152+
const environment = await new DockerComposeEnvironment(composeFilePath, composeFile)
153+
.withProjectName("test")
154+
.withAutoCleanup(false)
155+
.up();
156+
```
157+
158+
This only disables automatic cleanup. Explicit calls to `.down()`, `.stop()`, or `await using` disposal still tear the stack down as usual.
159+
147160
### With custom client options
148161

149162
See [docker-compose](https://github.com/PDMLab/docker-compose/) library.

docs/features/containers.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,16 @@ const container = await new GenericContainer("alpine")
400400
await container.stop({ remove: true }); // The container is stopped *AND* removed
401401
```
402402

403+
You can also disable automatic Ryuk cleanup for a specific container while leaving it enabled for the rest of the test session:
404+
405+
```js
406+
const container = await new GenericContainer("alpine")
407+
.withAutoCleanup(false)
408+
.start();
409+
```
410+
411+
This only affects automatic cleanup when the process exits unexpectedly or the container is otherwise left running. Explicit calls to `.stop()` still use the normal stop and removal behavior, so combine this with `.withAutoRemove(false)` or `.stop({ remove: false })` if you also want explicit stops to keep the container.
412+
403413
Keep in mind that disabling ryuk (set `TESTCONTAINERS_RYUK_DISABLED` to `true`) **and** disabling automatic removal of containers will make containers persist after you're done working with them.
404414

405415

docs/modules/localstack.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,27 @@ These examples use the following libraries:
1616

1717
Choose an image from the [container registry](https://hub.docker.com/r/localstack/localstack) and substitute `IMAGE`.
1818

19+
!!! note "Authentication requirements"
20+
Starting on March 23, 2026, LocalStack moved to authenticated image releases. Older pinned tags may continue to work without `LOCALSTACK_AUTH_TOKEN`, but newer releases require it.
21+
22+
Prefer pinning a specific image tag instead of using `latest`. If the image tag you use requires authentication, pass `LOCALSTACK_AUTH_TOKEN` when starting the container:
23+
24+
```typescript
25+
const token = process.env.LOCALSTACK_AUTH_TOKEN;
26+
27+
if (!token) {
28+
throw new Error("LOCALSTACK_AUTH_TOKEN must be set for authenticated LocalStack images");
29+
}
30+
31+
const container = await new LocalstackContainer("localstack/localstack:IMAGE")
32+
.withEnvironment({ LOCALSTACK_AUTH_TOKEN: token })
33+
.start();
34+
```
35+
36+
Refer to the [LocalStack announcement](https://blog.localstack.cloud/localstack-single-image-next-steps/) for the current rollout details.
37+
1938
### Create a S3 bucket
2039

2140
<!--codeinclude-->
2241
[](../../packages/modules/localstack/src/localstack-container.test.ts) inside_block:localstackCreateS3Bucket
2342
<!--/codeinclude-->
24-

docs/modules/oraclefree.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Oracle Free
2+
3+
## Install
4+
5+
```bash
6+
npm install @testcontainers/oraclefree --save-dev
7+
```
8+
9+
## Examples
10+
11+
These examples use the following libraries:
12+
13+
- [oracledb](https://www.npmjs.com/package/oracledb)
14+
15+
npm install oracledb
16+
17+
Recommended to use an image from [this registry](https://hub.docker.com/r/gvenzl/oracle-free) and substitute for `IMAGE`
18+
19+
### Start a database and execute queries
20+
21+
<!--codeinclude-->
22+
[](../../packages/modules/oraclefree/src/oraclefree-container.test.ts) inside_block:customDatabase
23+
<!--/codeinclude-->

0 commit comments

Comments
 (0)