Skip to content

Commit 8192352

Browse files
authored
chore: extract integration test into separate sub-module (#21846)
Signed-off-by: Michael Heinrichs <[email protected]>
1 parent 56f6c19 commit 8192352

30 files changed

+140
-26
lines changed

.github/workflows/node-flow-build-application.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,24 @@ jobs:
128128
codacy-project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
129129
codecov-token: ${{ secrets.CODECOV_TOKEN }}
130130

131+
mats-integration-tests:
132+
name: MATS - Integration Tests
133+
uses: ./.github/workflows/node-zxc-compile-application-code.yaml
134+
needs:
135+
- dependency-check
136+
- spotless
137+
with:
138+
custom-job-label: "MATS Integration Tests"
139+
java-version: ${{ github.event.inputs.java-version || '21.0.6' }}
140+
java-distribution: ${{ github.event.inputs.java-distribution || 'temurin' }}
141+
enable-unit-tests: false
142+
enable-integration-tests: ${{ github.event_name == 'push' || github.event.inputs.enable-unit-tests == 'true' }}
143+
enable-network-log-capture: true
144+
secrets:
145+
access-token: ${{ secrets.GITHUB_TOKEN }}
146+
gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }}
147+
gradle-cache-password: ${{ secrets.GRADLE_CACHE_PASSWORD }}
148+
131149
mats-hapi-tests-misc:
132150
name: MATS - HAPI Tests (Misc)
133151
uses: ./.github/workflows/node-zxc-compile-application-code.yaml
@@ -364,6 +382,7 @@ jobs:
364382
runs-on: hiero-citr-linux-medium
365383
needs:
366384
- mats-unit-tests
385+
- mats-integration-tests
367386
- mats-hapi-tests-misc
368387
- mats-hapi-tests-misc-records
369388
- mats-hapi-tests-crypto
@@ -379,6 +398,7 @@ jobs:
379398
- mats-docker-determinism
380399
if: ${{ (github.event_name == 'push') &&
381400
needs.mats-unit-tests.result == 'success' &&
401+
needs.mats-integration-tests.result == 'success' &&
382402
needs.mats-hapi-tests-misc.result == 'success' &&
383403
needs.mats-hapi-tests-misc-records.result == 'success' &&
384404
needs.mats-hapi-tests-crypto.result == 'success' &&
@@ -419,6 +439,7 @@ jobs:
419439
- dependency-check
420440
- spotless
421441
- mats-unit-tests
442+
- mats-integration-tests
422443
- mats-hapi-tests-misc
423444
- mats-hapi-tests-misc-records
424445
- mats-hapi-tests-crypto
@@ -437,6 +458,7 @@ jobs:
437458
needs.dependency-check.result != 'success' ||
438459
needs.spotless.result != 'success' ||
439460
needs.mats-unit-tests.result != 'success' ||
461+
needs.mats-integration-tests.result != 'success' ||
440462
needs.mats-hapi-tests-misc.result != 'success' ||
441463
needs.mats-hapi-tests-misc-records.result != 'success' ||
442464
needs.mats-hapi-tests-crypto.result != 'success' ||
@@ -522,6 +544,7 @@ jobs:
522544
- name: Calculate MATS Unit Test Result
523545
id: mats-unit-test-result
524546
if: ${{ needs.mats-unit-tests.result != 'success' ||
547+
needs.mats-integration-tests.result != 'success' ||
525548
needs.mats-hapi-tests-misc.result != 'success' ||
526549
needs.mats-hapi-tests-misc-records.result != 'success' ||
527550
needs.mats-hapi-tests-crypto.result != 'success' ||

.github/workflows/node-flow-pull-request-checks.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,22 @@ jobs:
7878
codacy-project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
7979
codecov-token: ${{ secrets.CODECOV_TOKEN }}
8080

81+
integration-tests:
82+
name: Integration Tests
83+
uses: ./.github/workflows/node-zxc-compile-application-code.yaml
84+
needs:
85+
- dependency-check
86+
- spotless
87+
with:
88+
custom-job-label: Standard
89+
enable-unit-tests: false
90+
enable-integration-tests: true
91+
enable-network-log-capture: true
92+
secrets:
93+
access-token: ${{ secrets.GITHUB_TOKEN }}
94+
gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }}
95+
gradle-cache-password: ${{ secrets.GRADLE_CACHE_PASSWORD }}
96+
8197
hapi-tests-misc:
8298
name: HAPI Tests (Misc)
8399
uses: ./.github/workflows/node-zxc-compile-application-code.yaml

.github/workflows/node-zxc-compile-application-code.yaml

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
type: boolean
2424
required: false
2525
default: false
26+
enable-integration-tests:
27+
description: "Integration Testing Enabled"
28+
type: boolean
29+
required: false
30+
default: false
2631
enable-hapi-tests-misc:
2732
description: "HAPI Testing (misc) Enabled"
2833
type: boolean
@@ -316,6 +321,28 @@ jobs:
316321
path: "**/build/test-results/hammer/TEST-*.xml"
317322
retention-days: 7
318323

324+
- name: Integration Tests
325+
id: gradle-integration-tests
326+
if: ${{ inputs.enable-integration-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
327+
run: ${GRADLE_EXEC} testIntegration --continue
328+
329+
- name: Publish Integration Test Report
330+
uses: step-security/publish-unit-test-result-action@5d195d4dec0b9fa7b51a3dbc4298362a021247c7 # v2.20.4
331+
if: ${{ inputs.enable-integration-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
332+
with:
333+
check_name: "Node: Integration Test Results"
334+
json_thousands_separator: ","
335+
junit_files: "**/build/test-results/testIntegration/TEST-*.xml"
336+
comment_mode: errors # only comment if we could not find or parse the JUnit XML files
337+
338+
- name: Upload Integration Test Report Artifacts
339+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
340+
if: ${{ inputs.enable-integration-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
341+
with:
342+
name: Integration Test Report
343+
path: "**/build/test-results/testIntegration/TEST-*.xml"
344+
retention-days: 7
345+
319346
- name: HAPI Testing (Misc)
320347
id: gradle-hapi-misc
321348
if: ${{ inputs.enable-hapi-tests-misc && steps.gradle-build.conclusion == 'success' && !cancelled() }}
@@ -675,32 +702,50 @@ jobs:
675702
hedera-node/test-clients/build/*-test/**/output/**
676703
retention-days: 7
677704

705+
- name: Upload Otter Integration Tests Turtle Logs
706+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
707+
if: ${{ inputs.enable-integration-tests && inputs.enable-network-log-capture && steps.gradle-integration-tests.conclusion == 'failure' && !cancelled() }}
708+
with:
709+
name: Otter Integration Tests Turtle Logs
710+
path: |
711+
platform-sdk/consensus-otter-tests/build/turtle/**
712+
retention-days: 7
713+
714+
- name: Upload Otter Integration Tests Container Logs
715+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
716+
if: ${{ inputs.enable-integration-tests && inputs.enable-network-log-capture && steps.gradle-integration-tests.conclusion == 'failure' && !cancelled() }}
717+
with:
718+
name: Otter Integration Tests Container Logs
719+
path: |
720+
platform-sdk/consensus-otter-tests/build/container/**
721+
retention-days: 7
722+
678723
- name: Otter Testing
679724
id: gradle-otter-tests
680725
if: ${{ inputs.enable-otter-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
681726
env:
682727
LC_ALL: en.UTF-8
683728
LANG: en_US.UTF-8
684-
run: ${GRADLE_EXEC} :consensus-otter-tests:testIntegration
729+
run: ${GRADLE_EXEC} :consensus-otter-tests:testOtter
685730

686731
- name: Publish Otter Testing Report
687732
uses: step-security/publish-unit-test-result-action@5d195d4dec0b9fa7b51a3dbc4298362a021247c7 # v2.20.4
688733
if: ${{ inputs.enable-otter-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
689734
with:
690735
check_name: "Node: Otter Tests Results"
691736
json_thousands_separator: ","
692-
junit_files: "**/consensus-otter-tests/build/test-results/testIntegration/TEST-*.xml"
737+
junit_files: "**/consensus-otter-tests/build/test-results/testOtter/TEST-*.xml"
693738
comment_mode: errors # only comment if we could not find or parse the JUnit XML files
694739

695740
- name: Upload Otter Tests Report Artifacts
696741
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
697742
if: ${{ inputs.enable-otter-tests && steps.gradle-build.conclusion == 'success' && !cancelled() }}
698743
with:
699744
name: Otter Tests Report
700-
path: "**/consensus-otter-tests/build/test-results/testIntegration/TEST-*.xml"
745+
path: "**/consensus-otter-tests/build/test-results/testOtter/TEST-*.xml"
701746
retention-days: 7
702747

703-
- name: Upload Otter Turtle Logs
748+
- name: Upload Otter Tests Turtle Logs
704749
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
705750
if: ${{ inputs.enable-otter-tests && inputs.enable-network-log-capture && steps.gradle-otter-tests.conclusion == 'failure' && !cancelled() }}
706751
with:
@@ -709,7 +754,7 @@ jobs:
709754
platform-sdk/consensus-otter-tests/build/turtle/**
710755
retention-days: 7
711756

712-
- name: Upload Otter Container Logs
757+
- name: Upload Otter Tests Container Logs
713758
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
714759
if: ${{ inputs.enable-otter-tests && inputs.enable-network-log-capture && steps.gradle-otter-tests.conclusion == 'failure' && !cancelled() }}
715760
with:
@@ -864,6 +909,7 @@ jobs:
864909
"${{ steps.gradle-timing-sensitive.outcome || 'skipped' }}"
865910
"${{ steps.gradle-time-consuming.outcome || 'skipped' }}"
866911
"${{ steps.gradle-hammer-tests.outcome || 'skipped' }}"
912+
"${{ steps.gradle-integration-tests.outcome || 'skipped' }}"
867913
"${{ steps.gradle-hapi-misc.outcome || 'skipped' }}"
868914
"${{ steps.gradle-hapi-misc-records.outcome || 'skipped' }}"
869915
"${{ steps.gradle-hapi-crypto.outcome || 'skipped' }}"

platform-sdk/consensus-otter-tests/build.gradle.kts

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ plugins {
2323
description = "Consensus Otter Test Framework"
2424

2525
testModuleInfo {
26+
requires("com.swirlds.base")
2627
requires("com.swirlds.base.test.fixtures")
2728
requires("com.swirlds.common.test.fixtures")
2829
requires("com.swirlds.platform.core.test.fixtures")
@@ -35,18 +36,52 @@ testModuleInfo {
3536
requires("com.swirlds.metrics.api")
3637
requires("org.hiero.consensus.utility")
3738
requires("org.apache.logging.log4j")
38-
requires("awaitility")
39-
runtimeOnly("io.grpc.netty.shaded")
39+
}
40+
41+
testing.suites {
42+
val testOtter by
43+
registering(JvmTestSuite::class) {
44+
useJUnitJupiter()
45+
46+
dependencies {
47+
implementation(project())
48+
implementation(project.dependencies.testFixtures(project()))
49+
implementation(project(":swirlds-common"))
50+
implementation(project(":swirlds-platform-core"))
51+
implementation(project(":base-crypto"))
52+
implementation("org.junit.jupiter:junit-jupiter-params")
53+
implementation("com.github.spotbugs:spotbugs-annotations")
54+
runtimeOnly("io.grpc:grpc-netty-shaded")
55+
}
56+
57+
targets {
58+
all {
59+
testTask.configure {
60+
// Disable all parallelism
61+
systemProperty("junit.jupiter.execution.parallel.enabled", false)
62+
systemProperty(
63+
"junit.jupiter.testclass.order.default",
64+
"org.junit.jupiter.api.ClassOrderer\$OrderAnnotation",
65+
)
66+
67+
// Limit heap and number of processors
68+
maxHeapSize = "8g"
69+
jvmArgs("-XX:ActiveProcessorCount=6")
70+
}
71+
}
72+
}
73+
}
4074
}
4175

4276
testIntegrationModuleInfo {
4377
requires("com.swirlds.common.test.fixtures")
4478
requires("com.swirlds.logging")
45-
requires("org.hiero.base.crypto")
4679
requires("org.hiero.otter.fixtures")
4780
requires("org.assertj.core")
4881
requires("org.junit.jupiter.params")
4982
requires("com.github.spotbugs.annotations")
83+
requires("org.apache.logging.log4j")
84+
requires("awaitility")
5085
runtimeOnly("io.grpc.netty.shaded")
5186
}
5287

@@ -60,8 +95,8 @@ tasks.compileTestFixturesJava {
6095
// Runs tests against the Turtle environment
6196
tasks.register<Test>("testTurtle") {
6297
useJUnitPlatform()
63-
testClassesDirs = sourceSets.testIntegration.get().output.classesDirs
64-
classpath = sourceSets.testIntegration.get().runtimeClasspath
98+
testClassesDirs = sourceSets.named("testOtter").get().output.classesDirs
99+
classpath = sourceSets.named("testOtter").get().runtimeClasspath
65100

66101
// Disable all parallelism
67102
systemProperty("junit.jupiter.execution.parallel.enabled", false)
@@ -82,8 +117,8 @@ tasks.register<Test>("testContainer") {
82117
dependsOn(":consensus-otter-docker-app:copyDockerizedApp")
83118

84119
useJUnitPlatform()
85-
testClassesDirs = sourceSets.testIntegration.get().output.classesDirs
86-
classpath = sourceSets.testIntegration.get().runtimeClasspath
120+
testClassesDirs = sourceSets.named("testOtter").get().output.classesDirs
121+
classpath = sourceSets.named("testOtter").get().runtimeClasspath
87122

88123
// Disable all parallelism
89124
systemProperty("junit.jupiter.execution.parallel.enabled", false)
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.hiero.otter.fixtures.network.Partition;
1515
import org.hiero.otter.fixtures.result.MultipleNodeLogResults;
1616
import org.hiero.otter.fixtures.turtle.TurtleTestEnvironment;
17-
import org.junit.jupiter.api.Disabled;
1817
import org.junit.jupiter.api.Test;
1918
import org.junit.jupiter.params.ParameterizedTest;
2019
import org.junit.jupiter.params.provider.MethodSource;
@@ -40,7 +39,6 @@ public static Stream<TestEnvironment> environments() {
4039
*/
4140
@ParameterizedTest
4241
@MethodSource("environments")
43-
@Disabled("Disabled due to instability")
4442
void testIsolateAndRejoinSingleNode(@NonNull final TestEnvironment env) {
4543
try {
4644
final Network network = env.network();
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: Apache-2.0
2-
package org.hiero.otter.zzz;
2+
package org.hiero.otter.fixtures;
33

44
import static org.assertj.core.api.Assertions.assertThat;
55
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -13,10 +13,6 @@
1313
import java.util.List;
1414
import java.util.Set;
1515
import java.util.stream.Stream;
16-
import org.hiero.otter.fixtures.Network;
17-
import org.hiero.otter.fixtures.Node;
18-
import org.hiero.otter.fixtures.TestEnvironment;
19-
import org.hiero.otter.fixtures.TimeManager;
2016
import org.hiero.otter.fixtures.container.ContainerTestEnvironment;
2117
import org.hiero.otter.fixtures.network.Partition;
2218
import org.hiero.otter.fixtures.result.MultipleNodeLogResults;

0 commit comments

Comments
 (0)