carnival-data / carnival

JVM property graph data unification framework
https://carnival-data.github.io/carnival/
GNU General Public License v3.0
7 stars 2 forks source link

Support for JVM TestSuite integration tests #87

Closed augustearth closed 2 years ago

augustearth commented 2 years ago

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}")
    }
}
augustearth commented 2 years ago

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