Commit fe3ebc47 authored by René Schöne's avatar René Schöne
Browse files

Normally run test not requiring a running MQTT broker.

parent 027df80f
...@@ -21,7 +21,7 @@ test: ...@@ -21,7 +21,7 @@ test:
image: openjdk:8 image: openjdk:8
stage: test stage: test
script: script:
- ./gradlew test - ./gradlew allTests
artifacts: artifacts:
reports: reports:
junit: ros2rag.tests/build/test-results/test/TEST-*.xml junit: ros2rag.tests/build/test-results/test/TEST-*.xml
...@@ -30,11 +30,22 @@ dependencies { ...@@ -30,11 +30,22 @@ dependencies {
} }
test { test {
useJUnitPlatform() useJUnitPlatform {
excludeTags 'mqtt'
}
maxHeapSize = '1G' maxHeapSize = '1G'
} }
task allTests(type: Test, dependsOn: testClasses) {
description = 'Run every test'
group = 'verification'
useJUnitPlatform {
includeTags 'mqtt'
}
}
relastTest { relastTest {
compilerLocation = '../libs/relast.jar' compilerLocation = '../libs/relast.jar'
} }
...@@ -82,7 +93,7 @@ task compileExampleTest(type: RelastTest) { ...@@ -82,7 +93,7 @@ task compileExampleTest(type: RelastTest) {
'src/test/02-after-ros2rag/example/ROS2RAG.jadd' 'src/test/02-after-ros2rag/example/ROS2RAG.jadd'
} }
test.dependsOn compileExampleTest testClasses.dependsOn compileExampleTest
compileExampleTest.dependsOn preprocessExampleTest compileExampleTest.dependsOn preprocessExampleTest
// --- Test: default-only-read --- // --- Test: default-only-read ---
...@@ -112,7 +123,7 @@ task compileDefaultOnlyReadTest(type: RelastTest) { ...@@ -112,7 +123,7 @@ task compileDefaultOnlyReadTest(type: RelastTest) {
'src/test/02-after-ros2rag/defaultOnlyRead/ROS2RAG.jadd' 'src/test/02-after-ros2rag/defaultOnlyRead/ROS2RAG.jadd'
} }
test.dependsOn compileDefaultOnlyReadTest testClasses.dependsOn compileDefaultOnlyReadTest
compileDefaultOnlyReadTest.dependsOn preprocessDefaultOnlyReadTest compileDefaultOnlyReadTest.dependsOn preprocessDefaultOnlyReadTest
// --- Test: default-only-write --- // --- Test: default-only-write ---
...@@ -143,7 +154,7 @@ task compileDefaultOnlyWriteTest(type: RelastTest) { ...@@ -143,7 +154,7 @@ task compileDefaultOnlyWriteTest(type: RelastTest) {
'src/test/02-after-ros2rag/defaultOnlyWrite/ROS2RAG.jadd' 'src/test/02-after-ros2rag/defaultOnlyWrite/ROS2RAG.jadd'
} }
test.dependsOn compileDefaultOnlyWriteTest testClasses.dependsOn compileDefaultOnlyWriteTest
compileDefaultOnlyWriteTest.dependsOn preprocessDefaultOnlyWriteTest compileDefaultOnlyWriteTest.dependsOn preprocessDefaultOnlyWriteTest
// --- Test: read1write2 --- // --- Test: read1write2 ---
...@@ -174,7 +185,7 @@ task compileRead1Write2Test(type: RelastTest) { ...@@ -174,7 +185,7 @@ task compileRead1Write2Test(type: RelastTest) {
'src/test/02-after-ros2rag/read1write2/ROS2RAG.jadd' 'src/test/02-after-ros2rag/read1write2/ROS2RAG.jadd'
} }
test.dependsOn compileRead1Write2Test testClasses.dependsOn compileRead1Write2Test
compileRead1Write2Test.dependsOn preprocessRead1Write2Test compileRead1Write2Test.dependsOn preprocessRead1Write2Test
// --- Test: read2write1 --- // --- Test: read2write1 ---
...@@ -205,7 +216,7 @@ task compileRead2Write1Test(type: RelastTest) { ...@@ -205,7 +216,7 @@ task compileRead2Write1Test(type: RelastTest) {
'src/test/02-after-ros2rag/read2write1/ROS2RAG.jadd' 'src/test/02-after-ros2rag/read2write1/ROS2RAG.jadd'
} }
test.dependsOn compileRead2Write1Test testClasses.dependsOn compileRead2Write1Test
compileRead2Write1Test.dependsOn preprocessRead2Write1Test compileRead2Write1Test.dependsOn preprocessRead2Write1Test
clean { clean {
......
...@@ -2,6 +2,7 @@ package org.jastadd.ros2rag.tests; ...@@ -2,6 +2,7 @@ package org.jastadd.ros2rag.tests;
import defaultOnlyRead.ast.MqttUpdater; import defaultOnlyRead.ast.MqttUpdater;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Tag;
import java.io.IOException; import java.io.IOException;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -11,6 +12,7 @@ import java.util.concurrent.TimeUnit; ...@@ -11,6 +12,7 @@ import java.util.concurrent.TimeUnit;
* *
* @author rschoene - Initial contribution * @author rschoene - Initial contribution
*/ */
@Tag("mqtt")
public abstract class AbstractMqttTest { public abstract class AbstractMqttTest {
static boolean checkDone = false; static boolean checkDone = false;
static Boolean checkResult; static Boolean checkResult;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment