Skip to content
Snippets Groups Projects
Commit cc5d9c3d authored by jonny's avatar jonny
Browse files

added test logic

parent b816da37
Branches
No related tags found
No related merge requests found
Pipeline #13288 failed
...@@ -2,6 +2,7 @@ image: haskell:8.10.7 ...@@ -2,6 +2,7 @@ image: haskell:8.10.7
stages: stages:
- build - build
- test
- trigger - trigger
build-job: build-job:
...@@ -18,6 +19,18 @@ build-job: ...@@ -18,6 +19,18 @@ build-job:
paths: paths:
- dist - dist
run-test:
stage: test
dependencies:
- build-job
script:
- ./test/run-tests.sh
artifacts:
expire_in: 7 days
when: always
paths:
- 'test/test-output'
trigger-mapservice-pipeline: trigger-mapservice-pipeline:
only: only:
refs: refs:
......
{
"haskell.formattingProvider": "none",
"json.format.enable": false
}
\ No newline at end of file
{
"mapInfo": {},
"result": {
"exitGraph": "digraph G {\n\n}\n",
"mapLints": {},
"missingAssets": [],
"missingDeps": [
{
"depFatal": true,
"entrypoint": "main.json",
"neededBy": []
}
]
},
"severity": "Innfo"
}
{
"tiledversion": "1.6.0",
"version": "1.6",
"width": 1,
"height": 1,
"tilewidth": 32,
"tileheight": 32,
"orientation": "orthogonal",
"layers": [],
"renderorder": "left-down",
"nextobjectid": 3,
"infinite": false,
"type": "map",
"tilesets": []
}
{
"mapInfo": {
"main.json": {
"badges": []
}
},
"result": {
"exitGraph": "digraph G {\nn0[label=\"main.json\"];\n\n}\n",
"mapLints": {
"main.json": {
"general": [
{
"level": "Warning",
"msg": "main.json should link back to the lobby"
},
{
"level": "Suggestion",
"msg": "consider adding meta information to your map using the \"mapName\", \"mapDescription\", \"mapLink\" properties."
},
{
"level": "Suggestion",
"msg": "document the map's copyright via the \"mapCopyright\" property."
},
{
"level": "Error",
"msg": "The map must contain at least one layer with the property \"exitUrl\" set."
},
{
"level": "Error",
"msg": "The map must have one layer named \"floorLayer\" of type \"objectgroup\"."
},
{
"level": "Error",
"msg": "The map must have one layer named \"start\"."
}
],
"layer": {},
"tileset": {}
}
},
"missingAssets": [],
"missingDeps": []
},
"severity": "Error"
}
#!/bin/bash
TEST_FOLDERS=$(ls -d */)
FAILED=0
if ! command -v jq &> /dev/null
then
apt-get update
apt-get install -y jq
fi
for folder in $TEST_FOLDERS
do
dir=${folder%/}
if [ "$dir" != "test-output" ]; then
echo "running for $dir"
EXPECTED=$(jq . "./${dir}/output.json")
ACTUAL=$(cd .. && stack run -- walint --repository ./test/${dir} --config-file ./config.json --json --pretty | jq && cd test)
if [ "$EXPECTED" != "$ACTUAL" ]; then
FAILED=1
mkdir -p ./test-output
echo "$ACTUAL" > "./test-output/${dir}.json"
echo "$EXPECTED doenst match $ACTUAL"
fi
fi
done
exit $FAILED
\ No newline at end of file
{
"mapInfo": {},
"result": {
"exitGraph": "digraph G {\n\n}\n",
"mapLints": {},
"missingAssets": [],
"missingDeps": [
{
"depFatal": true,
"entrypoint": "main.json",
"neededBy": []
}
]
},
"severity": "Info"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment