Skip to content

Add helper to ignore check version on azurite container#11834

Open
fdambrine wants to merge 1 commit into
testcontainers:mainfrom
fdambrine:feat/azurite-skip-api-version-check
Open

Add helper to ignore check version on azurite container#11834
fdambrine wants to merge 1 commit into
testcontainers:mainfrom
fdambrine:feat/azurite-skip-api-version-check

Conversation

@fdambrine

@fdambrine fdambrine commented Jun 8, 2026

Copy link
Copy Markdown

Hello,
As my team and I have trouble with the fact Azurite images and sdk version are not synchronized, we always have to find a way to put the --skipApiVersionCheck flag.

For now that means using GenericContainer instead of AzuriteContainer as the getCommandLine version would overwrite any change done with the withCommand helper we inherit.

To fit with current state of AzuriteContainer design, I added the withIgnoreApiVersionCheck helper and updated the getCommandLine method.

@fdambrine fdambrine requested a review from a team as a code owner June 8, 2026 07:20

@kiview kiview left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution — the feature addresses a real pain point with Azure SDK version mismatches, the insertion point in getCommandLine() is correct, and the change is backward compatible. A few things to address before this can merge:


Medium issues

1. API design — rename and drop the boolean parameter

withIgnoreApiVersionCheck(boolean) should become a no-arg method named withSkipApiVersionCheck():

  • The underlying Azurite CLI flag is --skipApiVersionCheck, so the method name should mirror it.
  • Passing false has no meaningful use case — the default is already false, and callers who don't want the flag simply don't call the method. Compare with HiveMQ's withDebugging() and similar no-arg opt-in methods elsewhere in this project.

2. Missing documentation

docs/modules/azure.md has no mention of this new option. Other features like withSsl and AZURITE_ACCOUNTS are documented there. Please add a short prose note and/or usage snippet so users can discover it.

3. Incomplete test coverage

The test only exercises the flag being present. Please add an assertion that --skipApiVersionCheck is absent from the default command line (i.e. when neither withSkipApiVersionCheck() nor the old setter is called). Something like:


Minor issues

4. Double blank lines (style)

There are three places in AzuriteContainer.java where double blank lines were introduced between methods. Running ./gradlew spotlessApply will fix these automatically.

5. Javadoc wording

The current Javadoc says "ignore version checks". Please update it to say "skip API version checks" to match the CLI flag name precisely and be consistent with the rename above.

6. Test structure — one @Test per scenario

testWithIgnoreApiVersionCheckAloneAndWithSsl tests two independent scenarios in a single method. The project convention is one @Test per scenario, so please split it into two separate test methods (e.g. testSkipApiVersionCheck and testSkipApiVersionCheckWithSsl).


Once these are addressed this should be in good shape. Happy to answer questions if anything is unclear!

@kiview kiview left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution — the feature addresses a real pain point with Azure SDK version mismatches, the insertion point in getCommandLine() is correct, and the change is backward compatible. A few things to address before this can merge:


Medium issues

1. API design — rename and drop the boolean parameter

withIgnoreApiVersionCheck(boolean) should become a no-arg method named withSkipApiVersionCheck():

  • The underlying Azurite CLI flag is --skipApiVersionCheck, so the method name should mirror it.
  • Passing false has no meaningful use case — the default is already false, and callers who don't want the flag simply don't call the method. Compare with HiveMQ's withDebugging() and similar no-arg opt-in methods elsewhere in this project.
// proposed
public AzuriteContainer withSkipApiVersionCheck() {
    this.skipApiVersionCheck = true;
    return this;
}

2. Missing documentation

docs/modules/azure.md has no mention of this new option. Other features like withSsl and AZURITE_ACCOUNTS are documented there. Please add a short prose note and/or usage snippet so users can discover it.

3. Incomplete test coverage

The test only exercises the flag being present. Please add an assertion that --skipApiVersionCheck is absent from the default command line (i.e. when withSkipApiVersionCheck() is not called). Example:

