Skip to content

Commit

Permalink
Merge branch 'develop' into refactor/merge-world-config-in-setup-screen
Browse files Browse the repository at this point in the history
  • Loading branch information
jdrueckert authored Apr 7, 2024
2 parents 2c476a2 + 82fd5c4 commit 15f842d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
23 changes: 22 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pipeline {
}
}

stage('Integration Tests') {
stage('Integration Tests (without flaky tests)') {
steps {
sh './gradlew --console=plain integrationTest'
}
Expand All @@ -176,5 +176,26 @@ pipeline {
}
}
}

stage('Integration Tests (flaky tests only)') {
steps {
warnError("Integration Tests Failed") { // if this errs, mark the build unstable, not failed.
sh './gradlew --console=plain integrationTestFlaky'
}
}
post {
always {
// Gradle generates both a HTML report of the unit tests to `build/reports/tests/*`
// and XML reports to `build/test-results/*`.
// We need to upload the XML reports for visualization in Jenkins.
//
// See https://docs.gradle.org/current/userguide/java_testing.html#test_reporting
junit testResults: '**/build/test-results/integrationTestFlaky/*.xml', allowEmptyResults: true
// Jenkins truncates large test outputs, so archive it as well.
tar file: 'build/integrationTestFlaky-results.tgz', archive: true, compress: true, overwrite: true,
glob: '**/build/test-results/integrationTestFlaky/*.xml'
}
}
}
}
}
25 changes: 22 additions & 3 deletions engine-tests/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
// SPDX-License-Identifier: Apache-2.0

// Engine tests are split out due to otherwise quirky project dependency issues with module tests extending engine tests
// while locally all tests should be run, when building via github, tests can be run separated in the github pipeline
// file. For integration tests, a tag "flaky" was introduced to mark tests which frequently fail pipelines
// gradle test
// gradle --console=plain unitTest
// gradle --console=plain integrationTest
// gradle --console=plain integrationTestFlaky

plugins {
id("java-library")
id("org.jetbrains.gradle.plugin.idea-ext")
Expand Down Expand Up @@ -105,18 +112,30 @@ tasks.register<Test>("unitTest") {
group = "Verification"
description = "Runs unit tests (fast)"
useJUnitPlatform {
excludeTags = setOf("MteTest", "TteTest")
excludeTags("MteTest", "TteTest")
}
systemProperty("junit.jupiter.execution.timeout.default", "1m")
}

tasks.register<Test>("integrationTest") {
dependsOn(tasks.getByPath(":extractNatives"))
group = "Verification"
description = "Runs integration tests (slow) tagged with 'MteTest' or 'TteTest'"
description = "Runs integration tests (slow) tagged with 'MteTest' or 'TteTest', exclude tests tagged 'flaky'."

useJUnitPlatform {
excludeTags("flaky")
includeTags("MteTest", "TteTest")
}
systemProperty("junit.jupiter.execution.timeout.default", "5m")
}

tasks.register<Test>("integrationTestFlaky") {
dependsOn(tasks.getByPath(":extractNatives"))
group = "Verification"
description = "Runs integration tests tagged with 'flaky' and either 'MteTest' or 'TteTest'."

useJUnitPlatform {
includeTags = setOf("MteTest", "TteTest")
includeTags("MteTest & flaky", "TteTest & flaky")
}
systemProperty("junit.jupiter.execution.timeout.default", "5m")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.google.common.collect.Lists;
import org.joml.Vector3i;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -38,13 +39,15 @@ public class ExampleTest {
private ModuleTestingHelper helper;

@Test
@Tag("flaky")
public void testClientCreation() {
logger.info("Starting test 'testClientCreation'");
Assertions.assertDoesNotThrow(helper::createClient);
logger.info("Done with test 'testClientCreation'");
}

@Test
@Tag("flaky")
public void testClientConnection() throws IOException {
int currentClients = Lists.newArrayList(entityManager.getEntitiesWith(ClientComponent.class)).size();

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 15f842d

Please sign in to comment.