Skip to content

Commit

Permalink
more integration testing setup CompEvol#834
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouckaert committed May 30, 2022
1 parent a14ca82 commit b4501fb
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# docker run beast_testing
#
# To run the tests interactively, use
# docker run -it -p 5900:5900 beast_testing /bin/bash
# docker run --entrypoint /bin/bash -it -p 5900:5900 beast_testing
# This will give you a shell in the container. From this
# shell, run
# vncserver $DISPLAY -geometry 1920x1080; ant -f build-testing.xml
Expand All @@ -18,6 +18,7 @@
# the graphical output of these tests.

FROM openjdk:11
WORKDIR /beast2

# Install Apache Ant
RUN apt-get update && apt-get install -y ant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public void test_ReservedElementNames() {
HashMap<String, String> element2ClassMap = parser.getElement2ClassMap();

// allow 'parameter' for any of the various parameter derivatives, not just RealParameter
element2ClassMap.put("parameter", "beast.core.parameter.Parameter");
element2ClassMap.put("parameter", "beast.base.inference.parameter.Parameter");


// check each beastObject
final Set<String> pluginNames = PackageManager.listServices("beast.base.core.BEASTInterface");
Expand Down Expand Up @@ -99,6 +100,9 @@ public void test_ReservedElementNames() {
str = str.replaceAll(",", "\n");
System.err.println("Reserved element names used for wrong types in:\n" + str);
}

element2ClassMap.put("parameter", "beast.base.inference.parameter.RealParameter");

// not activated till problem with naming is solved
assertTrue(improperInputs.size() == 0,
"Reserved element names used for wrong types in: " + improperInputs.toString());
Expand Down
1 change: 1 addition & 0 deletions beast.app/test/test/beast/util/XMLParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public void testClassMap() throws IOException {
}

// restore version.xml
new File(versionFile).delete();
if (new File("version.xml.backup").exists())
Files.move(new File("version.xml.backup").toPath(),
new File(versionFile).toPath(),
Expand Down
39 changes: 25 additions & 14 deletions build-testing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<include name="org/**/**" />
</javac>

<jar jarfile="build/dist/beast.base.jar">
<jar jarfile="build/dist/BEAST.base.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
Expand Down Expand Up @@ -171,7 +171,7 @@
<include name="beast/**/**" />
</javac>

<jar jarfile="build/dist/beast.app.jar">
<jar jarfile="build/dist/BEAST.app.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
</manifest>
Expand Down Expand Up @@ -233,8 +233,8 @@
<path location="build"/>
-->
<path id="classpath2">
<fileset dir="build/dist" includes="beast.base.jar" />
<fileset dir="build/dist" includes="beast.app.jar" />
<fileset dir="build/dist" includes="BEAST.base.jar" />
<fileset dir="build/dist" includes="BEAST.app.jar" />
<fileset dir="build/dist" includes="launcher.jar" />
<fileset dir="build/dist" includes="test.beast.jar" />
</path>
Expand All @@ -258,28 +258,39 @@
</target>


<target name="junit" depends="junit-unit, junit-integration"/>


<target name="junit">
<pathconvert property="classpathProp" refid="classpath"/>
<echo>Classpath is ${classpathProp}</echo>

<target name="junit-unit">
<java classpathref="classpath" classname="org.junit.platform.console.ConsoleLauncher" fork="true" failonerror="true">
<arg line="-p test.beast.base"/>
<arg line="-p test.beast.core"/>
<arg line="-p test.beast.evolution"/>
<arg line="-p test.beast.math"/>
<arg line="-p test.beast.statistic"/>

<arg line="-p test.beast.util"/>
<arg line="-p test.beast.integration"/>
<arg line="--reports-dir build/junitreport"/>
</java>
<junitreport todir="build/junitreport">
<fileset dir="build/junitreport">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="build/junitreport/html"/>
<report format="frames" todir="build/junitreport"/>
</junitreport>
</target>

<target name="junit-integration">
<pathconvert property="classpathProp" refid="classpath"/>
<echo>Classpath is ${classpathProp}</echo>

<java classpathref="classpath" classname="org.junit.platform.console.ConsoleLauncher" fork="true" failonerror="true">
<arg line="-p test.beast.integration"/>
<arg line="--reports-dir build/integrationreport"/>
</java>
<junitreport todir="build/integrationreport">
<fileset dir="build/junitreport">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="build/integrationreport"/>
</junitreport>
</target>

Expand Down Expand Up @@ -310,8 +321,8 @@
<fileset dir="/beast2/${lib}" includes="colt.jar"/>
<fileset dir="/beast2/${lib}" includes="fest.jar"/>
<fileset dir="/beast2/${lib}" includes="antlr-runtime-4.10.1.jar"/>
<fileset dir="/beast2/build/dist" includes="beast.base.jar" />
<fileset dir="/beast2/build/dist" includes="beast.app.jar" />
<fileset dir="/beast2/build/dist" includes="BEAST.base.jar" />
<fileset dir="/beast2/build/dist" includes="BEAST.app.jar" />
<fileset dir="/beast2/build/dist" includes="launcher.jar" />
<fileset dir="/beast2/build/dist" includes="test.beast.jar" />
<fileset dir="/beast2/${lib}" includes="assertj-swing-junit-3.17.1.jar"/>
Expand Down

0 comments on commit b4501fb

Please sign in to comment.