Skip to content

Commit

Permalink
Removed unneeded task dependencies; Fixed copyExtraTestResources task
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Gudel <pawel.gudel@eliatra.com>
  • Loading branch information
pawel-gudel-eliatra committed Jun 16, 2023
1 parent 38e7a37 commit 163950a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
id: set-matrix
run: |
echo "separateTestsNames=$(./gradlew listTasksAsJSON -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT
echo "testsNamesExclude=$(./gradlew listTasksAsParam -q --console=plain | tail -n 1)" >> $GITHUB_OUTPUT
build:
name: build
Expand All @@ -51,7 +50,7 @@ jobs:
uses: gradle/gradle-build-action@v2
with:
arguments: |
build citest ${{ needs.generate-test-list.outputs.testsNamesExclude }} -Dbuild.snapshot=false
build citest -Dbuild.snapshot=false
-x integrationTest
-x spotlessCheck
-x checkstyleMain
Expand Down Expand Up @@ -111,7 +110,6 @@ jobs:
-x spotbugsMain
-x spotbugsIntegrationTest
-x checkstyleIntegrationTest
-x citest
-x test
- uses: actions/upload-artifact@v3
Expand Down
29 changes: 22 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,26 @@ test {
}
}

task copyExtraTestResources(dependsOn: testClasses) {

copy {
from 'src/test/resources'
into 'build/testrun/test/src/test/resources'
}

taskNames.each { testName ->
copy {
from 'src/test/resources'
into "build/testrun/${testName}/src/test/resources"
}
}

copy {
from 'src/test/resources'
into 'build/testrun/citest/src/test/resources'
}
}

task citest(type: Test) {
// onlyIf { !project.gradle.taskGraph.hasTask(':test') }
include '**/*.class'
Expand Down Expand Up @@ -233,6 +253,7 @@ task citest(type: Test) {
"sun.util.resources.provider.*"
]
}
dependsOn copyExtraTestResources
}

splitTestConfig.each{ testName, filterCfg ->
Expand Down Expand Up @@ -269,17 +290,11 @@ splitTestConfig.each{ testName, filterCfg ->
"sun.util.resources.provider.*"
]
}
dependsOn copyExtraTestResources
}
}

task copyExtraTestResources(dependsOn: testClasses) {
copy {
from 'src/test/resources'
into 'build/testrun/test/src/test/resources'
}
}
tasks.test.dependsOn(copyExtraTestResources)
tasks.citest.dependsOn(copyExtraTestResources, taskNames)

jacoco {
reportsDirectory = file("$buildDir/reports/jacoco")
Expand Down

0 comments on commit 163950a

Please sign in to comment.