Skip to content

Commit

Permalink
Fixing build statement and extending test fail message (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxro committed May 26, 2023
1 parent b899b8e commit a67492d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn -B package --file pom.xml -Drun.jvmArguments="-Xmx4048m -Xms1024"
run: mvn -B package --file pom.xml -Drun.jvmArguments="-Xmx4048m -Xms1024m"
- uses: actions/upload-artifact@v2
with:
name: delight-nashorn-sandbox
Expand Down
Expand Up @@ -9,15 +9,18 @@ public class TestSystemRequirements {
@Test
public void test_cpu() {
int processors = Runtime.getRuntime().availableProcessors();
assertTrue("Unit tests likely to fail since they are run on a low-spec machine. Try to run on a machine with at least 2 CPU cores", processors > 1);
assertTrue("Unit tests likely to fail since they are run on a low-spec machine. Try to run on a machine with at least 2 CPU cores.\n"+
"Processors detected: "+processors, processors > 1);
}

@Test
public void test_memory() {
long maxMemory = Runtime.getRuntime().maxMemory();
assertTrue("Unit test likely to fail. Run in an environment where the JVM has access to at least 2 GB max memory.\n"+
"Max heap memory detected "+
maxMemory, maxMemory > 1_320_327_936);
maxMemory + "\n"+
"Also ensure correct JVM parameters set when running tests, e.g. -Drun.jvmArguments=\"-Xmx4048m -Xms1024m\"",
maxMemory > 1_320_327_936);
}

}

0 comments on commit a67492d

Please sign in to comment.