diff --git a/gradle/nshm.gradle b/gradle/nshm.gradle index a8ca1f442528a484ea4a6d33aec483a4889d775b..d1460c795979daffedc87dcaf9b3b90cfc6ec2cb 100644 --- a/gradle/nshm.gradle +++ b/gradle/nshm.gradle @@ -143,6 +143,22 @@ task generateHawaii2021(type: JavaExec) { main = "gov.usgs.earthquake.nshmp.model.GenerateActual" } +/* +// Generate PRVI 2025 for CI +task generatePrvi2025(type: JavaExec) { + description = "Generate prvi-2025 acutal for CI/CD" + classpath = sourceSets.test.runtimeClasspath + + doFirst { + downloadNshm(findNshm("nshm-prvi", 2025)) + } + + jvmArgs("-DNSHM=nshm-prvi-2025") + + main = "gov.usgs.earthquake.nshmp.model.GenerateActual" +} +*/ + // Test Alaska 2007 NSHM task testAlaska2007(type: Test) { description = "Test Alaska 2007 NSHM" @@ -272,3 +288,31 @@ task testHawaii2021(type: Test) { includeTestsMatching "gov.usgs.earthquake.nshmp.model.NshmTests.testHawaii2021" } } + +// Test PRVI 2025 NSHM +/* +task testPrvi2025(type: Test) { + description = "Test PRVI 2025 NSHM" + group = "verification" + + doFirst { + downloadNshm(findNshm("nshm-prvi", 2025)) + } + + testLogging { + exceptionFormat "full" + } + + systemProperties(System.getProperties()) + + useJUnitPlatform() + jvmArgs( + "-Xms2g", + "-Xmx${xmx}", + ) + + filter { + includeTestsMatching "gov.usgs.earthquake.nshmp.model.NshmTests.testPrvi2025" + } +} +*/ diff --git a/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTests.java b/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTests.java index d9c9eb6734faf5543934ca52c8fa2ce1a1e6cbcb..0c24c00cfaf3e0f54f8245c552655d4b5c900b82 100644 --- a/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTests.java +++ b/src/test/java/gov/usgs/earthquake/nshmp/model/NshmTests.java @@ -53,6 +53,10 @@ class NshmTests { NshmpSite.HONOLULU_HI, NshmpSite.KAILUA_KONA_HI); + /* PRVI test sites */ + private static final List<NamedLocation> PRVI_LOCATIONS = List.of( + NshmpSite.SAN_JUAN_PR); + private static final Set<Imt> IMTS = EnumSet.of(Imt.PGA, Imt.SA0P2, Imt.SA1P0, Imt.SA5P0); private static final Set<Imt> AK_2007_IMTS = EnumSet.of(Imt.PGA, Imt.SA0P2, Imt.SA1P0); @@ -81,6 +85,10 @@ class NshmTests { locations = HAWAII_LOCATIONS; break; } + case "nshm-prvi": { + locations = PRVI_LOCATIONS; + break; + } default: throw new RuntimeException(nshmInfo.repo + " not supported"); } @@ -169,6 +177,17 @@ class NshmTests { NshmTestUtils.testNshm(nshm, getDataPath(nshm)); } + /** + * Test PRVI 2025 NSHM + * + * To run test: ./gradlew testPrvi2025 + */ + // @Test + // final void testPrvi2025() throws IOException { + // Nshm nshm = NSHMS.get("nshm-prvi-2025"); + // NshmTestUtils.testNshm(nshm, getDataPath(nshm)); + // } + private static Optional<Path> getDataPath(Nshm nshm) { return Files.exists(DATA_PATH.resolve(nshm.modelName())) ? Optional.of(DATA_PATH) : Optional.empty();