airframe icon indicating copy to clipboard operation
airframe copied to clipboard

airframe-airspec: Support runner tool for using it on Gradle project.

Open joey-yoonsung opened this issue 5 years ago • 3 comments

Hi. I'm developing a multi-language project.

Our project uses Gradle as a build tool.

I want to use airspec as the testing framework for scala language but I couldn't find this framework works with the build tool in Gradle.

I can use this framework if there is a runner class which has the main function such as org.scalatest.tools.Runner in scala-test project.

  • I can run scala-test in gradle like below
task scalaTest(dependsOn: ['testClasses'], type: JavaExec) {
    main = 'org.scalatest.tools.Runner'
    args = ['-R', 'build/classes/scala/test', '-o']
    classpath = sourceSets.test.runtimeClasspath
}
test.dependsOn scalaTest

joey-yoonsung avatar Nov 12 '20 09:11 joey-yoonsung

Interesting. Does AirSpecLauncher.main work for this purpose? https://github.com/wvlet/airframe/blob/f35b64e4c8133ffdc8c45659fa0e7346012747fa/airspec/src/main/scala/wvlet/airspec/AirSpecLauncher.scala#L27

xerial avatar Nov 12 '20 16:11 xerial

@xerial Oh. There is. Thanks to inform me. I will try to apply it.

joey-yoonsung avatar Nov 13 '20 02:11 joey-yoonsung

I tried it. But It only takes one test class fullname. I cannot run as classpath. I will make pull requests to improve this Runner such as org.scalatest.tools.Runner

joey-yoonsung avatar Nov 13 '20 04:11 joey-yoonsung