Gradleでは、テストを実行しません。

n00bst3r:

私は私のGradleスクリプトを実行するときは、常にこれを行います:

> Configure project :
Evaluating root project 'trading-library' using build file 'C:\Users\xxx\Documents\Repositories\Trading_Library\Trading_Library\build.gradle'.
Invalidating in-memory cache of C:\Users\xxx\.gradle\caches\journal-1\file-access.bin
All projects evaluated.
Selected primary task 'cleanTest' from project :
Selected primary task 'test' from project :
Tasks to be executed: [task ':cleanTest', task ':compileJava', task ':processResources', task ':classes', task ':compileTestJava', task ':processTestResources', task ':testClasses', task ':test']
:cleanTest (Thread[Execution worker for ':',5,main]) started.

> Task :cleanTest UP-TO-DATE
Task ':cleanTest' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
:cleanTest (Thread[Execution worker for ':',5,main]) completed. Took 0.002 secs.
:compileJava (Thread[Execution worker for ':',5,main]) started.

> Task :compileJava UP-TO-DATE
Skipping task ':compileJava' as it is up-to-date.
:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 0.029 secs.
:processResources (Thread[Execution worker for ':',5,main]) started.

> Task :processResources NO-SOURCE
Skipping task ':processResources' as it has no source files and no previous output files.
:processResources (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:classes (Thread[Execution worker for ':',5,main]) started.

> Task :classes UP-TO-DATE
Skipping task ':classes' as it has no actions.
:classes (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:compileTestJava (Thread[Execution worker for ':',5,main]) started.

> Task :compileTestJava UP-TO-DATE
Skipping task ':compileTestJava' as it is up-to-date.
:compileTestJava (Thread[Execution worker for ':',5,main]) completed. Took 0.032 secs.
:processTestResources (Thread[Execution worker for ':',5,main]) started.

> Task :processTestResources NO-SOURCE
Skipping task ':processTestResources' as it has no source files and no previous output files.
:processTestResources (Thread[Execution worker for ':',5,main]) completed. Took 0.001 secs.
:testClasses (Thread[Execution worker for ':',5,main]) started.

> Task :testClasses UP-TO-DATE
Skipping task ':testClasses' as it has no actions.
:testClasses (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:test (Thread[Execution worker for ':',5,main]) started.

> Task :test
Task ':test' is not up-to-date because:
  Output property 'binResultsDir' file C:\Users\xxx\Documents\Repositories\Trading_Library\Trading_Library\build\test-results\test\binary has been removed.
  Output property 'binResultsDir' file C:\Users\xxx\Documents\Repositories\Trading_Library\Trading_Library\build\test-results\test\binary\output.bin has been removed.
  Output property 'binResultsDir' file C:\Users\xxx\Documents\Repositories\Trading_Library\Trading_Library\build\test-results\test\binary\output.bin.idx has been removed.
Custom actions are attached to task ':test'.
Finished generating test XML results (0.0 secs) into: C:\Users\xxx\Documents\Repositories\Trading_Library\Trading_Library\build\test-results\test
Generating HTML test report...
Finished generating test html results (0.017 secs) into: C:\Users\xxx\Documents\Repositories\Trading_Library\Trading_Library\build\reports\tests\test
:test (Thread[Execution worker for ':',5,main]) completed. Took 0.367 secs.

これは、Gradleのクリーンビルド後に出力されます。それはGradleのように思えるので、ソースを見つけて、テストを実行しないものGradleはありません。が発生なしテストレポートはありませんし、テスト結果のhtmlファイルには、任意の実行テストは表示されません。

これは私のGradleファイルです。

buildscript {
    repositories {
        maven {
            url "${nexusUrl}/content/groups/public/"
            credentials {
                username "$nexusUsername"
                password "$nexusPassword"
            }
        }
    }

    dependencies {
        classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6"
    }
}


apply plugin: 'maven'
apply plugin: 'java'
apply plugin: "org.sonarqube"
apply plugin: "jacoco"

jar {
    baseName = 'xxx-trading-lib'
    version = '0.0.1-SNAPSHOT'
}

sourceCompatibility = 11
targetCompatibility = 11

repositories {
    maven {
        url "${nexusUrl}/content/groups/public/"
        credentials {
            username "$nexusUsername"
            password "$nexusPassword"
        }
    }
}


group 'de.xxx.libraries'
version '1.0-SNAPSHOT'

sourceCompatibility = 11
targetCompatibility = 11


dependencies {
    compileOnly 'org.projectlombok:lombok:1.18.8'
    annotationProcessor 'org.projectlombok:lombok:1.18.8'

    compile group: 'com.google.guava', name: 'guava', version: '28.0-jre'
    compile group: 'org.joda', name: 'joda-money', version: '1.0.1'
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
    compile group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'

    testCompile group: 'org.assertj', name: 'assertj-core', version: '3.12.2'
    testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.5.0'
    testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.5.0'


}

task sourcesJar(type: Jar, dependsOn:classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

artifacts {
    archives sourcesJar
}

uploadArchives {
    repositories {
        mavenDeployer {

            repository(url: "${nexusUrl}/content/repositories/xxx-trading-release") {
                pom.artifactId = 'xxx-trading-release'
                authentication(userName: nexusUsername, password: nexusPassword)

                pom.version='0.0.1-RELEASE'
                pom.artifactId='xxx-trading-release'
                pom.groupId ='de.xxx.components'

            }


            snapshotRepository(url: "${nexusUrl}/content/repositories/xxx-trading-snapshot") {
                pom.artifactId = 'xxx-trading-snapshot'
                authentication(userName: nexusUsername, password: nexusPassword)

                pom.version='0.0.1-SNAPSHOT'
                pom.artifactId='xxx-trading-snapshot'
                pom.groupId ='de.xxx.components'
            }
        }
    }
}

私はまた、ビルドフォルダを削除し、クラスファイルが生成されるかどうかをチェックし、これは罰金を動作します。新しいクラスファイルはその後あります。誰任意のアイデアは、私はここで間違ってやっているしているでしょうか?私はGradleの5.2.1とJavaの11を使用しています。

編集:それはinteruptsようにそれがjava.lang.Objectのを見つけることができなかったので、それはそうです:

23:10:45.359 [DEBUG] [TestEventLogger] Gradle Test Run :test STARTED
23:10:45.370 [DEBUG] [org.gradle.api.internal.tasks.testing.detection.AbstractTestFrameworkDetector] test-class-scan : failed to scan parent class java/lang/Object, could not find the class file
23:10:45.371 [DEBUG] [org.gradle.api.internal.tasks.testing.detection.AbstractTestFrameworkDetector] test-class-scan : failed to scan parent class java/lang/Object, could not find the class file
23:10:45.371 [DEBUG] [TestEventLogger]
23:10:45.371 [DEBUG] [TestEventLogger] Gradle Test Run :test PASSED 
jarnbjo:

あなたのテスト構成でJUnitのサポートを有効にする必要があります。JUnitの5のために、あなたのGradleビルドファイルに次の行を追加します。

test {
    useJUnitPlatform()
}

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

Gradleはテストを実行しません

Gradleファイルはテストを実行していません

PHPunitはTravisCIでテストを実行しません

Robolectric 4.0.2テストは、NoSuchMethodErrorを使用してgradle 3.2.1で実行されていません:setUseLegacyResources(Z)V

テストの実行はxpathで停止し、Seleniumを続行できません

Mavenで単一のテストを実行する->テストは実行されませんでした!

「mvncleaninstall」はテストを実行しますが、「mvncleansite」は実行しません

テストで phantomjs を実行できませんでした

GradleでキュウリのJUnitテストを実行できません

SpringBootはユニットテストを実行しません

Pytest-テストは実行されませんでした

テストは実行されませんでした!laravel 5.4

Pytest:テストは実行されませんでした

nunit-consoleはTestCaseおよびTestCaseSourceでテストを実行しません

カルマはテストを実行していません

MavenはJUnit5テストを実行しません

Python unittestはテストを実行しません

Mavenはテストを実行しません

FirefoxとIEは内部テキストを実行しません

Play Framework(2.1.3)はテストを実行しません

VSTest.Console.Exeはテストを実行しません

鼻はテストを実行しません

Mavenはセレンテストを実行しません

PyTestはテストを実行しません

Odoo9はテストを実行していません

分度器のテストは合格ですが、テストを実行しませんでした

シェルコマンドをgradleで実行しますが、タスク内では実行しません

Gradle + Springプロジェクトはjlinkしますが、IDE内でgradleを使用して実行しません

Gradleはタスクを実行しません

TOP 一覧

  1. 1

    セレンのモデルダイアログからテキストを抽出するにはどうすればよいですか?

  2. 2

    Modbus Python Schneider PM5300

  3. 3

    Ansibleで複数行のシェルスクリプトを実行する方法

  4. 4

    tkinterウィンドウを閉じてもPythonプログラムが終了しない

  5. 5

    どのように関係なく、それがどのように「悪い」、すべてのSSL証明書でのHttpClientを使用しないように

  6. 6

    インデックス作成時のドキュメントの順序は、Elasticsearchの検索パフォーマンスを向上させますか?

  7. 7

    ラベルとエントリがpythontkinterに表示されないのはなぜですか?

  8. 8

    Chromeウェブアプリのウェブビューの高さの問題

  9. 9

    パンダは異なる名前の列に追加します

  10. 10

    GoDaddyでのCKEditorとKCfinderの画像プレビュー

  11. 11

    Elasticsearch - あいまい検索は、提案を与えていません

  12. 12

    変数値を含むElasticSearch検索結果

  13. 13

    グラフ(.PNG)ファイルをエクスポートするZabbix

  14. 14

    Elasticsearchの場合、間隔を空けた単語を使用したワイルドカード検索

  15. 15

    モーダルダイアログを自動的に閉じる-サーバーコードが完了したら、Googleスプレッドシートのダイアログを閉じます

  16. 16

    mutate_allとifelseを組み合わせるにはどうすればよいですか

  17. 17

    Windows 10 Pro 1709を1803、1809、または1903に更新しますか?

  18. 18

    Elasticsearchでサーバー操作を最適化:低いディスク透かしに対処する

  19. 19

    テキストフィールドの値に基づいて UIslider を移動します

  20. 20

    ネットワークグラフで、ネットワークコンポーネントにカーソルを合わせたときに、それらを強調表示するにはどうすればよいですか?

  21. 21

    Unity:未知のスクリプトをGameObject(カスタムエディター)に動的にアタッチする方法

ホットタグ

アーカイブ