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

Initial setup for Arquillian integration tests. #23

Merged
merged 1 commit into from
Sep 13, 2013

Conversation

jmnarloch
Copy link
Contributor

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:

  1. Error injecting constructor, com.netflix.genie.common.exceptions.CloudServiceException: Configuration error - netflix.genie.server.hiveConfigImpl is not found
    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.

@cloudbees-pull-request-builder

genie-pull-requests #5 FAILURE
Looks like there's a problem with this pull request

@sriramkrishnan
Copy link
Contributor

@jmnarloch I assume I should wait to review this until our other discussion on Issue #18 is resolved.

@jmnarloch
Copy link
Contributor Author

I have resolved the issue, by adding the conf.properties file that setups the application id.

@sriramkrishnan
Copy link
Contributor

Excellent, so its ready to be reviewed and pulled in?

@cloudbees-pull-request-builder

genie-pull-requests #6 FAILURE
Looks like there's a problem with this pull request

@jmnarloch
Copy link
Contributor Author

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"))

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?

Copy link
Contributor Author

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.

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

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@jmnarloch
Copy link
Contributor Author

I've updated the PR and addressed the mentioned issues. The build should pass now.

@cloudbees-pull-request-builder

genie-pull-requests #7 SUCCESS
This pull request looks good

@codefromthecrypt
Copy link

LGTM will let @sriramkrishnan merge if he's happy

@sriramkrishnan
Copy link
Contributor

Looks mostly good to me too - I will merge it in shortly (just haven't gotten a chance to do this yet). Thanks!

sriramkrishnan added a commit that referenced this pull request Sep 13, 2013
Initial setup for Arquillian integration tests.
@sriramkrishnan sriramkrishnan merged commit e6121fb into Netflix:master Sep 13, 2013
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

Successfully merging this pull request may close these issues.

4 participants