From eeb5c78d6f4722e4a26ff667d1740bd32d9e4dcb Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Sun, 9 Jan 2022 15:35:54 +0100 Subject: [PATCH] Moved tests from spotbugs project to spotbugs-tests project The only change except moving sources is to configure two unstable tests run before all other tests - this avoids the failure that can't be observed if running tests one by one. Fixes #1914 --- CHANGELOG.md | 1 + spotbugs-tests/build.gradle | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be8c79183c3..b522d934747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Currently the versioning policy of this project follows [Semantic Versioning v2. ## Unreleased - 2022-??-?? ### Fixed - Fixed spotbugs build with ecj compiler ([#1903](https://github.com/spotbugs/spotbugs/issues/1903)) +- Moved tests from spotbugs project to spotbugs-tests project ([#1914](https://github.com/spotbugs/spotbugs/issues/1914)) ## 4.5.3 - 2022-01-04 ### Security diff --git a/spotbugs-tests/build.gradle b/spotbugs-tests/build.gradle index 8e3da2c3641..526def86c92 100644 --- a/spotbugs-tests/build.gradle +++ b/spotbugs-tests/build.gradle @@ -35,9 +35,24 @@ tasks.named('jacocoTestReport', JacocoReport).configure { additionalClassDirs.setFrom files(project(':spotbugs').sourceSets.main.output.classesDirs) } -tasks.named('test').configure { - dependsOn ':spotbugsTestCases:build' - maxHeapSize = '2G' +// Tests below fail if executed with other tests +// So we run them before all other tests are executed +task unstableTest(type: Test) { + filter { + includeTestsMatching "PlaceholderTest" + includeTestsMatching "MutableClassesTest" + } + testLogging { + events "passed", "skipped", "failed" + } +} + +test { + dependsOn ':spotbugsTestCases:build', 'unstableTest' + filter { + excludeTestsMatching "PlaceholderTest" + excludeTestsMatching "MutableClassesTest" + } } spotbugs {