@Test
void testDefaultCommandLineDoesNotContainSkipApiVersionCheck() {
    AzuriteContainer container = new AzuriteContainer("mcr.microsoft.com/azure-storage/azurite:3.33.0");
    assertThat(container.getCommandLine()).doesNotContain("--skipApiVersionCheck");
}

Minor issues

4. Double blank lines (style)

There are three places in AzuriteContainer.java where double blank lines were introduced between methods. Running ./gradlew spotlessApply will fix these automatically.

5. Javadoc wording

The current Javadoc says "ignore version checks". Please update it to say "skip API version checks" to match the CLI flag name precisely and stay consistent with the rename above.

6. Test structure — one @Test per scenario

testWithIgnoreApiVersionCheckAloneAndWithSsl covers two independent scenarios in a single method. The project convention is one @Test per scenario, so please split it into two separate test methods (e.g. testSkipApiVersionCheck and testSkipApiVersionCheckWithSsl).


Once these are addressed this should be in good shape. Happy to answer questions if anything is unclear!

@kiview kiview left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution — the feature addresses a real pain point with Azure SDK version mismatches, the insertion point in getCommandLine() is correct, and the change is backward compatible. A few things to address before this can merge:


Medium issues

1. API design — rename and drop the boolean parameter

withIgnoreApiVersionCheck(boolean) should become a no-arg method named withSkipApiVersionCheck():

  • The underlying Azurite CLI flag is --skipApiVersionCheck, so the method name should mirror it.
  • Passing false has no meaningful use case — the default is already false, and callers who don't want the flag simply don't call the method. Compare with HiveMQ's withDebugging() and similar no-arg opt-in methods elsewhere in this project.
// proposed
public AzuriteContainer withSkipApiVersionCheck() {
    this.skipApiVersionCheck = true;
    return this;
}

2. Missing documentation

docs/modules/azure.md has no mention of this new option. Other features like withSsl and AZURITE_ACCOUNTS are documented there. Please add a short prose note and/or usage snippet so users can discover it.

3. Incomplete test coverage

The test only exercises the flag being present. Please add an assertion that --skipApiVersionCheck is absent from the default command line (i.e. when withSkipApiVersionCheck() is not called). Example:

@Test
void testDefaultCommandLineDoesNotContainSkipApiVersionCheck() {
    AzuriteContainer container = new AzuriteContainer("mcr.microsoft.com/azure-storage/azurite:3.33.0");
    assertThat(container.getCommandLine()).doesNotContain("--skipApiVersionCheck");
}

Minor issues

4. Double blank lines (style)

There are three places in AzuriteContainer.java where double blank lines were introduced between methods. Running ./gradlew spotlessApply will fix these automatically.

5. Javadoc wording

The current Javadoc says "ignore version checks". Please update it to say "skip API version checks" to match the CLI flag name precisely and stay consistent with the rename above.

6. Test structure — one @Test per scenario

testWithIgnoreApiVersionCheckAloneAndWithSsl covers two independent scenarios in a single method. The project convention is one @Test per scenario, so please split it into two separate test methods (e.g. testSkipApiVersionCheck and testSkipApiVersionCheckWithSsl).


Once these are addressed this should be in good shape. Happy to answer questions if anything is unclear!

@fdambrine fdambrine force-pushed the feat/azurite-skip-api-version-check branch from 1b0a984 to b86a35c Compare June 11, 2026 09:54
@fdambrine

Copy link
Copy Markdown
Author

Thanks for this very complete review @kiview. Every feedback have been taken into account, sorry for the doc & style issues, it's my first contribution, i'm not yet familiar with all the commands. And the gradlew command seems to force \r\n line break on every file.

@fdambrine fdambrine force-pushed the feat/azurite-skip-api-version-check branch from b86a35c to 7a4440c Compare June 11, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants