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

Enable test-resources for integration tests, disable it for unit tests #766

Open
cfooks-mns opened this issue Nov 14, 2024 · 0 comments
Open

Comments

@cfooks-mns
Copy link

cfooks-mns commented Nov 14, 2024

Feature description

Not sure if this is for test-resources or the Gradle plugin, but like @yibo-long's comment on #185, I would like to be able to disable test-resources entirely for unit tests and only enable it for integration tests.

As it stands, I have:

plugins {
    id("io.micronaut.application") version "4.4.2"
    id 'io.micronaut.test-resources' version '4.4.2'
    ...
}

micronaut {
    ...
    testResources {
        enabled.set(false)
    }
}

tasks.register('integrationTest', Test) {
    micronaut {
        testResources {
            enabled.set(true)
        }
    }
    ...
}

But this doesn't actually disable it …

Unfortunately, some third-party developers on our team are unable to run Docker but, when the plugin is used, Docker is checked and the build fails with:

[test-resources-service] 18:53:24.924 [pool-1-thread-1] ERROR o.t.d.DockerClientProviderStrategy - Could not find a valid Docker environment.

I'm going to investigate moving the integration tests into a submodule to see if I can only enable it in the submodule, but it'd be nice if I didn't need to work around it.

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

No branches or pull requests

1 participant