carnival-data/carnival

Support for JVM TestSuite integration tests

Closed this issue · 1 comments

Tried to get integration tests to work via the incubating Gradle JVM TestSuite in a Carnival application. Could not get it to work. The issue seems to be adding dependencies to the integrationTest task... The tests will attempt to run, but have neither the Micronaut nor Carnival dependencies, so get class not found errors. There is probably a way to get this to work with Gradle programming, but I couldn't figure it out and have abandoned it for now.

Some experimental code:

project.tasks.each { tk ->
    println "task: ${tk} ${tk.name}"
}

project.configurations.each { conf ->
    println "configuration: ${conf} ${conf.name}"
}

project.plugins.each { plugin ->
    println "plugins: ${plugin}"
}

project.extensions.extensionsSchema.elements.each {
    println "extension: ${it.name} ${it.publicType}"
}

def testingExtension = project.extensions.findByType(org.gradle.testing.base.TestingExtension)
if (testingExtension) {
    testingExtension.suites.each { suite ->
        println "suite: ${suite}"
        suite.each { domainObject ->
            println "do: ${domainObject}"
        }
        suite.targets.each { suiteTarget ->
            println "suiteTarget: ${suiteTarget} ${suiteTarget.name}"
            //suiteTarget.configure {
            //    dependencies(dependencyClosure)
            //}
        }
        println "suite.testType: ${suite.testType.get()}"
        def deps = suite.dependencies
        println "suite.dependencies: ${deps}"
        deps.implementation("org.carnival:carnival-util:${carnivalVersion}")
        deps.implementation("org.carnival:carnival-graph:${carnivalVersion}")
        deps.implementation("org.carnival:carnival-core:${carnivalVersion}")
    }
}

Closing this for now. We can come back to it at a later date maybe.