Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dmp 3357 performance improvements #458

Merged
merged 48 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ef5b0c3
initial commit
mestebanez Jul 1, 2024
f5e86e4
Compilable code
mestebanez Jul 2, 2024
a2fc890
Correct static code analysis changes
mestebanez Jul 2, 2024
6f6fb1b
Added rudimentary performance framework using jmeter api
mestebanez Jul 3, 2024
82c100b
Finalise the functional performance test
mestebanez Jul 4, 2024
3e6c80b
Small correction
mestebanez Jul 4, 2024
5eb9b64
Merge branch 'master' into DMP-3357-Performance-Improvements
mestebanez Jul 4, 2024
759a436
Small correction
mestebanez Jul 4, 2024
b4028a8
Temporarily Disable docker integration tests
mestebanez Jul 4, 2024
472d52f
Add sonar qube ignore
mestebanez Jul 4, 2024
99c1507
Remove tear down
mestebanez Jul 4, 2024
d50d487
Do not call on the test endpoint
mestebanez Jul 4, 2024
0d19ae0
Re add clear down endpoint
mestebanez Jul 4, 2024
3e82cfd
Sonar qube changes
mestebanez Jul 4, 2024
8294f84
Merge branch 'master' into DMP-3357-Performance-Improvements
mestebanez Jul 8, 2024
02c9845
Fixing redis image for test containers and re-enabling tests (#460)
davet1985 Jul 9, 2024
590780f
Update plugin io.spring.dependency-management to v1.1.6 (#463)
renovate[bot] Jul 9, 2024
76a9c15
DMP-3506 Correct log message (#462)
jackmaloney Jul 9, 2024
a4799e7
dmp-3356: increase Cache expiry time (#465)
hemantasharma1129 Jul 10, 2024
87b6424
DMP-1557 Upgrade Java version to 21 (#464)
jackmaloney Jul 10, 2024
3b62f99
Merge branch 'master' into DMP-3357-Performance-Improvements
mestebanez Jul 10, 2024
33e8ca9
Disable the tests
mestebanez Jul 11, 2024
00d43c6
test with hard coded url
mestebanez Jul 11, 2024
6383c84
Comment our docker execution
mestebanez Jul 11, 2024
0e6c9bf
add logging
mestebanez Jul 11, 2024
3e4c74e
Correct test url
mestebanez Jul 11, 2024
82166cc
Correct test url
mestebanez Jul 11, 2024
46cf36f
Correct test url
mestebanez Jul 11, 2024
157d233
Attempt to get performance tests working
mestebanez Jul 11, 2024
b759c03
Attempt to get performance tests working
mestebanez Jul 11, 2024
5cd1304
Attempt to get performance tests working
mestebanez Jul 11, 2024
66769a1
Attempt to get performance tests working
mestebanez Jul 11, 2024
6b2f147
Merge master
mestebanez Jul 12, 2024
14c7464
Readd the clear redis cache
mestebanez Jul 12, 2024
ea6a4eb
raise performance values
mestebanez Jul 12, 2024
6d3dd4e
Log why cleanup isnt working
mestebanez Jul 12, 2024
0159567
Inject properties
mestebanez Jul 12, 2024
d5dacd5
Inject properties
mestebanez Jul 12, 2024
3980735
Inject properties
mestebanez Jul 12, 2024
9918f75
Inject properties
mestebanez Jul 12, 2024
f63900a
Inject properties
mestebanez Jul 12, 2024
9664f76
Inject properties
mestebanez Jul 12, 2024
cfb3165
Inject properties
mestebanez Jul 12, 2024
70df4e9
Adjust performance criteria
mestebanez Jul 15, 2024
260eebf
Adjust performance criteria
mestebanez Jul 15, 2024
1a308c9
Adjust performance criteria
mestebanez Jul 15, 2024
04a7025
Merge master
mestebanez Jul 15, 2024
3e0b5ae
Chnage test criteria
mestebanez Jul 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,30 @@ def secrets = [
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('AzureAdB2CClientId', 'AAD_B2C_CLIENT_ID'),
secret('ExternalServiceBasicAuthorisationWhitelist', 'EXTERNAL_SERVICE_BASIC_AUTHORISATION_WHITELIST'),
],
secret('ViQExternalUserName', 'VIQ_EXTERNAL_USER_NAME'),
secret('ViQExternalPassword', 'VIQ_EXTERNAL_PASSWORD'),
secret('ViQInternalPassword', 'VIQ_INTERNAL_PASSWORD'),

secret('XhibitExternalUserName', 'XHIBIT_EXTERNAL_USER_NAME'),
secret('XhibitExternalPassword', 'XHIBIT_EXTERNAL_PASSWORD'),
secret('XhibitInternalPassword', 'XHIBIT_INTERNAL_PASSWORD'),

secret('CPExternalUserName', 'CP_EXTERNAL_USER_NAME'),
secret('CPExternalPassword', 'CP_EXTERNAL_PASSWORD'),
secret('CPInternalPassword', 'CP_INTERNAL_PASSWORD'),

secret('AzureAdB2CFuncTestROPCClientId', 'AAD_B2C_ROPC_CLIENT_ID'),
secret('AzureAdB2CFuncTestROPCUsername', 'FUNC_TEST_ROPC_USERNAME'),
secret('AzureAdB2CFuncTestROPCPassword', 'FUNC_TEST_ROPC_PASSWORD'),
secret('AzureAdB2CFuncTestROPCClientId', 'AAD_B2C_ROPC_CLIENT_ID'),
secret('AzureAdB2CFuncTestROPCClientSecret', 'AAD_B2C_ROPC_CLIENT_SECRET')
]
]





static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
[$class : 'AzureKeyVaultSecret',
secretType : 'Secret',
Expand All @@ -31,4 +52,3 @@ withPipeline(type, product, component) {

syncBranchesWithMaster(branchesToSync)
}

23 changes: 20 additions & 3 deletions Jenkinsfile_nightly
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,26 @@ def component = "gateway"

def secrets = [
'darts-${env}': [
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('AzureAdB2CClientId', 'AAD_B2C_CLIENT_ID'),
secret('ExternalServiceBasicAuthorisationWhitelist', 'EXTERNAL_SERVICE_BASIC_AUTHORISATION_WHITELIST'),
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('AzureAdB2CClientId', 'AAD_B2C_CLIENT_ID'),
secret('ExternalServiceBasicAuthorisationWhitelist', 'EXTERNAL_SERVICE_BASIC_AUTHORISATION_WHITELIST'),
secret('ViQExternalUserName', 'VIQ_EXTERNAL_USER_NAME'),
secret('ViQExternalPassword', 'VIQ_EXTERNAL_PASSWORD'),
secret('ViQInternalPassword', 'VIQ_INTERNAL_PASSWORD'),

secret('XhibitExternalUserName', 'XHIBIT_EXTERNAL_USER_NAME'),
secret('XhibitExternalPassword', 'XHIBIT_EXTERNAL_PASSWORD'),
secret('XhibitInternalPassword', 'XHIBIT_INTERNAL_PASSWORD'),

secret('CPExternalUserName', 'CP_EXTERNAL_USER_NAME'),
secret('CPExternalPassword', 'CP_EXTERNAL_PASSWORD'),
secret('CPInternalPassword', 'CP_INTERNAL_PASSWORD'),

secret('AzureAdB2CFuncTestROPCClientId', 'AAD_B2C_ROPC_CLIENT_ID'),
secret('AzureAdB2CFuncTestROPCUsername', 'FUNC_TEST_ROPC_USERNAME'),
secret('AzureAdB2CFuncTestROPCPassword', 'FUNC_TEST_ROPC_PASSWORD'),
secret('AzureAdB2CFuncTestROPCClientId', 'AAD_B2C_ROPC_CLIENT_ID'),
secret('AzureAdB2CFuncTestROPCClientSecret', 'AAD_B2C_ROPC_CLIENT_SECRET'),
],
]

Expand Down
24 changes: 20 additions & 4 deletions Jenkinsfile_parameterized
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,26 @@ def component = "gateway"

def secrets = [
'darts-${env}': [
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('AzureAdB2CClientId', 'AAD_B2C_CLIENT_ID'),
secret('ExternalServiceBasicAuthorisationWhitelist', 'EXTERNAL_SERVICE_BASIC_AUTHORISATION_WHITELIST'),
],
secret('app-insights-connection-string', 'app-insights-connection-string'),
secret('AzureAdB2CClientId', 'AAD_B2C_CLIENT_ID'),
secret('ExternalServiceBasicAuthorisationWhitelist', 'EXTERNAL_SERVICE_BASIC_AUTHORISATION_WHITELIST'),
secret('ViQExternalUserName', 'VIQ_EXTERNAL_USER_NAME'),
secret('ViQExternalPassword', 'VIQ_EXTERNAL_PASSWORD'),
secret('ViQInternalPassword', 'VIQ_INTERNAL_PASSWORD'),

secret('XhibitExternalUserName', 'XHIBIT_EXTERNAL_USER_NAME'),
secret('XhibitExternalPassword', 'XHIBIT_EXTERNAL_PASSWORD'),
secret('XhibitInternalPassword', 'XHIBIT_INTERNAL_PASSWORD'),

secret('CPExternalUserName', 'CP_EXTERNAL_USER_NAME'),
secret('CPExternalPassword', 'CP_EXTERNAL_PASSWORD'),
secret('CPInternalPassword', 'CP_INTERNAL_PASSWORD'),

secret('AzureAdB2CFuncTestROPCClientId', 'AAD_B2C_ROPC_CLIENT_ID'),
secret('AzureAdB2CFuncTestROPCUsername', 'FUNC_TEST_ROPC_USERNAME'),
secret('AzureAdB2CFuncTestROPCPassword', 'FUNC_TEST_ROPC_PASSWORD'),
secret('AzureAdB2CFuncTestROPCClientId', 'AAD_B2C_ROPC_CLIENT_ID'),
secret('AzureAdB2CFuncTestROPCClientSecret', 'AAD_B2C_ROPC_CLIENT_SECRET') ],
]

static LinkedHashMap<String, Object> secret(String secretName, String envVar) {
Expand Down
80 changes: 68 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ configurations.all {
exclude group: 'org.bouncycastle', module: 'bcpkix-jdk15on'
exclude group: 'org.bouncycastle', module: 'bcprov-jdk15on' // bcprov-jdk15on-1.69.jar CVE-2023-33201
exclude group: 'org.bouncycastle', module: 'bcutil-jdk15on'

resolutionStrategy.capabilitiesResolution.withCapability('org.codehaus.groovy:groovy-json') {
selectHighestVersion()
}
resolutionStrategy.capabilitiesResolution.withCapability('org.codehaus.groovy:groovy-xml') {
selectHighestVersion()
}
resolutionStrategy.capabilitiesResolution.withCapability('org.codehaus.groovy:groovy-jso') {
selectHighestVersion()
}
resolutionStrategy.capabilitiesResolution.withCapability('org.codehaus.groovy:groovy') {
selectHighestVersion()
}
}

configurations {
Expand All @@ -38,10 +51,25 @@ configurations {
}

sourceSets {
main {
java.srcDir "$buildDir/generated/openapi/src/main/java"
}

testCommon {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/testCommon/java')
}
resources.srcDir file('src/testCommon/resources')
}

functionalTest {
java {
compileClasspath += main.output
compileClasspath += testCommon.output
runtimeClasspath += main.output
runtimeClasspath += testCommon.output
srcDir file('src/functionalTest/java')
}
resources.srcDir file('src/functionalTest/resources')
Expand All @@ -50,7 +78,9 @@ sourceSets {
integrationTest {
java {
compileClasspath += main.output
compileClasspath += testCommon.output
runtimeClasspath += main.output
runtimeClasspath += testCommon.output
srcDir file('src/integrationTest/java')
}
resources.srcDir file('src/integrationTest/resources')
Expand All @@ -64,6 +94,17 @@ sourceSets {
}
resources.srcDir file('src/smokeTest/resources')
}

test {
java {
compileClasspath += main.output
compileClasspath += testCommon.output
runtimeClasspath += main.output
runtimeClasspath += testCommon.output
srcDir file('src/test/java')
}
resources.srcDir file('src/test/resources')
}
}

idea {
Expand All @@ -74,14 +115,18 @@ idea {
testResources.from(sourceSets.functionalTest.resources.srcDirs)
testSources.from(sourceSets.smokeTest.allSource.srcDirs)
testResources.from(sourceSets.smokeTest.resources.srcDirs)
testSources.from(sourceSets.testCommon.allSource.srcDirs)
testResources.from(sourceSets.testCommon.resources.srcDirs)
}
}

configurations {
functionalTestImplementation.extendsFrom testImplementation
testCommonImplementation.extendsFrom testImplementation

functionalTestImplementation.extendsFrom testCommonImplementation
functionalTestRuntimeOnly.extendsFrom runtimeOnly

integrationTestImplementation.extendsFrom testImplementation
integrationTestImplementation.extendsFrom testCommonImplementation
integrationTestRuntimeOnly.extendsFrom runtimeOnly

smokeTestImplementation.extendsFrom testImplementation
Expand Down Expand Up @@ -181,8 +226,9 @@ def sonarExclusions = [
'**/enums/**',
'**/DocumentumIdToJwtCache*',
'**/CacheValueWithJwt*',
'**/com/service/viq/event/**'

'**/com/service/viq/event/**',
'**/uk/gov/hmcts/darts/cache/token/service/**',
'**/uk/gov/hmcts/darts/test/**'
]

sonarqube {
Expand Down Expand Up @@ -301,6 +347,7 @@ sourceSets {
}

dependencies {
implementation group: 'io.rest-assured', name: 'rest-assured'
implementation 'org.apache.tomcat.embed:tomcat-embed-core:10.1.25'
implementation 'org.apache.tomcat.embed:tomcat-embed-websocket:10.1.25'
implementation 'org.apache.tomcat.embed:tomcat-embed-el:10.1.25'
Expand Down Expand Up @@ -356,17 +403,13 @@ dependencies {
}
}

implementation group: 'io.rest-assured', name: 'rest-assured'
implementation 'org.zalando:problem-spring-web-starter:0.29.1'
implementation 'org.apache.commons:commons-collections4:4.4'

implementation 'org.mapstruct:mapstruct:1.5.5.Final'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
implementation group: 'org.apache.xmlbeans', name: 'xmlbeans', version: '5.2.1'


implementation project(path: ':context')

// https://mvnrepository.com/artifact/org.apache.ws.xmlschema/xmlschema-core
implementation group: 'org.apache.ws.xmlschema', name: 'xmlschema-core', version: '2.3.1'
// https://mvnrepository.com/artifact/javax.mail/javax.mail-api
Expand All @@ -376,8 +419,10 @@ dependencies {
// https://mvnrepository.com/artifact/com.sun.mail/javax.mail
implementation group: 'com.sun.mail', name: 'javax.mail', version: '1.6.2'


implementation group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.9'
implementation project(path: ':context')
implementation 'javax.annotation:javax.annotation-api:1.3.2'

annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
Expand All @@ -389,20 +434,27 @@ dependencies {
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '5.2.0'
testImplementation group: 'org.springframework.ws', name: 'spring-ws-test', version: '4.0.11'
testImplementation group: 'commons-io', name: 'commons-io', version: '2.16.1'// CVE-2021-29425
testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-contract-stub-runner', version: '4.1.3'
testImplementation group: 'commons-collections', name: 'commons-collections', version: '3.2.2'
testImplementation 'org.xmlunit:xmlunit-core:2.10.0'
testImplementation 'org.xmlunit:xmlunit-matchers:2.10.0'
testImplementation 'org.testcontainers:testcontainers:1.19.8'
testImplementation 'org.springframework.boot:spring-boot-testcontainers'

testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-contract-stub-runner', version: '4.1.3'

testImplementation group: 'org.testcontainers', name: 'junit-jupiter', version: '1.19.8'
testImplementation 'it.ozimov:embedded-redis:0.7.3'
testImplementation 'io.github.hakky54:logcaptor:2.9.3'
testImplementation group: 'org.apache.jmeter', name: 'ApacheJMeter_core', version: '5.6.3', {
exclude group: 'org.codehaus.groovy', module: 'groovy-json'
exclude group: 'org.codehaus.groovy', module: 'groovy-xml'
exclude group: 'org.codehaus.groovy', module: 'groovy-jso'
exclude group: 'org.codehaus.groovy', module: 'groovy'
}

openapispec 'com.github.hmcts:darts-api:master-SNAPSHOT:openapi'
testImplementation group: 'org.apache.jmeter', name: 'ApacheJMeter_http', version: '5.6.3'


openapispec 'com.github.hmcts:darts-api:master-SNAPSHOT:openapi'
}

mainClassName = 'uk.gov.hmcts.darts.Application'
Expand Down Expand Up @@ -468,6 +520,10 @@ sourceSets {
}
}

tasks.named('processTestResources', Copy) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

task genJaxb {
ext.sourcesDir = "${buildDir}/generated-sources/jaxb"
ext.schema = "src/main/resources/schemas/dar-notify-event.xsd"
Expand Down
1 change: 1 addition & 0 deletions charts/darts-gateway/values.dev.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ java:
alias: EXTERNAL_SERVICE_BASIC_AUTHORISATION_WHITELIST
environment:
DARTS_API_URL: https://darts-api.staging.platform.hmcts.net
TESTING_SUPPORT_ENDPOINTS_ENABLED: true
1 change: 1 addition & 0 deletions charts/darts-gateway/values.stg.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ java:
ingressHost: ${SERVICE_FQDN}
environment:
DARTS_API_URL: https://darts-api.staging.platform.hmcts.net
TESTING_SUPPORT_ENDPOINTS_ENABLED: true
7 changes: 7 additions & 0 deletions docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ services:
- CP_EXTERNAL_PASSWORD
- CP_INTERNAL_PASSWORD
- EXTERNAL_SERVICE_BASIC_AUTHORISATION_WHITELIST
- REDIS_SSL_ENABLED=false
- TESTING_SUPPORT_ENDPOINTS_ENABLED=true
- REDIS_CONNECTION_STRING=redis://darts-redis:6379
- ACTIVE_DIRECTORY_B2C_BASE_URI=https://hmctsstgextid.b2clogin.com
- ACTIVE_DIRECTORY_B2C_AUTH_URI=https://hmctsstgextid.b2clogin.com/hmctsstgextid.onmicrosoft.com
- ACTIVE_DIRECTORY_B2C_ON_MICROSOFT_URI=https://hmctsstgextid.onmicrosoft.com
- AAD_B2C_TENANT_ID
ports:
- "8070:8070"
networks:
Expand Down
8 changes: 6 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ services:
- CP_EXTERNAL_PASSWORD
- CP_INTERNAL_PASSWORD
- EXTERNAL_SERVICE_BASIC_AUTHORISATION_WHITELIST
build:
- ACTIVE_DIRECTORY_B2C_BASE_URI
- ACTIVE_DIRECTORY_B2C_AUTH_URI
- ACTIVE_DIRECTORY_B2C_ON_MICROSOFT_URI
- AAD_B2C_TENANT_ID
build:
context: .
dockerfile: Dockerfile
image: darts-gateway:latest
image: darts-gateway:master
ports:
- "8070:8070"
networks:
Expand Down
Loading