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 tests and Setup a CI system #193

Open
tinesoft opened this issue Apr 16, 2019 · 10 comments
Open

Fix tests and Setup a CI system #193

tinesoft opened this issue Apr 16, 2019 · 10 comments

Comments

@tinesoft
Copy link
Contributor

tinesoft commented Apr 16, 2019

Hi @lordofthejars

I'm almost done implementing #191 , but i'm facing a major issue that prevents me from submitting any PR just yet: TESTS !

I'm glad to see the effort you put in writing so many of them 👍 💪 , but currently, almost none are working, even worst, some do not even compile.

I can understand how challenging it is to set-up and maintain a proper testing environment, due to the variety of dependencies each sub-module has. But i believe this burden can be greatly alleviated with use of Docker and a CI environnent like Travis (free for opensource projects).

@tinesoft
Copy link
Contributor Author

My idea is to use Docker (via docker-compose) to setup all dependent services of each sub-module (a elasticsearch, a mongo db, a cassandra,... ), then run the tests from the resulting docker image that will contain all those services up and running. That way we can have a repoductible testing envionnment, and then automate testing via Travis (which supports Docker)

A POC of that concept can be seen on my current branch https://github.com/tinesoft/nosql-unit/tree/feat-elasticsearch6.

The important files are:

  • docker-compose.yml - the docker-compose file that installs all prerequisites (for the moment, just maven and elasticsearch6, but you get the idea 😉 )
  • .travis.yml - the configuration file for TravisCI ( you must sign up to Travis with your Github account and activate the project for autobuild on push)

I have also made a few alteration to the main pom.xml by moving away the maven-gpg-plugin, maven-javadoc-plugin, and maven-source-plugin to a release profile ( only needed when releasing artifacts, there is no need to run them when running tests)

Here are the results of the build on Travis: https://travis-ci.org/tinesoft/nosql-unit/builds/520609046#L931 - As you can see basic tests on the nosqlunit-core are failing, i don't see how to solve them...

If you agree with this POC, i can provide my help in setting all this. But i will need yours to fix the tests.

This could defintively improve code quality of this great project and ensure easy integration of future PRs.

What do you think?

Tine

@lordofthejars
Copy link
Owner

I completely agree with you regarding this and thank you very much for the effort. So let's do one thing when you finish everything let's merge the change (of course the build will fail because of these tests but then I'll send a PR fixing all of them.

@tinesoft
Copy link
Contributor Author

Neat-o!

Ok, I will submitting a separate PR tonight, to setup the testing environment (modified pom.xml, docker-compose.yml and .travis.yml) so that we don't mix with my current work #191.

Once you merge that new PR, and fix tests, i will then rebase my #191 on the fixed code and submit the PR.

Have a nice day!

@ychaikin
Copy link

@lordofthejars Kudos for creating this project! I really like the ideas implemented here.

I've been looking for a Mongo-based DBUnit type of framework and found this. Kind of got excited until I saw that JUnit 5 isn't supported yet, which is something I need on the project I am on right now. It's also missing another feature I'd need, but whatever.

So, I thought, fine, maybe I'll just contribute and add that support, at least for Mongo portion of it.

Then, I hit this issue. :-)

Do you guys have an immediate plans to fix this (by immediate, I mean like in a day or two)?

Unfortunately, I don't have the time to help you fix it and since the compile time error is in the core package, I can't simply ignore it and have enough comfort to proceed.

Therefore, for me, the "barrier to entry" to use this framework becomes too high, i.e., higher than writing my own with just the features I need.

@lordofthejars
Copy link
Owner

Well it is not easy at all, but notice that JUnit5 support is not something that you add for Mongo. It is something that probably could be almost everything in the core module.

@ychaikin
Copy link

I understand. Thanks for the quick and honest answer. I'll have to figure out what I do next.

All the success to you with this project though! Certainly looks very useful.

@tinesoft
Copy link
Contributor Author

tinesoft commented Jun 27, 2019

Hi @lordofthejars

Any updates on the fixing of the tests?

I may have an even better alternative to setup tests requirements. It involves using org.testcontainers library to spin up required dependencies through Docker and JUnit Rules/Extensions. The integration is really easy and avoid a lot of boilerplate code...

@tinesoft
Copy link
Contributor Author

tinesoft commented Nov 8, 2019

Hi Alex,

Still no updates on this?

I'd really like to contribute more on the project (support for Junit 5 for e.g) but until this major issue is addressed, it is a hard to go further....
As a OSS maintainer myself, I know how time consuming it may gets sometimes.
Maybe consider adding new maintainers (yours truly 👼) to the project?

@ychaikin
Copy link

ychaikin commented Nov 8, 2019

@tinesoft Not sure if you are testing with MongoDB for your backend, but... I haven't officially announced it, except to my team (who is starting to use it already), but I've just released mongoUnit.

It's for JUnit 5 and targets Spring Boot applications at the moment, but depending on interest (and potential help from others), we might move it towards being independent (but still supporting) Spring Boot.

Check out the site (along with repo) and the features:
Testing MongoDB Spring Boot based applications: mongoUnit.org

I was going for "It must be super easy to use" and so far it seems I've hit that. Plus, based on feedback so far, there are other ideas on how to lower developer effort even more.

@tinesoft
Copy link
Contributor Author

Hi @ychaikin

That sounds interesting, I sure, will check it out for future projects involving both spring boot and Junit 5.
Unfortunately, for my current project , i'm still stuck with regular Spring and Junit 4...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants