Skip to content

Commit

Permalink
+preparo de docker-test, antunit-test
Browse files Browse the repository at this point in the history
  • Loading branch information
wdiestel committed Jan 24, 2022
1 parent 1f1d1ff commit d799ab8
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8

# ni aldone instalas antunit por ebligi testojn de la instalaĵo
# plibonigu: ni povus ŝovi ĉion pri testado en apartan staĝon, kiun ni
# uzas ekskluzive por testado
RUN curl -LO https://dlcdn.apache.org//ant/antlibs/antunit/binaries/apache-ant-antunit-1.4.1-bin.tar.bz2 \
# && apt-get install -y --no-install-recommends gpg
# && curl -O https://downloads.apache.org/ant/antlibs/antunit/source/apache-ant-antunit-1.4.1-src.tar.bz2.asc \
# && curl -O https://downloads.apache.org/ant/KEYS \
# && gpg --import KEYS && gpg --verify apache-ant-antunit*.asc \
&& tar -xf apache-ant-antunit* \
&& ln -s /apache-ant-antunit-*/ant-antunit-*.jar /usr/share/ant/lib/

# openssh-server && mkdir -p /var/run/sshd
# libsaxonhe-java: havas problemon transformante multajn artikolojn: normalizationData.xml not found...

Expand Down
26 changes: 26 additions & 0 deletions ant/au-testoj.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<project xmlns:au="antlib:org.apache.ant.antunit" default="go">
<!-- is called prior to the test
<target name="setUp">
<property name="foo" value="foo"/>
</target>-->

<!-- is called after the test, even if that caused an error
<target name="tearDown">
<delete file="${foo}" quiet="true"/>
</target> -->

<!-- the actual test case -->
<target name="testTouchCreatesFile">
<au:assertFileDoesntExist file="${foo}"/>
<touch file="${foo}"/>
<au:assertFileExists file="${foo}"/>
</target>

<target name="go">
<au:antunit>
<fileset dir="." includes="touch.xml"/>
<au:plainlistener/>
</au:antunit>
</target>

</project>
25 changes: 25 additions & 0 deletions tst/docker-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# tuj finu se unuopa komando fiaskas
# - necesas por distingi sukcesan de malsukcesa testaro
set -e

docker_image="${1:-voko-formiko:latest}"

# lanĉi la test-procezujon
docker run --name formiko-test --rm -d ${docker_image}

echo ""; echo "Ni petas helpon..."
docker exec formiko-test formiko art-helpo

echo ""; echo "Ni rigardas dosierujon..."
docker exec formiko-test bash -c 'ls /apache-*'

echo ""; echo "Ni rigardas ant-dosierujon..."
docker exec formiko-test bash -c 'pwd && ls ./voko/ant'

echo ""; echo "Ni lanĉas testaron..."
docker exec formiko-test bash -c 'ant -f ./voko/ant/au-testoj.xml'

echo ""; echo "Forigi..."
docker kill formiko-test

0 comments on commit d799ab8

Please sign in to comment.