-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Th2-5226] added integration test #123
Merged
Merged
Changes from 42 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
03123a6
[TH2-5226] moved kotlin files to the src/kotlin dir
Nikita-Smirnov-Exactpro a19d4b5
[TH2-5226] Added RabbitMQGcTask
Nikita-Smirnov-Exactpro 04e15b9
[TH2-5226] Updated libraries
Nikita-Smirnov-Exactpro a565d2d
[TH2-5226] Implemented RabbitMQGcTask.deleteRedundantExchanges
Nikita-Smirnov-Exactpro 17879e0
[TH2-5226] added configure logging method
Nikita-Smirnov-Exactpro 1add5b3
[TH2-5226] Refactored
Nikita-Smirnov-Exactpro 98b1655
[TH2-5226] added wrapper closure into build script
Nikita-Smirnov-Exactpro d34bbb3
[TH2-5226] moved kotlin files to the src/kotlin dir
Nikita-Smirnov-Exactpro 9391349
[TH2-5226] Added `rabbitMQManagement.cleanUpOnStart` option
Nikita-Smirnov-Exactpro bd6c67b
[TH2-5226] Corrected GitHub workflow
Nikita-Smirnov-Exactpro 3e4130c
Merge remote-tracking branch 'origin/TH2-5226-hotfix-2' into TH2-5226
Nikita-Smirnov-Exactpro 0b04c17
[TH2-5226] registered exception handler for informers
Nikita-Smirnov-Exactpro c4041b9
[TH2-5226] added deleteRabbitMQRubbish method
Nikita-Smirnov-Exactpro a6d9014
[TH2-5226] set true for clearOnStart by default
Nikita-Smirnov-Exactpro ada9bf0
[TH2-5226] refactored
Nikita-Smirnov-Exactpro 34816d5
Merge remote-tracking branch 'origin/master' into TH2-5226
Nikita-Smirnov-Exactpro 1bc6904
[TH2-5226] corrected after review
Nikita-Smirnov-Exactpro 2e47d42
[TH2-5226] refactored after review
Nikita-Smirnov-Exactpro 123585d
Update src/main/kotlin/com/exactpro/th2/infraoperator/util/RabbitMQUt…
Nikita-Smirnov-Exactpro b359882
[TH2-5226] Updated kotlin logging to 5.1.4
Nikita-Smirnov-Exactpro 879d17b
[TH2-5226] Added IntegrationTest
Nikita-Smirnov-Exactpro 152af53
[TH2-5226] Added topic exchange test at the start of integration test
Nikita-Smirnov-Exactpro 0fec9a0
[TH2-5226] Added create namespace test
Nikita-Smirnov-Exactpro a57b19a
[TH2-5226] Delete namespace after test
Nikita-Smirnov-Exactpro c7cf794
[TH2-5226] Added namespace configmaps into integration test
Nikita-Smirnov-Exactpro c3bb543
[TH2-5226] Refactored
Nikita-Smirnov-Exactpro 5dff0ee
[TH2-5226] Prepared base IntegrationTest
Nikita-Smirnov-Exactpro 8119b34
[TH2-5226] Updated test
Nikita-Smirnov-Exactpro 9986b5e
[TH2-5226] added integration-tests.yml
Nikita-Smirnov-Exactpro 3410e21
[TH2-5226] added dictionary test
Nikita-Smirnov-Exactpro a8d0ef3
[TH2-5226] added 'disable component (min configuration)' test
Nikita-Smirnov-Exactpro 33a9a29
Merge remote-tracking branch 'origin/master' into TH2-5226-integratio…
Nikita-Smirnov-Exactpro 39704a4
[TH2-5226] added 'enable component (min configuration)' test
Nikita-Smirnov-Exactpro ff3beb6
[TH2-5226] refactored
Nikita-Smirnov-Exactpro c1c9dca
[TH2-5226] corrected after review
Nikita-Smirnov-Exactpro bb4731c
[TH2-5226] refactored
Nikita-Smirnov-Exactpro 87c6370
[TH2-5226] corrected after review
Nikita-Smirnov-Exactpro 0a45dff
[TH2-5226] corrected after review
Nikita-Smirnov-Exactpro f2f35d6
[TH2-5226] corrected after review
Nikita-Smirnov-Exactpro 5dc5513
[TH2-5226] added mq link test
Nikita-Smirnov-Exactpro 0187cd0
[TH2-5226] added grpc link test
Nikita-Smirnov-Exactpro 20ef110
[TH2-5226] corrected after review
Nikita-Smirnov-Exactpro 1555413
[TH2-5226] added DeleteRubbishOnStartTest
Nikita-Smirnov-Exactpro b409e5b
[TH2-5226] Removed singletons (#124)
Nikita-Smirnov-Exactpro a77dd93
[TH2-5226] Enabled style check
Nikita-Smirnov-Exactpro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 4 additions & 10 deletions
14
.github/workflows/java-publish-docker.yml → .github/workflows/build-dev-release.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Build and publish release Docker image to Github Container Registry ghcr.io | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build: | ||
uses: th2-net/.github/.github/workflows/compound-java.yml@main | ||
with: | ||
build-target: 'Docker' | ||
devRelease: false | ||
createTag: true | ||
docker-username: ${{ github.actor }} | ||
secrets: | ||
docker-password: ${{ secrets.GITHUB_TOKEN }} | ||
nvd-api-key: ${{ secrets.NVD_APIKEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: "Run integration tests for LDP" | ||
|
||
on: | ||
push: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 'zulu' '11' | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Build with Gradle | ||
run: ./gradlew --info clean integrationTest | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: integration-test-results | ||
path: build/reports/tests/integrationTest/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,9 @@ | ||
FROM gradle:7.6-jdk11 AS build | ||
FROM gradle:8.7-jdk11 AS build | ||
ARG app_version=0.0.0 | ||
COPY ./ . | ||
RUN gradle build -Prelease_version=${app_version} | ||
RUN gradle --no-daemon clean build dockerPrepare -Prelease_version=${release_version} | ||
|
||
RUN mkdir /home/app | ||
RUN cp ./build/libs/*.jar /home/app/application.jar | ||
|
||
FROM eclipse-temurin:11-alpine | ||
COPY --from=build /home/app /home/app | ||
|
||
WORKDIR /home/app/ | ||
ENTRYPOINT ["java", "-Dlog4j2.configurationFile=file:/var/th2/config/log4j2.properties", "-jar", "/home/app/application.jar"] | ||
FROM adoptopenjdk/openjdk11:alpine | ||
WORKDIR /home | ||
COPY --from=build /home/gradle/build/docker . | ||
ENTRYPOINT ["/home/service/bin/service", "/var/th2/config/log4j2.properties"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,141 +1,112 @@ | ||
/* | ||
* Copyright 2020-2021 Exactpro (Exactpro Systems Limited) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
plugins { | ||
id 'java' | ||
id 'checkstyle' | ||
id "io.gitlab.arturbosch.detekt" version "${detekt_version}" | ||
id "org.jetbrains.kotlin.jvm" version "${kotlin_version}" | ||
id "org.owasp.dependencycheck" version "${owaspVersion}" | ||
id 'application' | ||
// id 'checkstyle' | ||
// alias(libs.plugins.detekt) | ||
alias(libs.plugins.kotlin) | ||
alias(libs.plugins.th2.component) | ||
alias(libs.plugins.download) | ||
} | ||
|
||
group = 'com.exactpro.th2' | ||
version = release_version | ||
|
||
repositories { | ||
mavenCentral() | ||
kotlin { | ||
jvmToolchain(11) | ||
} | ||
|
||
checkstyle { | ||
toolVersion = "10.12.0" | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
detekt { | ||
buildUponDefaultConfig = true | ||
autoCorrect = true | ||
config = files("$rootDir/config/detekt/detekt.yml") | ||
} | ||
//checkstyle { | ||
// toolVersion = "10.12.4" | ||
//} | ||
|
||
ext { | ||
uuid_generator_version = '4.2.0' | ||
okhttp_version = '4.10.0' | ||
fabric8_version = '6.6.2' | ||
rabbit_amqp_version = '5.16.0' | ||
rabbit_http_version = '5.0.0' | ||
kotlin_logging_version = '3.0.0' // 3.0.0 the las version supported 1.6.21 | ||
jetbrains_annotations_version = '24.0.1' | ||
mockito_version = '3.11.2' | ||
jupiter_version = '5.9.2' | ||
guava_version = '32.0.1-jre' | ||
snakeyaml_version = '2.0' | ||
} | ||
|
||
configurations.configureEach() { | ||
resolutionStrategy { | ||
force "com.google.guava:guava:$guava_version" | ||
force "org.yaml:snakeyaml:$snakeyaml_version" | ||
} | ||
} | ||
//detekt { | ||
// buildUponDefaultConfig = true | ||
// autoCorrect = true | ||
// config.setFrom("$rootDir/config/detekt/detekt.yml") | ||
//} | ||
|
||
dependencies { | ||
api platform('com.exactpro.th2:bom:4.3.0') | ||
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml" | ||
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin' | ||
implementation "com.fasterxml.uuid:java-uuid-generator:${uuid_generator_version}" | ||
|
||
implementation "com.squareup.okhttp3:okhttp:${okhttp_version}" | ||
implementation "com.fasterxml.jackson.module:jackson-module-kotlin" | ||
implementation libs.java.uuid.generator | ||
|
||
implementation "org.apache.commons:commons-text" | ||
|
||
implementation "io.fabric8:kubernetes-client:${fabric8_version}" | ||
implementation "com.rabbitmq:amqp-client:${rabbit_amqp_version}" | ||
implementation "com.rabbitmq:http-client:${rabbit_http_version}" | ||
implementation libs.kubernetes.client | ||
implementation(libs.okhttp) { | ||
because "okhttp:3.12.12 has vulnerabilities" | ||
} | ||
implementation(libs.logging.interceptor) { | ||
because "logging-interceptor:3.12.12 has vulnerabilities" | ||
} | ||
|
||
implementation "org.slf4j:slf4j-api" | ||
implementation "org.apache.logging.log4j:log4j-slf4j2-impl" | ||
implementation "org.apache.logging.log4j:log4j-core" | ||
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlin_logging_version | ||
implementation "com.rabbitmq:amqp-client" | ||
implementation libs.http.client | ||
|
||
implementation "org.jetbrains:annotations:${jetbrains_annotations_version}" | ||
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl' | ||
implementation 'org.apache.logging.log4j:log4j-core' | ||
implementation libs.kotlin.logging | ||
implementation "org.jetbrains:annotations" | ||
|
||
implementation "io.prometheus:simpleclient" | ||
implementation "io.prometheus:simpleclient_httpserver" | ||
implementation "io.prometheus:simpleclient_hotspot" | ||
|
||
testImplementation group: 'org.mockito', name: 'mockito-core', version: "${mockito_version}" | ||
testImplementation(platform(libs.testcontainers.bom)) | ||
testImplementation 'org.testcontainers:rabbitmq' | ||
testImplementation 'org.testcontainers:k3s' | ||
|
||
testImplementation "org.junit.jupiter:junit-jupiter-api:${jupiter_version}" | ||
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${jupiter_version}" | ||
|
||
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:${detekt_version}") | ||
} | ||
|
||
dependencyCheck { | ||
formats=['SARIF', 'JSON', 'HTML'] | ||
failBuildOnCVSS=5 | ||
testImplementation libs.mockito.core | ||
testImplementation libs.mockito.kotlin | ||
testImplementation libs.junit.jupiter | ||
testImplementation libs.junit.jupiter.params | ||
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5" | ||
testImplementation libs.bcpkix.jdk18on | ||
testImplementation libs.awaitility | ||
testImplementation libs.strikt.core | ||
|
||
analyzers { | ||
assemblyEnabled = false | ||
nugetconfEnabled = false | ||
nodeEnabled = false | ||
} | ||
// detektPlugins libs.detekt.formatting | ||
} | ||
|
||
jar { | ||
duplicatesStrategy = DuplicatesStrategy.INCLUDE | ||
manifest { | ||
attributes( | ||
'Created-By': "${System.getProperty('java.version')} (${System.getProperty('java.vendor')})", | ||
'Specification-Title': '', | ||
'Specification-Vendor': 'Exactpro Systems LLC', | ||
'Main-Class': 'com.exactpro.th2.infraoperator.Th2CrdController', | ||
'Implementation-Title': project.archivesBaseName, | ||
'Implementation-Vendor': 'Exactpro Systems LLC', | ||
'Implementation-Vendor-Id': 'com.exactpro', | ||
'Implementation-Version': project.version | ||
) | ||
} | ||
|
||
from { | ||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } | ||
} | ||
wrapper { | ||
version '8.7' | ||
distributionType Wrapper.DistributionType.BIN | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
useJUnitPlatform { | ||
excludeTags("integration-test") | ||
} | ||
} | ||
|
||
compileKotlin { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
} | ||
tasks.register("downloadCRDs", Download) { | ||
group = "verification" | ||
src([ | ||
'https://raw.githubusercontent.com/th2-net/th2-infra/master/chart/crds/th2-box-crd.yaml', | ||
'https://raw.githubusercontent.com/th2-net/th2-infra/master/chart/crds/th2-core-box-crd.yaml', | ||
'https://raw.githubusercontent.com/th2-net/th2-infra/master/chart/crds/th2-dictionary-crd.yaml', | ||
'https://raw.githubusercontent.com/th2-net/th2-infra/master/chart/crds/th2-estore-crd.yaml', | ||
'https://raw.githubusercontent.com/th2-net/th2-infra/master/chart/crds/th2-job-crd.yaml', | ||
'https://raw.githubusercontent.com/th2-net/th2-infra/master/chart/crds/th2-mstore-crd.yaml', | ||
]) | ||
dest layout.buildDirectory.dir('resources/test/crds').get() | ||
} | ||
|
||
compileTestKotlin { | ||
kotlinOptions { | ||
jvmTarget = "11" | ||
tasks.register("integrationTest", Test) { | ||
group = "verification" | ||
dependsOn("downloadCRDs") | ||
useJUnitPlatform { | ||
includeTags("integration-test") | ||
} | ||
testLogging { | ||
showStandardStreams = true | ||
} | ||
} | ||
|
||
dependencyCheck { | ||
skipConfigurations += "checkstyle" | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: why have you removed those plugins? We should keep the style checkers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will revert these checks at the end but now they are bothering me