Skip to content

Commit

Permalink
fix unit tests #109 #112
Browse files Browse the repository at this point in the history
  • Loading branch information
walterxie committed Jan 17, 2024
1 parent e6b7cce commit bdf24a3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lphybeast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
working-directory: ./LPhyBeast
# only available in lphy at the moment
# temp disable test because of github issue
run: ./gradlew build -x test
run: ./gradlew build

- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action@v2
Expand Down
14 changes: 8 additions & 6 deletions lphybeast/src/test/java/lphybeast/H5N1TutorialTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,17 @@ public void testDPG() {
assertTrue(xml.contains("BitFlipOperator") && xml.contains("parameter=\"@I\""), "I.bitFlip Operator" );

// 6 ScaleOperator, incl. tree
assertEquals(6, xml.split("ScaleOperator", -1).length - 1, "ScaleOperator" );
assertEquals(6, xml.split("BactrianScaleOperator", -1).length - 1,
"BactrianScaleOperator" );

assertTrue(xml.contains("Exchange") && xml.contains("SubtreeSlide") && xml.contains("Uniform") &&
xml.contains("WilsonBalding"), "Tree Operator" );
assertTrue(xml.contains("Exchange") && xml.contains("BactrianSubtreeSlide") &&
xml.contains("BactrianNodeOperator") && xml.contains("WilsonBalding"), "Tree Operator" );

assertTrue(xml.contains("UpDownOperator") &&
xml.contains("<up") && xml.contains("<down"), "UpDownOperator" );
assertTrue(xml.contains("BactrianUpDownOperator") &&
xml.contains("<up") && xml.contains("<down"), "BactrianUpDownOperator" );
// 3 DeltaExchangeOperator
assertEquals(3, xml.split("DeltaExchangeOperator", -1).length - 1, "DeltaExchangeOperator");
assertEquals(3, xml.split("BactrianDeltaExchangeOperator", -1).length - 1,
"BactrianDeltaExchangeOperator");

assertTrue(xml.contains("chainLength=\"1000000\"") && xml.contains("logEvery=\"500\"") &&
xml.contains("fileName=\"" + fileStem + ".log\"") && xml.contains("fileName=\"" + fileStem + ".trees\""),
Expand Down
10 changes: 5 additions & 5 deletions lphybeast/src/test/java/lphybeast/RSV2TutorialTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ public void testRSV2() {
assertEquals(3,xml.split("ThreadedTreeLikelihood", -1).length - 1, "Tree Likelihood" );

// 5 ScaleOperator, incl. tree
assertEquals(5, xml.split("ScaleOperator", -1).length - 1, "ScaleOperator" );
assertEquals(5, xml.split("BactrianScaleOperator", -1).length - 1, "BactrianScaleOperator" );

assertTrue(xml.contains("Exchange") && xml.contains("SubtreeSlide") && xml.contains("Uniform") &&
assertTrue(xml.contains("Exchange") && xml.contains("BactrianSubtreeSlide") && xml.contains("BactrianNodeOperator") &&
xml.contains("WilsonBalding"), "Tree Operator" );

assertTrue(xml.contains("UpDownOperator") &&
xml.contains("<up") && xml.contains("<down"), "UpDownOperator" );
assertTrue(xml.contains("BactrianUpDownOperator") &&
xml.contains("<up") && xml.contains("<down"), "BactrianUpDownOperator" );
// 4 DeltaExchangeOperator
assertEquals(4, xml.split("DeltaExchangeOperator", -1).length - 1, "DeltaExchangeOperator");
assertEquals(4, xml.split("BactrianDeltaExchangeOperator", -1).length - 1, "BactrianDeltaExchangeOperator");

assertTrue(xml.contains("chainLength=\"1000000\"") && xml.contains("logEvery=\"500\"") &&
xml.contains("fileName=\"" + fileStem + ".log\"") && xml.contains("fileName=\"" + fileStem + ".trees\""),
Expand Down
10 changes: 6 additions & 4 deletions lphybeast/src/test/java/lphybeast/SkylinePlotsTutorialTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ public void testBS() {
assertTrue(xml.contains("gammaCategoryCount=\"4\"") && xml.contains("shape=\"@gamma\""), "SiteModel" );

// 4 ScaleOperator, incl. tree
assertEquals(4, xml.split("ScaleOperator", -1).length - 1, "ScaleOperator" );
assertEquals(4, xml.split("BactrianScaleOperator", -1).length - 1,
"BactrianScaleOperator" );

assertTrue(xml.contains("Exchange") && xml.contains("SubtreeSlide") && xml.contains("Uniform") &&
xml.contains("WilsonBalding"), "Tree Operator" );
assertTrue(xml.contains("Exchange") && xml.contains("BactrianSubtreeSlide") &&
xml.contains("BactrianNodeOperator") && xml.contains("WilsonBalding"), "Tree Operator" );

// 3 DeltaExchangeOperator
assertEquals(3, xml.split("DeltaExchangeOperator", -1).length - 1, "DeltaExchangeOperator");
assertEquals(3, xml.split("BactrianDeltaExchangeOperator", -1).length - 1,
"BactrianDeltaExchangeOperator");

assertTrue(xml.contains("chainLength=\"1000000\"") && xml.contains("logEvery=\"500\"") &&
xml.contains("fileName=\"" + fileStem + ".log\"") && xml.contains("fileName=\"" + fileStem + ".trees\"") &&
Expand Down

0 comments on commit bdf24a3

Please sign in to comment.