-
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
Initial setup for Arquillian integration tests. #23
Conversation
genie-pull-requests #5 FAILURE |
@jmnarloch I assume I should wait to review this until our other discussion on Issue #18 is resolved. |
I have resolved the issue, by adding the conf.properties file that setups the application id. |
Excellent, so its ready to be reviewed and pulled in? |
genie-pull-requests #6 FAILURE |
Mostly, yes. Although you will have to build the latest kayron version from the sources. |
|
||
// TODO find a better way to load the war, excluding the hardcoded version | ||
WebArchive archive = ShrinkWrap.create(ZipImporter.class, "genie-web.war") | ||
.importFrom(new File("../genie-web/build/libs/genie-web-0.22-SNAPSHOT.war")) |
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.
@cfieber I'm thinking maybe pass a property from build.gradle in and use maven local resolver here?
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.
We could do that, but then to run the tests on the current build one must have to run the gradle install each time, otherwise he would have stale version from the local maven repository.
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.
yeah I see your point. I tend to always do install, but I know many don't
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.
At the very least, it would be nice to the get the version number from the gradle.properties. Otherwise we will have to change the tests after each upgrade.
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.
What would you say for something like this:
/**
* Creates tbe test deployment.
*
* @return the test deployment
*/
public static Archive createDeployment() {
WebArchive archive = ShrinkWrap.create(ZipImporter.class, "genie-web.war")
.importFrom(resolveTestWar("../genie-web/"))
.as(WebArchive.class);
// overwrites the web.xml file
archive.setWebXML("web.xml");
// adds the archaius configuration
archive.addAsResource("config.properties");
return archive;
}
/**
* Resolves the path to the genie-web war, that need to be build prior executing this test.
*
* @param rootProjectPath the root project path of the genie-web module
*
* @return the path pointing to the build war
*/
private static File resolveTestWar(String rootProjectPath) {
File buildDir = new File(rootProjectPath, "/build/libs/");
File[] war = buildDir.listFiles(new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.isFile()
&& pathname.getName().endsWith(".war");
}
});
return war[0];
}
It simply tries to "find" any war file, assuming that there won't be any other except for the genie-web.war, such solution will immune to the build version.
I've updated the PR and addressed the mentioned issues. The build should pass now. |
genie-pull-requests #7 SUCCESS |
LGTM will let @sriramkrishnan merge if he's happy |
Looks mostly good to me too - I will merge it in shortly (just haven't gotten a chance to do this yet). Thanks! |
Initial setup for Arquillian integration tests.
I have added a seperate module for running the integration tests, although when I run it I'm getting an error:
com.google.inject.ProvisionException: Guice provision errors:
at com.netflix.genie.server.resources.HiveConfigResourceV0.()
at Key[type=com.netflix.genie.server.resources.HiveConfigResourceV0, annotation=[none]]@com.netflix.genie.server.resources.HiveConfigResourceV0TestCase.resource
at com.netflix.genie.server.resources.HiveConfigResourceV0TestCase
Could you help me find the cause of it?
Note: I've used the kayron build from the master branch.