-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add integration tests for rest resources #18
Comments
cc @NiteshKant let's see how this works! |
Sure. No problem. I will try to find some time this week. Should i use a
|
Sounds cool. You can use a snapshot: I have some end-to-end Python tests, which may be a good starting point: Feel free to get in touch if you have trouble with installing anything. |
@jmnarloch sorry about the karyon snapshot being missing. We'll try and sort that out soon! |
I have made a simple test case, although I got some error when I try to run it: |
I got stack, whatever I try to do the archaius.deployment.applicationIdis not being set, even setting this manually through the build.gradle, does not resolve the issue. 2013-09-04 21:51:22,230 WARN com.netflix.karyon.server.ArchaiusIntegrationInterceptor:34 [localhost-startStop-1] [onPhase] Application identifier not defined, skipping application level properties loading. You must set a property 'archaius.deployment.applicationId' to be able to load application level properties. |
Hi @jmnarloch, how are you setting the archaius.deployment.applicationId=genie? Did you try to set your JAVA_OPTS to something like this - "-Darchaius.deployment.applicationId=genie -Darchaius.deployment.environment=dev". Thanks! |
I tried two things: first I've build the genie-web, deployed that on the standalone tomcat and set the CATALINA_OPTS this seems to be working perfectly fine. Now the trick is I'm trying to run the application through arquillian in the embedded tomcat, neither setting the System.property("archaius.deployment.applicationId", "genie") does not work. I recall that this was the valid way of initializing the application id used in kayron integration tests. Is there other way to set this parameter, not through system/environment variable? |
This is actually a question for @NiteshKant - does that property need to be set when the JVM starts up? If not, is there a way to do this as @jmnarloch expects? |
I've resolved the problem made a and made a minimal implementation for the mentioned resource, although there are things that need clarification:
|
Thanks for your contribution @jmnarloch - this is a great starting point. I can start moving some of my Python-based integration tests to this framework now. |
@jmnarloch only problem is - if I run "./gradlew clean test", it fails because it expects a war file to be present. Let me see if i can fix this. |
I have been running each time: clean build for running the integration test. To resolve your issue: I have tried adding: test.dependsOn ':genie-web:build' to the integration tests sub module, but there is some classloading issue, that loads not the ehnanced classes and I got the error during deployment from the openjpa that the classes can not be enhanced at the runtime. Other option would be to add a condition to the test sub module, so that the test would run only when the war file is actually present: http://www.gradle.org/docs/current/userguide/userguide_single.html#N10E97 |
I have checked in a "workaround" (see above). Basically I am not running the test under :genie-web-int:tests - since it is supposed to be run under build anyways. So both the test and build targets work now. |
We can continue to add more tests, but the initial setup is complete. I will close this issue. |
OK, thanks! |
I'm hoping @jmnarloch can give the new arquillian integration a whirl on a real prod app that uses karyon.
My suggestion would be to make a test that just does a list with no params on https://github.com/Netflix/genie/blob/master/genie-server/src/main/java/com/netflix/genie/server/resources/HiveConfigResourceV0.java#L117 for starters.
The text was updated successfully, but these errors were encountered: