Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Pulsar): Support Apache Pulsar 4 #1355

Merged
merged 2 commits into from
Jan 31, 2025

Conversation

entvex
Copy link
Contributor

@entvex entvex commented Jan 29, 2025

What does this PR do?

  • Replaced deprecated script arguments with the updated ones to ensure proper configuration handling.
  • Upgraded the Pulsar image to version 3.0.8.
  • Updated default file paths to align with version 4.0.X for better compatibility and usability.

Why is it important?

The new Apache Pulsar 4.0.X container image enforces stricter security by reducing user privileges. As a result, the secret.key file needs to be created in a location that can be written to in both 3.0.X and 4.0.X versions.
This change ensures backward compatibility, which is a core principle of Testcontainers, while also taking advantage of the latest improvements in Pulsar 4.0.X.

How to test this PR

  • Ran the test suite using Apache Pulsar broker images for both versions 3.0.8 and 4.0.2 to successfully validate compatibility across both versions.
  • Tests passed in both scenarios.

Open Question

@HofmeisterAn, would you prefer that I configure the tests to explicitly validate against both image versions (e.g., 3.0.X and 4.0.X), or is it sufficient to test exclusively with the latest default version (3.0.X)? Let me know how you'd like to proceed.

Replaced deprecated script arguments with updated ones to ensure proper configuration handling. Updated Pulsar image to version 3.0.8 and modified default file paths for better alignment with expected conventions.
Copy link

netlify bot commented Jan 29, 2025

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit 6cb5052
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/679ca1122fd1e20008c96bb5
😎 Deploy Preview https://deploy-preview-1355--testcontainers-dotnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! It looks like this PR relates to #1294 but with fewer necessary changes 👍.

@HofmeisterAn, would you prefer that I configure the tests to explicitly validate against both image versions (e.g., 3.0.X and 4.0.X), or is it sufficient to test exclusively with the latest default version (3.0.X)? Let me know how you'd like to proceed.

Usually, we test both versions if they are not compatible. We follow this pattern, which should be easy to apply to PulsarContainerTest. I believe we just need to inherit from PulsarContainerTest:

[UsedImplicitly]
public sealed class MongoDbV5Configuration : MongoDbContainerTest
{
public MongoDbV5Configuration()
: base(new MongoDbBuilder().WithImage("mongo:5.0").Build())
{
}
}

Extending the tests would be great.

src/Testcontainers.Pulsar/PulsarBuilder.cs Outdated Show resolved Hide resolved
@HofmeisterAn HofmeisterAn added enhancement New feature or request module An official Testcontainers module labels Jan 29, 2025
@entvex
Copy link
Contributor Author

entvex commented Jan 31, 2025

Thanks for the PR! It looks like this PR relates to #1294 but with fewer necessary changes 👍.

@HofmeisterAn, would you prefer that I configure the tests to explicitly validate against both image versions (e.g., 3.0.X and 4.0.X), or is it sufficient to test exclusively with the latest default version (3.0.X)? Let me know how you'd like to proceed.

Usually, we test both versions if they are not compatible. We follow this pattern, which should be easy to apply to PulsarContainerTest. I believe we just need to inherit from PulsarContainerTest:

[UsedImplicitly]
public sealed class MongoDbV5Configuration : MongoDbContainerTest
{
public MongoDbV5Configuration()
: base(new MongoDbBuilder().WithImage("mongo:5.0").Build())
{
}
}

Extending the tests would be great.

Sure, I'll do that. So we know that the two LTS versions work.

Update the default Pulsar image to version 3.0.9 in the builder. Introduce two new test cases using Pulsar LTS 4.0.2: one for default configuration and another for authenticated configuration.
@HofmeisterAn HofmeisterAn changed the title fix: Apache Pulsar module support for Apache Pulsar 4 fix(Pulsar): Support Apache Pulsar 4 Jan 31, 2025
Copy link
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

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

Thanks 🙌.

@HofmeisterAn HofmeisterAn merged commit 2c6c915 into testcontainers:develop Jan 31, 2025
57 checks passed
@entvex entvex deleted the LTS_3_and_4_support branch January 31, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module An official Testcontainers module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement]: Upgrade Testcontainers.Pulsar to use Apache Pulsar v4.0.0
2 participants