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

Add support for Neo4j configuration #992

Merged
merged 6 commits into from
Mar 30, 2023

Conversation

fbiville
Copy link
Contributor

What does this PR do?

This PR adds support for customizing the Neo4j configuration before Neo4j starts.

Why is it important?

This is useful for many things: customizing logging, connectivity, the JVM used by Neo4j, etc etc

Related issues

Follows up after the initial implementation of #921.

Follow-ups

I'm not entirely sure yet whether conflicting setting keys should fail hard or not.
The initial implementation just logs a message when that happens.

@fbiville fbiville requested a review from a team as a code owner March 27, 2023 16:05
@netlify
Copy link

netlify bot commented Mar 27, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 82e1e65
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/6425aa2a447c7b00087a4c06
😎 Deploy Preview https://deploy-preview-992--testcontainers-go.netlify.app/modules/neo4j
📱 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 settings.

eddumelendez
eddumelendez previously approved these changes Mar 27, 2023
@@ -11,6 +12,8 @@ type config struct {
imageCoordinates string
adminPassword string
labsPlugins []string
neo4jSettings map[string]string
stderr io.Writer
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the intention of this writer? Testcontainers provides with a Logger interface that could be passed as field of the GenericContainerRequest struct (see https://github.com/testcontainers/testcontainers-go/pull/992/files#diff-cdacf25279bf22e2de635c654d0bb2c37c1b5699d8c13c07da3c0886b2087218R72-R75)

You could define the logger elsewhere and attach it to the container and use it when validating the config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah cool, I was looking for a logger yesterday and could not find it. Will use the logger then

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 06e40f6

Copy link
Contributor Author

@fbiville fbiville Mar 28, 2023

Choose a reason for hiding this comment

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

I'm thinking more and more that:

  • either the module does not validate conflicting settings at all
  • or report validation errors just before the container is created
  • or fails hard right away at the first conflict

Eagerly logging a warning introduces a configuration ordering issue (setting a custom logger after some settings are set means that custom logger may miss warning messages)

@mdelapenya
Copy link
Collaborator

@fbiville I've started seen that every CI build fails for the Neo4j module, and cannot understand the reason. They fail even for PRs that were not modified and that job was re-triggered. It's weird that I run the tests locally and they pass.

Do you know why? 🙏

@mdelapenya
Copy link
Collaborator

For some reason, the inconsistency is no longer present 🤷 👻

@mdelapenya mdelapenya added the chore Changes that do not impact the existing functionality label Mar 30, 2023
@mdelapenya mdelapenya self-assigned this Mar 30, 2023
@sonarcloud
Copy link

sonarcloud bot commented Mar 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@mdelapenya mdelapenya merged commit 01d6c3e into testcontainers:main Mar 30, 2023
@fbiville fbiville deleted the neo4j/envvar_support branch March 31, 2023 11:46
mdelapenya pushed a commit to mdelapenya/testcontainers-go that referenced this pull request Apr 3, 2023
* Add support for Neo4j configuration

* Remove testify

* Add missing setting name example in docs

* Use logger

* Document possible config ordering issue

* Remove bogus license header
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that do not impact the existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants