-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
528 additions
and
0 deletions.
There are no files selected for viewing
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,52 @@ | ||
package us.ihmc.ci; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
import us.ihmc.build.GradleTestingToolsKt; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
|
||
@Tag("categories-test") | ||
public class CategoriesTest | ||
{ | ||
@Test | ||
public void testAllTestsRun() throws IOException | ||
{ | ||
String projectName = "categories"; | ||
GradleTestingToolsKt.runGradleTask("-v", projectName); | ||
String cleanOutput = GradleTestingToolsKt.runGradleTask("clean", projectName); | ||
Assertions.assertTrue(cleanOutput.contains("BUILD SUCCESSFUL")); | ||
String output = GradleTestingToolsKt.runGradleTask("test --info -Pcategory=all", projectName); | ||
Assertions.assertTrue(output.contains("BUILD FAILED")); | ||
|
||
System.out.println("Working dir: " + Paths.get(".").toAbsolutePath()); | ||
String results = Files.readString(Paths.get("tests/categories/src/test/build/reports/tests/test/index.html")); | ||
System.out.println(results); | ||
// Asserts 11 tests pass, 1 test fails, 0 tests ignored | ||
Assertions.assertTrue(results.contains( | ||
"<a href=\"packages/us.ihmc.ci.html\">us.ihmc.ci</a>" + System.lineSeparator() + "</td>" + System.lineSeparator() + "<td>9</td>" | ||
+ System.lineSeparator() + "<td>1</td>" + System.lineSeparator() + "<td>0</td>")); | ||
} | ||
|
||
@Test | ||
public void testFastTestsRun() throws IOException | ||
{ | ||
String projectName = "categories"; | ||
GradleTestingToolsKt.runGradleTask("-v", projectName); | ||
String cleanOutput = GradleTestingToolsKt.runGradleTask("clean", projectName); | ||
Assertions.assertTrue(cleanOutput.contains("BUILD SUCCESSFUL")); | ||
String output = GradleTestingToolsKt.runGradleTask("test --info -PincludeTags=fast", projectName); | ||
Assertions.assertTrue(output.contains("BUILD SUCCESSFUL")); | ||
|
||
System.out.println("Working dir: " + Paths.get(".").toAbsolutePath()); | ||
String results = Files.readString(Paths.get("tests/categories/src/test/build/reports/tests/test/index.html")); | ||
System.out.println(results); | ||
// Asserts 5 tests pass, 0 test fails, 0 tests ignored | ||
Assertions.assertTrue(results.contains( | ||
"<a href=\"packages/us.ihmc.ci.html\">us.ihmc.ci</a>" + System.lineSeparator() + "</td>" + System.lineSeparator() + "<td>4</td>" | ||
+ System.lineSeparator() + "<td>0</td>" + System.lineSeparator() + "<td>0</td>")); | ||
} | ||
} |
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,5 @@ | ||
package us.ihmc.ci; | ||
|
||
public class CategorizedExtendingExtreme // extends CategorizedAbstractTest | ||
{ | ||
} |
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,12 @@ | ||
package us.ihmc.ci; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class CategorizedExtendingTest //extends CategorizedAbstractTest | ||
{ | ||
@Test | ||
public void imAndExtendingTest() | ||
{ | ||
//super.imAnAbstractTest(); | ||
} | ||
} |
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,48 @@ | ||
package us.ihmc.ci; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.parallel.Execution; | ||
import org.junit.jupiter.api.parallel.ExecutionMode; | ||
import org.junit.jupiter.api.parallel.ResourceAccessMode; | ||
import org.junit.jupiter.api.parallel.ResourceLock; | ||
|
||
public class CategorizedTests1 | ||
{ | ||
@Tag("fast") | ||
@Test | ||
public void fastTest() throws InterruptedException | ||
{ | ||
} | ||
|
||
@Test | ||
public void untaggedTest() | ||
{ | ||
|
||
} | ||
|
||
@Disabled | ||
@Tag("failing") | ||
@Test | ||
public void failingTest() throws InterruptedException | ||
{ | ||
Assertions.fail(); | ||
} | ||
|
||
@ResourceLock(value = "File.txt", mode = ResourceAccessMode.READ_WRITE) | ||
@Execution(ExecutionMode.SAME_THREAD) | ||
@Tag("slow") | ||
@Test | ||
public void slowTest() throws InterruptedException | ||
{ | ||
} | ||
|
||
@Tag("fast") | ||
@Tag("needs-gpu") | ||
@Test | ||
public void gpuTest() throws InterruptedException | ||
{ | ||
} | ||
} |
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,31 @@ | ||
package us.ihmc.ci; | ||
|
||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class CategorizedTests2 | ||
{ | ||
@Tag("fast") | ||
@Test | ||
public void fastTest() throws InterruptedException | ||
{ | ||
} | ||
|
||
@Test | ||
public void untaggedTest() throws InterruptedException | ||
{ | ||
} | ||
|
||
@Tag("slow") | ||
@Test | ||
public void slowTest() throws InterruptedException | ||
{ | ||
} | ||
|
||
@Tag("fast") | ||
@Tag("needs-gpu") | ||
@Test | ||
public void gpuTest() throws InterruptedException | ||
{ | ||
} | ||
} |
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,50 @@ | ||
package us.ihmc.ci; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import us.ihmc.build.GradleTestingToolsKt; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
|
||
public class ParallelExecutionTest | ||
{ | ||
@Test | ||
public void testAllTestsRun() throws IOException | ||
{ | ||
String projectName = "categories"; | ||
GradleTestingToolsKt.runGradleTask("-v", projectName); | ||
String cleanOutput = GradleTestingToolsKt.runGradleTask("clean", projectName); | ||
Assertions.assertTrue(cleanOutput.contains("BUILD SUCCESSFUL")); | ||
String output = GradleTestingToolsKt.runGradleTask("test --info -Pcategory=all", projectName); | ||
Assertions.assertTrue(output.contains("BUILD FAILED")); | ||
|
||
System.out.println("Working dir: " + Paths.get(".").toAbsolutePath()); | ||
String results = new String(Files.readAllBytes(Paths.get("tests/categories/src/test/build/reports/tests/test/index.html"))); | ||
System.out.println(results); | ||
// Asserts 11 tests pass, 1 test fails, 0 tests ignored | ||
Assertions.assertTrue(results.contains( | ||
"<a href=\"packages/us.ihmc.ci.html\">us.ihmc.ci</a>" + System.lineSeparator() + "</td>" + System.lineSeparator() + "<td>9</td>" | ||
+ System.lineSeparator() + "<td>1</td>" + System.lineSeparator() + "<td>0</td>")); | ||
} | ||
|
||
@Test | ||
public void testFastTestsRun() throws IOException | ||
{ | ||
String projectName = "categories"; | ||
GradleTestingToolsKt.runGradleTask("-v", projectName); | ||
String cleanOutput = GradleTestingToolsKt.runGradleTask("clean", projectName); | ||
Assertions.assertTrue(cleanOutput.contains("BUILD SUCCESSFUL")); | ||
String output = GradleTestingToolsKt.runGradleTask("test --info -Pcategory=fast", projectName); | ||
Assertions.assertTrue(output.contains("BUILD SUCCESSFUL")); | ||
|
||
System.out.println("Working dir: " + Paths.get(".").toAbsolutePath()); | ||
String results = new String(Files.readAllBytes(Paths.get("tests/categories/src/test/build/reports/tests/test/index.html"))); | ||
System.out.println(results); | ||
// Asserts 5 tests pass, 0 test fails, 0 tests ignored | ||
Assertions.assertTrue(results.contains( | ||
"<a href=\"packages/us.ihmc.ci.html\">us.ihmc.ci</a>" + System.lineSeparator() + "</td>" + System.lineSeparator() + "<td>4</td>" | ||
+ System.lineSeparator() + "<td>0</td>" + System.lineSeparator() + "<td>0</td>")); | ||
} | ||
} |
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,31 @@ | ||
plugins { | ||
id("us.ihmc.ihmc-build") | ||
id("us.ihmc.log-tools-plugin") version "0.6.3" | ||
id("us.ihmc.ihmc-ci") version "7.7" | ||
id("us.ihmc.ihmc-cd") version "1.23" | ||
} | ||
|
||
ihmc { | ||
group = "us.ihmc" | ||
version = "0.1.0" | ||
vcsUrl = "https://your.vcs/url" | ||
openSource = true | ||
|
||
configureDependencyResolution() | ||
configurePublications() | ||
} | ||
|
||
//categories.configure("all") { | ||
// | ||
//} | ||
|
||
//ihmc.sourceSetProject("test").tasks.named("test", Test::class.java) { | ||
// | ||
//} | ||
|
||
mainDependencies { | ||
api("org.apache.commons:commons-lang3:3.12.0") | ||
} | ||
|
||
testDependencies { | ||
} |
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,20 @@ | ||
kebabCasedName = categories | ||
pascalCasedName = Categories | ||
extraSourceSets = ["test"] | ||
publishUrl = local | ||
compositeSearchHeight = 0 | ||
excludeFromCompositeBuild = false | ||
artifactoryUsername = unset_username | ||
artifactoryPassword = unset_password | ||
|
||
# Test suite generator | ||
disableJobCheck = true | ||
crashOnEmptyJobs = false | ||
crashOnMissingTimeouts = true | ||
disableSuiteBalancing = false | ||
maxSuiteDuration = 5.5 | ||
bambooUrl = "https://bamboo.ihmc.us/" | ||
bambooPlanKeys = ["one", "two"] | ||
|
||
includeTags = all | ||
excludeTags = none |
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,20 @@ | ||
pluginManagement { | ||
plugins { | ||
id("us.ihmc.ihmc-build") version "0.29.3" | ||
} | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
maven { url = uri("https://plugins.gradle.org/m2/") } | ||
mavenLocal() | ||
} | ||
dependencies { | ||
classpath("us.ihmc:ihmc-build:0.29.3") | ||
} | ||
} | ||
|
||
val ihmcSettingsConfigurator = us.ihmc.build.IHMCSettingsConfigurator(settings, logger, extra) | ||
ihmcSettingsConfigurator.checkRequiredPropertiesAreSet() | ||
ihmcSettingsConfigurator.configureExtraSourceSets() | ||
ihmcSettingsConfigurator.findAndIncludeCompositeBuilds() |
9 changes: 9 additions & 0 deletions
9
tests/categories/src/main/java/us.ihmc/BasicTestApplication.java
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,9 @@ | ||
package us.ihmc; | ||
|
||
public class BasicTestApplication | ||
{ | ||
public static void main(String[] args) | ||
{ | ||
System.out.println("Hello there. I'm some test code."); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
tests/categories/src/test/java/us/ihmc/ci/CategorizedAbstractTest.java
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,24 @@ | ||
package us.ihmc.ci; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.time.Duration; | ||
|
||
public abstract class CategorizedAbstractTest | ||
{ | ||
public void imAnAbstractTest() | ||
{ | ||
|
||
} | ||
|
||
@Tag("fast") | ||
@Test | ||
public void someNonExtendedTest() | ||
{ | ||
Assertions.assertTimeout(Duration.ofSeconds(30), () -> { | ||
|
||
}); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
tests/categories/src/test/java/us/ihmc/ci/CategorizedTests3.java
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,46 @@ | ||
package us.ihmc.ci; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.parallel.Execution; | ||
import org.junit.jupiter.api.parallel.ExecutionMode; | ||
import org.junit.jupiter.api.parallel.ResourceAccessMode; | ||
import org.junit.jupiter.api.parallel.ResourceLock; | ||
|
||
public class CategorizedTests3 | ||
{ | ||
@Tag("fast") | ||
@Test | ||
public void fastTest() throws InterruptedException | ||
{ | ||
} | ||
|
||
@Test | ||
public void untaggedTest() | ||
{ | ||
|
||
} | ||
|
||
@Tag("failing") | ||
@Test | ||
public void failingTest() throws InterruptedException | ||
{ | ||
Assertions.fail(); | ||
} | ||
|
||
@ResourceLock(value = "File.txt", mode = ResourceAccessMode.READ_WRITE) | ||
@Execution(ExecutionMode.SAME_THREAD) | ||
@Tag("slow") | ||
@Test | ||
public void slowTest() throws InterruptedException | ||
{ | ||
} | ||
|
||
@Tag("fast") | ||
@Tag("needs-gpu") | ||
@Test | ||
public void gpuTest() throws InterruptedException | ||
{ | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
tests/categories/src/test/java/us/ihmc/ci/CategorizedTests4.java
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,31 @@ | ||
package us.ihmc.ci; | ||
|
||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class CategorizedTests4 | ||
{ | ||
@Tag("fast") | ||
@Test | ||
public void fastTest() throws InterruptedException | ||
{ | ||
} | ||
|
||
@Test | ||
public void untaggedTest() throws InterruptedException | ||
{ | ||
} | ||
|
||
@Tag("slow") | ||
@Test | ||
public void slowTest() throws InterruptedException | ||
{ | ||
} | ||
|
||
@Tag("fast") | ||
@Tag("needs-gpu") | ||
@Test | ||
public void gpuTest() throws InterruptedException | ||
{ | ||
} | ||
} |
Oops, something went wrong.