Skip to content

Commit

Permalink
Make tests use local files instead of /tmp/ for opam CI
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinepouille committed Sep 13, 2024
1 parent aa2ebef commit 1d09469
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions tests/integration/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This is meant to be run from `make check` or `make build-tests` in root directory
# To run this not through the repo root Makefile, please provide the $KAPPABIN path
OUTPUT_PATH:=output
ERROR:=error
Expand All @@ -19,6 +20,7 @@ help:
@echo 'make clean: recursively clean everything but the reference files'
@echo 'make clean_all: recursively clean everything including the reference files'
@echo
@echo 'This is meant to be run from `make check` or `make build-tests` in root directory'
@echo 'To run this from this directory and not from the root Makefile, please specify the KAPPABIN path in the environment.'

# NOTE: COMMENT THIS TO DEBUG
Expand Down
8 changes: 5 additions & 3 deletions tests/integration/cflows/cflows_json/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#Command-line:
"${KAPPABIN}"KaSim json.ka -seed 840540685 -l 5 -d output -trace /tmp/cflow-json-trace.json -syntax 4 || exit 0
"${KAPPABIN}"KaStor --weak -format json /tmp/cflow-json-trace.json -d output --time-independent || exit 0
#!/bin/sh
TRACE_FILE="./tmp__cflow-json-trace.json"
"${KAPPABIN}"KaSim json.ka -seed 840540685 -l 5 -d output -trace ${TRACE_FILE} -syntax 4 || exit 0
"${KAPPABIN}"KaStor --weak -format json ${TRACE_FILE} -d output --time-independent || exit 0
rm -f ${TRACE_FILE}
2 changes: 1 addition & 1 deletion tests/integration/cflows/cflows_json/output/LOG.ref
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ done
-initial conditions
+ Building initial state (2000 agents)
Done
+ Command line to rerun is: 'KaSim' 'json.ka' '-seed' '840540685' '-l' '5' '-d' 'output' '-trace' '/tmp/cflow-json-trace.json' '-syntax' '4'
+ Command line to rerun is: 'KaSim' 'json.ka' '-seed' '840540685' '-l' '5' '-d' 'output' '-trace' './tmp__cflow-json-trace.json' '-syntax' '4'
______________________________________________________________________
######################################################################
Simulation ended
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/cflows/cflows_json/output/data.csv.ref
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Output of 'KaSim' 'json.ka' '-seed' '840540685' '-l' '5' '-d' 'output' '-trace' '/tmp/cflow-json-trace.json' '-syntax' '4'
# Output of 'KaSim' 'json.ka' '-seed' '840540685' '-l' '5' '-d' 'output' '-trace' './tmp__cflow-json-trace.json' '-syntax' '4'
"[T]","ApBp","ABA"
0.,0,0
1.,66,0
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/cflows/cflows_json/output/inputs.ka.ref
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
%def: "progressBarSymbol" "#"
%def: "plotPeriod" "1" "t.u."
%def: "outputFileName" "data.csv"
%def: "traceFileName" "/tmp/cflow-json-trace.json"
%def: "traceFileName" "./tmp__cflow-json-trace.json"

%agent: A(a{u p}[a.B b.B])
%agent: B(a{u p}[a.A] b[a.A])
Expand Down
4 changes: 1 addition & 3 deletions tests/integration/simulation/marshal/README
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/sh

BLOB=/tmp/KaSim-test-blob-$(basename $PWD)

BLOB=./tmp__KaSim-test-blob-$(basename $PWD)
"${KAPPABIN}"KaSim --compile -make-sim ${BLOB} -seed 496408597 -d output model.ka -syntax 4 && \
"${KAPPABIN}"KaSim --compile -load-sim ${BLOB} -seed 958076642 -d output -syntax 4 && \
"${KAPPABIN}"KaSim --compile -load-sim ${BLOB} -seed 458154606 -d output -var init 300 -syntax 4 || exit 0
Expand Down
10 changes: 5 additions & 5 deletions tests/integration/simulation/marshal/output/LOG.ref
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ done
-initial conditions
+ Building initial state (200 agents)
Done
+ Command line to rerun is: 'KaSim' '--compile' '-make-sim' '/tmp/KaSim-test-blob-marshal' '-seed' '496408597' '-d' 'output' 'model.ka' '-syntax' '4'
+ Loading simulation package /tmp/KaSim-test-blob-marshal...
+ Command line to rerun is: 'KaSim' '--compile' '-make-sim' './tmp__KaSim-test-blob-marshal' '-seed' '496408597' '-d' 'output' 'model.ka' '-syntax' '4'
+ Loading simulation package ./tmp__KaSim-test-blob-marshal...
+ Building initial state (200 agents)
Done
+ Command line to rerun is: 'KaSim' '--compile' '-load-sim' '/tmp/KaSim-test-blob-marshal' '-seed' '958076642' '-d' 'output' '-syntax' '4'
+ Loading simulation package /tmp/KaSim-test-blob-marshal...
+ Command line to rerun is: 'KaSim' '--compile' '-load-sim' './tmp__KaSim-test-blob-marshal' '-seed' '958076642' '-d' 'output' '-syntax' '4'
+ Loading simulation package ./tmp__KaSim-test-blob-marshal...
+ Building initial state (600 agents)
Done
+ Command line to rerun is: 'KaSim' '--compile' '-load-sim' '/tmp/KaSim-test-blob-marshal' '-seed' '458154606' '-d' 'output' '-var' 'init' '300' '-syntax' '4'
+ Command line to rerun is: 'KaSim' '--compile' '-load-sim' './tmp__KaSim-test-blob-marshal' '-seed' '458154606' '-d' 'output' '-var' 'init' '300' '-syntax' '4'

0 comments on commit 1d09469

Please sign in to comment.