Skip to content

Commit

Permalink
Upgrade neo4j module to use features from v0.29.1 of testcontainers-go (
Browse files Browse the repository at this point in the history
#2463)

* Configure enterprise license using the new WithEnv option

Release v0.29.1 introduces a new option - WithEnv. This commit uses this
new option to configure the enterprise license instead of the manual
approach taken prior.

* Fix typo in WithEnv documentation

I've noticed a typo while reading about this new option.

---------

Co-authored-by: Manuel de la Peña <mdelapenya@gmail.com>
  • Loading branch information
danielorbach and mdelapenya committed Apr 3, 2024
1 parent 2d89e90 commit db61369
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/features/common_functional_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Using the `WithImageSubstitutors` options, you could define your own substitutio
If you need to either pass additional environment variables to a container or override them, you can use `testcontainers.WithEnv` for example:

```golang
postgres, err = postgresModule.RunContainer(ctx, testcontainers.WithEnv(map[string]string{"POSTGRES_INITDB_ARGS", "--no-sync"}))
postgres, err = postgresModule.RunContainer(ctx, testcontainers.WithEnv(map[string]string{"POSTGRES_INITDB_ARGS": "--no-sync"}))
```

#### WithLogConsumers
Expand Down
12 changes: 6 additions & 6 deletions modules/neo4j/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ func formatNeo4jConfig(name string) string {
// the commercial licence agreement of Neo4j Enterprise Edition. The license
// agreement is available at https://neo4j.com/terms/licensing/.
func WithAcceptCommercialLicenseAgreement() testcontainers.CustomizeRequestOption {
return func(req *testcontainers.GenericContainerRequest) {
req.Env["NEO4J_ACCEPT_LICENSE_AGREEMENT"] = "yes"
}
return testcontainers.WithEnv(map[string]string{
"NEO4J_ACCEPT_LICENSE_AGREEMENT": "yes",
})
}

// WithAcceptEvaluationLicenseAgreement sets the environment variable
Expand All @@ -134,7 +134,7 @@ func WithAcceptCommercialLicenseAgreement() testcontainers.CustomizeRequestOptio
// agreement is available at https://neo4j.com/terms/enterprise_us/. Please
// read the terms of the evaluation agreement before you accept.
func WithAcceptEvaluationLicenseAgreement() testcontainers.CustomizeRequestOption {
return func(req *testcontainers.GenericContainerRequest) {
req.Env["NEO4J_ACCEPT_LICENSE_AGREEMENT"] = "eval"
}
return testcontainers.WithEnv(map[string]string{
"NEO4J_ACCEPT_LICENSE_AGREEMENT": "eval",
})
}

0 comments on commit db61369

Please sign in to comment.