Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ If a skill or this file turns out to be wrong or incomplete, update it in the sa
- Fix the root cause. A change that only makes a failure less likely is not a fix.
- Arbitrary delays (`sleep`), repeating a check, or adding retries do not remove a race; they hide it.
- For readiness problems, wait on a deterministic signal of the state you need. If no such signal exists, say so rather than shipping a mitigation as a fix.
- Import boundaries are enforced by Biome (`biome.json`):
- Modules import core only from the `testcontainers` entry point. The one allowed exception is the core test helper (`../../../testcontainers/src/utils/test-helper`).
- `noImportCycles` is an error. Prefer breaking a new cycle (for example with `import type` or a leaf module) over adding a `biome-ignore` suppression.
- Fix a lint violation rather than suppressing it with `biome-ignore`.

### Dependencies

Expand Down
24 changes: 23 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",

Check notice on line 2 in biome.json

View workflow job for this annotation

GitHub Actions / Lint

deserialize

The configuration schema version does not match the CLI version 2.5.15
"vcs": {
"enabled": true,
"clientKind": "git",
Expand All @@ -23,11 +23,20 @@
"enabled": true,
"rules": {
"preset": "recommended",
"complexity": {
"noExcessiveLinesPerFunction": {
"level": "error",
"options": {
"maxLines": 50
}
}
},
"correctness": {
"noUndeclaredDependencies": "error"
},
"nursery": {
"noFloatingPromises": "error"
"noFloatingPromises": "error",
"useNullishCoalescing": "error"
},
"suspicious": {
"noImportCycles": "error"
Expand All @@ -39,12 +48,25 @@
"includes": ["**/*.test.ts"],
"linter": {
"rules": {
"complexity": {
"noExcessiveLinesPerFunction": "off"
},
"correctness": {
"noUndeclaredDependencies": "off"
}
}
}
},
{
"includes": ["packages/**/src/**", "!packages/testcontainers/src/common/logger.ts"],
"linter": {
"rules": {
"suspicious": {
"noConsole": "error"
}
}
}
},
{
"includes": ["packages/modules/**"],
"linter": {
Expand Down
60 changes: 35 additions & 25 deletions packages/modules/azurite/src/azurite-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,31 @@ export class AzuriteContainer extends GenericContainer {
}

public override async start(): Promise<StartedAzuriteContainer> {
const command = this.createCommand();

this.withCommand(command).withExposedPorts(this.blobPort, this.queuePort, this.tablePort);

if (this.accountName !== DEFAULT_ACCOUNT_NAME || this.accountKey !== DEFAULT_ACCOUNT_KEY) {
this.withEnvironment({
AZURITE_ACCOUNTS: `${this.accountName}:${this.accountKey}`,
});
}

const protocol: Protocol = this.cert === undefined ? "http" : "https";
const startedContainer = await super.start();

return new StartedAzuriteContainer(
startedContainer,
this.accountName,
this.accountKey,
this.blobPort,
this.queuePort,
this.tablePort,
protocol
);
}

private createCommand(): string[] {
const command = [
"--blobHost",
"0.0.0.0",
Expand Down Expand Up @@ -190,6 +215,16 @@ export class AzuriteContainer extends GenericContainer {
command.push("--skipApiVersionCheck");
}

this.configureSsl(command);

if (this.oauthEnabled) {
command.push("--oauth", "basic");
}

return command;
}

private configureSsl(command: string[]): void {
if (this.cert !== undefined && this.certPath !== undefined) {
const contentsToCopy = [
{
Expand All @@ -216,31 +251,6 @@ export class AzuriteContainer extends GenericContainer {
command.push("--pwd", this.password);
}
}

if (this.oauthEnabled) {
command.push("--oauth", "basic");
}

this.withCommand(command).withExposedPorts(this.blobPort, this.queuePort, this.tablePort);

if (this.accountName !== DEFAULT_ACCOUNT_NAME || this.accountKey !== DEFAULT_ACCOUNT_KEY) {
this.withEnvironment({
AZURITE_ACCOUNTS: `${this.accountName}:${this.accountKey}`,
});
}

const protocol: Protocol = this.cert === undefined ? "http" : "https";
const startedContainer = await super.start();

return new StartedAzuriteContainer(
startedContainer,
this.accountName,
this.accountKey,
this.blobPort,
this.queuePort,
this.tablePort,
protocol
);
}
}

Expand Down
Loading
Loading