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

adds OrientDB 3.0.x module #1414

Merged
merged 23 commits into from Feb 5, 2020
Merged

adds OrientDB 3.0.x module #1414

merged 23 commits into from Feb 5, 2020

Conversation

robfrank
Copy link
Contributor

This adds:

  • OrientDBContainer
  • tests with both "try with resource" and "Classrule"
  • an additional test for Gremlin setup
  • documentation

@kiview
Copy link
Member

kiview commented Apr 24, 2019

Hey @robfrank,
thanks a lot for providing this PR for OrientDB.

Since there isn't that much actual OrientDB implementation code inside the module, I wonder if this makes really sense as its own module. WDYT about having this as an example + docs in ./examples instead?

@robfrank
Copy link
Contributor Author

Sorry for my long silence.

I developed the module for two main reasons:

BTW, I understand that having a great number of modules isn't simply manageable, so I can move the code inside our repo under the com.arcadeanalytics group id and improve the examples/doc on testocontainers to show how to use OrientDB with GenericContainer (that is the way we use it right now)

Or, just merge this :)

WDYT?

@rnorth
Copy link
Member

rnorth commented May 27, 2019

I think this probably passes the threshold of adding sufficient value to merit a module of its own. It would be a rather long-winded example snippet.

The remaining sometimes-troublesome area is the reliability of the docker image, drivers and avoidance of flakiness. Hopefully this module is pretty reliable on that front (I'll talk to @bsideup and @kiview about managing this).

Let's review on the basis that it can be accepted as a module, and see where we are.

@robfrank
Copy link
Contributor Author

Hi,
OrientDB is part of SAP and the testcontainer module relies on their Docker official images.

OrientDB is released frequently, at least once a month in this 2019: https://github.com/orientechnologies/orientdb/releases

I can bind the module to "latest" tag, if you think it could be better.

@rnorth
Copy link
Member

rnorth commented May 28, 2019

FWIW I've raised this ticket around the current gap in our docs for new module contributors. I'd like to have a bit of a think about the third point specifically before merging this, but otherwise I'm fine with this new module at an overall level: #1503

Comment on lines 13 to 24
@Test
public void testContainerLifecycle() {
OrientDBContainer container = new OrientDBContainer();

container.start();

assertThat(container.isRunning()).isTrue();

container.stop();

assertThat(container.isRunning()).isFalse();
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this test is unnecessary, since it's a feature of Testcontainers core. Can we remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Comment on lines 111 to 119
public OrientDBContainer withUsername(final String username) {
this.username = username;
return self();
}

public OrientDBContainer withPassword(final String password) {
this.password = password;
return self();
}
Copy link
Member

Choose a reason for hiding this comment

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

This username and password don't seem to be used to configure the container. In the JDBC database classes, username/password are passed through to the container via environment variables, to tell the container's bootstrap script to create that account.

It doesn't look like OrientDB supports this natively. Line 147 might be an opportunity to create the database and give access to the provided username, but as far as I can tell it's just expecting those credentials to work on line 150.

Is that accurate?

If these methods don't ensure that the account exists, I'd prefer to remove them to avoid confusion, TBH.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. I misunderstood the purpose of the member variables of the Container class, mixing server and client variables. I moved to the getSession method.

Comment on lines 30 to 58
private static final String DEFAULT_IMAGE_NAME = "orientdb";

private static final String DEFAULT_TAG = "3.0.24-tp3";

private static final String DEFAULT_USERNAME = "admin";

private static final String DEFAULT_PASSWORD = "admin";

private static final String DEFAULT_DATABASE_NAME = "testcontainers";

private static final int DEFAULT_BINARY_PORT = 2424;

private static final int DEFAULT_HTTP_PORT = 2480;

private static final Logger LOGGER = LoggerFactory.getLogger(OrientDBContainer.class);

private static final String DOCKER_IMAGE_NAME = DEFAULT_IMAGE_NAME + ":" + DEFAULT_TAG;

private String databaseName;

private String username;

private String password;

private OrientDB orientDB;

private ODatabaseSession session;

private Optional<String> scriptPath = Optional.empty();
Copy link
Member

Choose a reason for hiding this comment

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

Just a tiny style point, but I'd be inclined to reduce the spacing and reorder some of these fields (to group similar fields together, and to reduce visible space taken).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cleaned

Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

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

Hi @robfrank, sorry for the epic amount of time it's taken for me to have a proper look at this. I've added some comments.

If you're still interested, and able to, continue this then it'd be great if you could. If you can't, please let us know all the same.

@rnorth rnorth self-assigned this Nov 1, 2019
Copy link
Member

@rnorth rnorth left a comment

Choose a reason for hiding this comment

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

@robfrank - thank you for the updates following review, and again I'm sorry that this has been open for so long. Will merge - thanks for the contribution!

@rnorth rnorth merged commit 7cb8ef5 into testcontainers:master Feb 5, 2020
artjomka pushed a commit to artjomka/testcontainers-java that referenced this pull request Feb 28, 2020
Co-authored-by: Richard North <rich.north@gmail.com>
Co-authored-by: Sergei Egorov <bsideup@gmail.com>
@rnorth rnorth added this to the 1.13.0 milestone Mar 5, 2020
@rnorth
Copy link
Member

rnorth commented Mar 5, 2020

Released in 1.13.0! Thanks for the contribution @robfrank 😃

quincy referenced this pull request in quincy/testcontainers-java May 28, 2020
Co-authored-by: Richard North <rich.north@gmail.com>
Co-authored-by: Sergei Egorov <bsideup@gmail.com>
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.

None yet

4 participants