Commit 150e37ef authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

implement unit tests stage

parent 5b3b3942
image: frekele/ant
image: docker.gitlab.gwdg.de/fontane-notizbuecher/build:latest
variables:
EXIST-DB: "eXist-db-4.3.1"
stages:
- build
- test
- deploy
ant:
......@@ -12,6 +16,23 @@ ant:
paths:
- build/*.xar
installation:
stage: test
script:
- wget --quite --output-document=${EXIST-DB}.tar.gz https://bintray.com/existdb/releases/download_file?file_path=${EXIST-DB}.tar.gz
- tar -xzf ${EXIST-DB}.tar.gz
- cp build/*.xar ${EXIST-DB}/autodeploy
- bash ${EXIST-DB}/bin/startup.sh | tee output.log &
# wait for eXist
- while [ $(curl -I -s http://localhost:8080 | grep -c "200 OK") == 0 ]; do sleep 2s; done
# shutdown eXist
- bash ${EXIST-DB}/bin/shutdown.sh
- mv /tmp/tests-*.xml .
artifacts:
paths:
- output.log
- tests-*.xml
upload:
stage: deploy
script:
......
......@@ -5,7 +5,6 @@
<property name="build.dir" value="build"/>
<target name="xar">
<copy file="expath-pkg.xml.tmpl" tofile="expath-pkg.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.version" value="${project.version}"/>
......
xquery version "3.1";
exrest:register-module(xs:anyURI("/db/apps/SADE/modules/fontane/index-api.xqm")),
exrest:register-module(xs:anyURI("/db/apps/SADE/modules/fontane/toc-api.xqm"))
exrest:register-module(xs:anyURI("/db/apps/SADE/modules/fontane/toc-api.xqm")),
let $doc := doc("expath-pkg.xml")//*:package,
$app := string($doc/@abbrev),
$version := string($doc/@version),
$filename := string-join(("/tmp/tests", $app, $version), "-") || ".xml"
return
<tests application="{$app}" version="{$version}">{util:eval("modules/fontane/tests.xq")}</tests>
=> file:serialize($filename, ())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment