mardi 12 novembre 2019

Can gradle tasks be created that subset the tests in a project?

I am using the gradle tooling api to kick off tests based on receiving a webhook.

I don't see a way to pass parameters to the tooling API. I can run tests with something like:

        String workingDir = System.getProperty("user.dir");

        ProjectConnection connection = GradleConnector.newConnector()
                .forProjectDirectory(new File(workingDir))
                .connect();
        try {
            connection.newBuild().forTasks("test").run();
        } catch (Exception ex) {
            ex.printStackTrace();
        } finally {
            connection.close();
        }

But I don't see a way to run something like "gradle test --tests=xxx" so I was hoping I could make gradle tasks that were subsets of tests like "gradle dev_tests", "gradle int_tests".

Does anyone know if this is possible and if so, how to do it?

Aucun commentaire:

Enregistrer un commentaire