Skip to content
Snippets Groups Projects
Commit eb6c9985 authored by Clayton, Brandon Scott's avatar Clayton, Brandon Scott
Browse files

single site

parent 1d9c002a
No related branches found
No related tags found
2 merge requests!755Production Release | nshmp-haz,!754NSHM Unit tests
...@@ -91,6 +91,8 @@ task testAlaska2007(type: Test) { ...@@ -91,6 +91,8 @@ task testAlaska2007(type: Test) {
exceptionFormat "full" exceptionFormat "full"
} }
systemProperties(System.getProperties())
useJUnitPlatform() useJUnitPlatform()
jvmArgs( jvmArgs(
"-Xms2g", "-Xms2g",
...@@ -115,6 +117,8 @@ task testAlaska2023(type: Test) { ...@@ -115,6 +117,8 @@ task testAlaska2023(type: Test) {
exceptionFormat "full" exceptionFormat "full"
} }
systemProperties(System.getProperties())
useJUnitPlatform() useJUnitPlatform()
jvmArgs( jvmArgs(
"-Xms2g", "-Xms2g",
...@@ -139,6 +143,8 @@ task testConus2018(type: Test) { ...@@ -139,6 +143,8 @@ task testConus2018(type: Test) {
exceptionFormat "full" exceptionFormat "full"
} }
systemProperties(System.getProperties())
useJUnitPlatform() useJUnitPlatform()
jvmArgs( jvmArgs(
"-Xms${xmx}", "-Xms${xmx}",
...@@ -163,6 +169,8 @@ task testConus2023(type: Test) { ...@@ -163,6 +169,8 @@ task testConus2023(type: Test) {
exceptionFormat "full" exceptionFormat "full"
} }
systemProperties(System.getProperties())
useJUnitPlatform() useJUnitPlatform()
jvmArgs( jvmArgs(
"-Xms2g", "-Xms2g",
...@@ -187,6 +195,8 @@ task testHawaii2021(type: Test) { ...@@ -187,6 +195,8 @@ task testHawaii2021(type: Test) {
exceptionFormat "full" exceptionFormat "full"
} }
systemProperties(System.getProperties())
useJUnitPlatform() useJUnitPlatform()
jvmArgs( jvmArgs(
"-Xms2g", "-Xms2g",
......
...@@ -43,7 +43,8 @@ import io.swagger.v3.core.util.Yaml; ...@@ -43,7 +43,8 @@ import io.swagger.v3.core.util.Yaml;
* Utilities to run tests on a NSHM. * Utilities to run tests on a NSHM.
*/ */
class NshmTestUtils { class NshmTestUtils {
private static Logger LOGGER = Logger.getAnonymousLogger(); private static Logger LOGGER = Logger.getLogger(NshmTestUtils.class.getName());
private static final Path DATA_PATH = Paths.get("src/test/resources/e2e"); private static final Path DATA_PATH = Paths.get("src/test/resources/e2e");
private static final double TOLERANCE = 1e-12; private static final double TOLERANCE = 1e-12;
...@@ -85,8 +86,6 @@ class NshmTestUtils { ...@@ -85,8 +86,6 @@ class NshmTestUtils {
*/ */
static void testNshm(Nshm nshm, Optional<NshmpSite> site) { static void testNshm(Nshm nshm, Optional<NshmpSite> site) {
NshmModel nshmModel = loadModel(nshm); NshmModel nshmModel = loadModel(nshm);
LOGGER.info("Model loaded");
LOGGER.info("Number of sites: " + nshm.locations().size());
if (site.isPresent()) { if (site.isPresent()) {
LOGGER.info("Location: " + site.get().toString()); LOGGER.info("Location: " + site.get().toString());
......
...@@ -113,13 +113,6 @@ class NshmTests { ...@@ -113,13 +113,6 @@ class NshmTests {
// } // }
} }
private NshmpSite getSite() {
var arg = System.getProperty("TEST_SITE");
LOGGER.info("\n\n ---------------- TEST SITE: " + arg + "\n\n-------------");
return arg == null ? null : NshmpSite.valueOf(arg);
}
/** /**
* Test Alaska 2007 NSHM * Test Alaska 2007 NSHM
* *
...@@ -148,14 +141,7 @@ class NshmTests { ...@@ -148,14 +141,7 @@ class NshmTests {
*/ */
@Test @Test
final void testConus2018() throws IOException, InterruptedException { final void testConus2018() throws IOException, InterruptedException {
var cores = Runtime.getRuntime().availableProcessors(); NshmTestUtils.testNshm(NSHMS.get("nshm-conus-2018"), Optional.ofNullable(getSite()));
var service = Executors.newFixedThreadPool(cores);
CountDownLatch latch = new CountDownLatch(1);
service.execute(() -> {
NshmTestUtils.testNshm(NSHMS.get("nshm-conus-2018"), Optional.ofNullable(getSite()));
latch.countDown();
});
latch.await();
} }
/** /**
...@@ -165,7 +151,7 @@ class NshmTests { ...@@ -165,7 +151,7 @@ class NshmTests {
*/ */
@Test @Test
final void testConus2023() throws IOException { final void testConus2023() throws IOException {
NshmTestUtils.testNshm(NSHMS.get("nshm-conus-2023"), Optional.of(getSite())); NshmTestUtils.testNshm(NSHMS.get("nshm-conus-2023"), Optional.ofNullable(getSite()));
} }
/** /**
...@@ -175,6 +161,11 @@ class NshmTests { ...@@ -175,6 +161,11 @@ class NshmTests {
*/ */
@Test @Test
final void testHawaii2021() throws IOException { final void testHawaii2021() throws IOException {
NshmTestUtils.testNshm(NSHMS.get("nshm-hawaii-2021"), Optional.of(getSite())); NshmTestUtils.testNshm(NSHMS.get("nshm-hawaii-2021"), Optional.ofNullable(getSite()));
}
private NshmpSite getSite() {
var testSite = System.getProperty("TEST_SITE");
return testSite == null ? null : NshmpSite.valueOf(testSite);
} }
} }
junit.jupiter.execution.parallel.enabled = true
junit.jupiter.execution.parallel.mode.default = concurrent
junit.jupiter.execution.parallel.mode.classes.default = concurrent
junit.jupiter.execution.parallel.config.fixed.parallelism
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment