-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Use real MongoDB connection for E2E tests #348
Conversation
fdd6641
to
698447f
Compare
In E2E tests, the SetInputSystems call would fail because there is no existing project record in the freshly-created, empty Mongo instance. We don't want to change LfMerge to create the project record, because the Language Forge code is responsible for doing that. So instead we simply skip the update if the project record doesn't exist, allowing E2E tests to pass while not changing the behavior of real code.
Also print instructions for deleting it once post-failure investigation is completed.
4acb402
to
46caa50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main change I would like is to always cleanup the mongo container, and to throw if mongo fails to start
* Always stop Mongo container * Throw if Mongo container fails to start * Simpler MongoDbHostAndPort property definition
Unless the flag is set (to a non-empty value) the Mongo container will be torn down even if tests have failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, I'd like to allow setting LFMERGE_E2E_LEAVE_MONGO_CONTAINER_RUNNING_ON_FAILURE
to false should disable it. Otherwise it's good to go
Fixes #345.
The end-to-end LfMerge tests now use a real MongoDB container (spun up and torn down for each test, with no data persistence) rather than a mock Mongo connection. This does require the presence of Docker on the machine running the E2E tests, so that
docker run mongo:6
will succeed.