Closed Ishiido closed 6 years ago
It is necessary to have running ElasticSearch server to build the project.
Ah - I see. Then https://github.com/kitodo/kitodo-production/blob/master/README.md gives incorrect instructions on how to run a build process. Should the relevant tests be ignored by annotation?
I have no idea on setting up ElasticSearch.
README in master branch got new instructions for ElasticSearch (version, installation, ...). I hope this helps you.
I got the same build error.
Is it possible to skip tests which cannot work because of missing preconditions (for example no ElasticSearch server) and report that only without a build failure? I appreciate that tests are run by default, but it would also be good to allow simple builds with incomplete tests.
So far as I know is there no way to skip the test execution if a necessary dependency is not available.
Just annotate the RELEVANT Tests with "ignore" to suppress test execution for this test. If you don't do that all users who consider elasticsearch-install as a burden will suppress execution of ALL tests by -Dmaven.test.skip=true (which is worse...).
Basically those users will not be able to use Kitodo. Every insert of new object to database triggers also insert to index. Very soon also every search will be performed on index. Without ElasticSearch will be only possible to log in.
@Beacze, building and using Kitodo does not necessarily happen on the same machine. I use quite a lot of machines where I run builds for different projects, but only two machines where I run Kitodo. Not every code change requires a full test, sometimes it is sufficient to test whether Java compiles.
@stweil : If you really want to skip all tests on build time, then you should add -Dmaven.test.skip=true
to your Maven command as mentioned by @Ishiido .
That's the point: you don't want to skip all the test just because you KNOW that 2 tests cannot be performed. Maybe we have a different idea about distributing the software. As @stweil quoted it is one thing to build the software and completely another thing to run it. I guess you and the Kitodo group do not think that the way of distribution could be / should be GitHub (and forcing all users to checkout and build). I guess you plan to supply a WAR file of a specific version at a specific point. It is clear that you need elasticsearch to run Kitodo.Production productively but maybe it is not necessary to have it installed (and running) on each developer's machine. In my everyday business here I unfortunately had to "ignore" some tests I would like to run every time I build but the environment constantly changes here and not all cases can be mocked ...
PR #873 solves this problem completely.
@Ishiido and @stweil : is this issue fixed for you as PR #873 is merged?
Yes, I think it is fixed (thank you @Beacze), although I have not tested the latest version up to now.
@henning-gerhardt This Issue should be closed :)
Closing as no reaction was given and issue should be fixed.
there are tests that fail as they probably require preconditions