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

Running the integration tests does not work as described #205

Open
RKrahl opened this Issue Aug 15, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@RKrahl
Copy link
Member

RKrahl commented Aug 15, 2018

I just tried to run the integration tests. My experiences so far:

First try. I followed the instructions from the icat.server wiki. I set up a test server having authn.db-2.0.0, icat.lucene-1.1.0, and icat.server-4.9.1 deployed. I tried to run mvn install in the current source tree. After compile, the deploying of icat.server-4.9.2-SNAPSHOT.war failed with an Initialization failed for Singleton PropertyHandler exception caused by java.lang.IllegalStateException: class org.icatproject.core.IcatException No authenticator of type db is working.

Investigating the issue, it looks like the settings from src/main/resources/run.properties are hard coded to be used in the integration tests. It is pretty obvious that authn.db cannot be reached by the URL https://smfisher:8181 in my environment. As opposed to what is stated in the instructions in the wiki, the serverUrl in ~/.m2/settings.xml seem to be ignored.

Second try. I edited src/main/resources/run.properties to hard code settings that would work in my environment. This time, deploying of icat.server-4.9.2-SNAPSHOT.war failed because the server already has a web module icat.server-4.9.1 loaded at /icat. So the force-deploying was not able to overwrite the already installed older icat.server.

Third try. I uninstalled icat.server-4.9.1 and tried again. Now, the deploying failed with a java.lang.RuntimeException: Invalid resource : jdbc/icat__pm. Apparently, the integration test did not try to create the JDBC connection pool to connect to the database. In fact, I did not found any configuration settings in the sources that one useually would put into the setup.properties to point to the database.

Fourth try. I reinstalled icat.server-4.9.1 and then undeployed it manually. This created the JDBC connection pool as a side effect and left it behind, because I didn't use the setup script to uninstall. Now this did the trick. I got two failures, one errors, and three skipped out of 66 tests, but this is another issue to be investigated separately. But at least the test suite did run at all.

Unless I am overlooking something fundamental, this current state is not suitable to encourage anybody to run the tests.

@RKrahl

This comment has been minimized.

Copy link
Member

RKrahl commented Aug 16, 2018

Notes on the test failures: the cause of the error in the test results was that one test tried to login as user CIC with password password. This account was not listed in wiki page and therefore did not exist in my test server.

For the first failing test, I found the cause and suggest a fix in #206.

The second test failure is dubious. The test exportMetaDataQuery in src/test/java/org/icatproject/integration/TestRS.java creates an export file and asserts the size of this file to be 1924 bytes. When I run the test, I get an export file having 1954 bytes. But this export file looks perfectly valid. I suspect the export file format to be not very static. There are some degrees of freedom in the export file format and this might also depend on environment (e.g. date and time format). But I don't have a sample of the expected, supposed to be correct output, so I can't compare. I guess, the size of the export file is simply not a very good criterion for the validity.

@RKrahl RKrahl changed the title Running the integration tests does not work as decribed Running the integration tests does not work as described Aug 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment