scala - Gradle 不执行 scalatest
问题描述
我为我的 spark 项目创建了 scalatest,当我运行 gradle 任务“test”时,它不会执行单个测试。它显示零测试。
即使作为构建过程的一部分,gradle 也不执行任何测试用例。似乎 gradle 无法发现任何测试。
Build.gradle:
============
plugins {
id "maven-publish"
id "scala"
id 'java'
id 'jacoco'
}
scala {
zincVersion = "1.2.1"
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {
url 'http://conjars.org/repo'
}
}
dependencies {
compile "org.scala-lang:scala-library:"+scalaVersion
compile "org.scala-lang:scala-reflect:"+scalaVersion
compile "org.scala-lang:scala-compiler:"+scalaVersion
compile('org.apache.spark:spark-core_2.12:2.4.6')
compile('org.apache.spark:spark-sql_2.12:2.4.6')
compile('com.typesafe.scala-logging:scala-logging-slf4j_2.11:2.1.2')
compile('ch.hsr:geohash:1.3.0')
compile('joda-time:joda-time:2.3')
compile('org.json4s:json4s-jackson_2.11:3.7.0-M4')
compile('org.apache.httpcomponents:httpclient:4.5.6')
compile('com.fasterxml.jackson.datatype:jackson-datatype-joda:2.5.1')
compile 'com.typesafe:config:1.4.1'
implementation 'com.google.guava:guava:29.0-jre'
testCompile 'junit:junit:4.12'
testCompile 'org.scalatest:scalatest_2.12:3.2.0'
testCompile ("org.mockito:mockito-scala_2.12:1.16.42")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.7.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.4.2")
testCompile group: 'com.holdenkarau', name: 'spark-testing-base_2.12', version: '2.4.5_1.0.0'
compile 'org.scala-lang.modules:scala-xml_2.12:1.2.0'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
解决方案
推荐阅读
- amazon-web-services - 带一个浮点数的 AWS 存储
- macos - Neovim 不能在 mac 上运行
- css - wordpress 编辑器中出现意外的标记 1fr
- mongodb - 使用pymongo在mongodb中一起更新和插入?
- android - 在 MVVM 架构中使用 View 参数初始化实例的位置
- json - 奇怪的 JSON 解析
- javascript - 插件“gulp-mocha”中的错误
- ruby-on-rails - Rails 5,每个页面都需要活动记录
- java - 使用 Spring Security 身份验证测试方法
- python - 时间序列的 seq2seq 预测