Skip to content

Commit a22bd55

Browse files
fix int test dependencies not propogating
ingnore pmd run unless explicitly executed
1 parent 21062cd commit a22bd55

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ That’s absolutely fine — but if you do, make sure your approach meets the fo
1919
* Compliance & Policy Alignment – Services must align with HMCTS/MoJ policies (e.g. Coding in the Open, mandatory security practices).
2020
* Ownership & Support – Domain teams must clearly own the service, maintain a support model, and define escalation paths.
2121

22+
## Documentation
23+
24+
Further documentation can be found in the [docs](docs) directory.
25+
2226
## Installation
2327

2428
To get started with this project, you'll need Java and Gradle installed.

build.gradle

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ tasks.named('jacocoTestReport') {
146146
}
147147
}
148148

149+
tasks.named('check') {
150+
dependsOn tasks.named('integration')
151+
}
152+
149153
pmd {
150154
ruleSets = []
151155
ruleSetFiles = files(".github/pmd-ruleset.xml")
@@ -158,10 +162,12 @@ tasks.withType(Pmd) {
158162
html.required.set(true)
159163
}
160164
}
161-
162-
tasks.named('check') {
163-
dependsOn tasks.named('integration')
165+
tasks.named("pmdMain").configure {
166+
onlyIf { gradle.startParameter.taskNames.contains(name) }
164167
}
168+
tasks.named("pmdTest").configure { enabled = false }
169+
tasks.named("pmdIntegrationTest").configure { enabled = false }
170+
tasks.named("pmdPactVerificationTest").configure { enabled = false }
165171

166172
// check dependencies upon release ONLY
167173
tasks.named("dependencyUpdates").configure {
@@ -258,7 +264,7 @@ tasks.named('processPactVerificationTestResources') {
258264

259265
dependencies {
260266
implementation "uk.gov.hmcts.cp:api-cp-crime-schedulingandlisting-courtschedule:$apiCourtScheduleVersion"
261-
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.12'
267+
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.13'
262268
implementation 'io.swagger.core.v3:swagger-core:2.2.36'
263269
implementation 'javax.xml.bind:jaxb-api:2.3.1'
264270

@@ -301,4 +307,14 @@ dependencies {
301307

302308
testImplementation 'au.com.dius.pact.provider:junit5:4.6.17'
303309
testImplementation 'au.com.dius.pact.provider:spring6:4.6.17'
310+
311+
// integrationTestImplementation dependencies are need as they aren't always propagate as expected,
312+
// especially with platform BOMs, test runtime dependencies, or custom tasks. Explicit dependencies eliminate that risk.
313+
integrationTestImplementation platform('org.junit:junit-bom:5.13.4')
314+
integrationTestRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
315+
integrationTestImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '3.5.5', {
316+
exclude group: 'junit', module: 'junit'
317+
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
318+
}
319+
integrationTestRuntimeOnly 'org.junit.platform:junit-platform-launcher'
304320
}

0 commit comments

Comments
 (0)