Skip to content

Commit

Permalink
Merge pull request #156 from terry-norbraten/master
Browse files Browse the repository at this point in the history
Update instructions for unit testing via Ant on the command line
  • Loading branch information
apease authored Jan 20, 2025
2 parents 383a666 + 775c4db commit 57ffdaf
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,20 @@ java -Xmx10g -Xss1m -cp $SIGMA_CP:\
com.articulate.sigma.KbIntegrationTest#testIsChildOf3
```
You will have to edit the resources files that correspond to config.xml to conform to your
paths. They are in test/integration/java/resources/config*.xml and test/unit/java/resources/config*.xml
paths. They are in test/integration/java/resources/config*.xml and test/unit/java/resources/config*.xml

An alternative, and possibly easier way for command line invocation of unit
tests are to run these Ant tasks:

```sh
ant test.unit
ant test.integration
```

To run both of these in sequence with a single command
```sh
ant test
```

## RESTful Interface

Expand Down
18 changes: 14 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
<exclude name="hamcrest*"/>
</fileset>
</path>
<path id="runtime.classpath">
<fileset dir="${basedir}/lib">
<include name="*.jar"/>
<exclude name="junit*"/>
<exclude name="hamcrest*"/>
<exclude name="tomcat-servlet-api*"/>
</fileset>
</path>
<path id="compile.test.classpath">
<path refid="compile.classpath"/>
<pathelement location="${build.classes.dir}"/>
Expand Down Expand Up @@ -200,7 +208,7 @@
<copy todir="${basedir}/lib" file="${sigma.utils.home}/sigmaUtils.jar"/>
<!-- Create WEB-INF/lib/ and copy over the needed jar files. -->
<copy todir="${build.home}/WEB-INF/lib" flatten="true">
<path refid="compile.classpath"/>
<path refid="runtime.classpath"/>
</copy>
</target>

Expand Down Expand Up @@ -229,7 +237,7 @@
<mkdir dir="${reports.dir}"/>
</target>

<target name="dist" depends="compile,compile.test" description="Create the *.war file and place in ${dist.dir}.">
<target name="dist" depends="compile" description="Create the *.war file and place in ${dist.dir}.">
<manifest file="${manifest.mf}">
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Specification-Title"
Expand Down Expand Up @@ -269,7 +277,6 @@
manifest="${manifest.mf}">
<metainf file="LICENSE"/>
<fileset dir="${build.classes.dir}"/>
<fileset dir="${build.test.classes.dir}"/>
</jar>
</target>

Expand All @@ -279,6 +286,7 @@
==========
-->

<target name="test" depends="test.unit,test.integration"/>
<target name="test.unit" depends="compile.test" description="Runs the UnitTestSuite">
<junit printsummary="yes"
showoutput="yes"
Expand Down Expand Up @@ -431,7 +439,9 @@
<chmod dir="${user.home}/.${app.name}" perm="ugo+rw" includes="**/*"/>
<mkdir dir="${user.home}/.${app.name}/KBs"/>
<copy todir="${user.home}/.${app.name}/KBs">
<fileset dir="${kbs.home}"/>
<fileset dir="${kbs.home}">
<exclude name=".github/**"/>
</fileset>
</copy>
</target>

Expand Down
1 change: 1 addition & 0 deletions docker/sigmakee/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ COPY ./sigmakee/build/WEB-INF/lib/*.jar /root/sigmakee/
COPY ./sigma.war $CATALINA_HOME/webapps/sigma.war

ENV SIGMA_HOME=/root/sigmakee-runtime
ENV LD_LIBRARY_PATH=/usr/local/bin:$LD_LIBRARY_PATH
ENV CATALINA_OPTS="$CATALINA_OPTS -Xmx10g -Xss1m"

Check warning on line 32 in docker/sigmakee/Dockerfile

View workflow job for this annotation

GitHub Actions / build-sumo-ci

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$CATALINA_OPTS' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
1 change: 1 addition & 0 deletions docker/sumo-ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ COPY ./sigmakee/build/WEB-INF/lib/*.jar /root/sigmakee/
COPY ./sigmakee/build/sigmakee.jar /root/sigmakee/

ENV SIGMA_HOME=/root/sigmakee-runtime
ENV LD_LIBRARY_PATH=/usr/local/bin:$LD_LIBRARY_PATH
1 change: 1 addition & 0 deletions nbproject/ide-targets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@
</fileset>
<!-- Prune KB after integration tests -->
<fileset dir="${sigma_home}/KBs">
<include name="*.fof"/>
<include name="*.tptp"/>
<include name="*.ser"/>
<include name="vamp-out.txt"/>
Expand Down

0 comments on commit 57ffdaf

Please sign in to comment.