diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..91bfa25 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.* +venv +build diff --git a/Dockerfile b/Dockerfile index cc36142..e15a2e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:20.04 -RUN apt-get update && apt-get install -y python3 python3-pip git +RUN apt-get update && apt-get install -y python3 python3-pip git && rm -rf /var/lib/apt/lists/* COPY . /npf RUN cd /npf && python3 -m pip install -r /npf/requirements.txt CMD [""] diff --git a/integration/integration.sh b/integration/integration.sh index 3b13d55..9b32371 100755 --- a/integration/integration.sh +++ b/integration/integration.sh @@ -3,12 +3,11 @@ ret=0 -#Function that launches a npf test on click-2022 and compare the expected output -compare() { - test=$1 - python=$2 +compare_raw() { + test=$2 + python=$3 echo "Executing npf test $test..." - $python npf.py click-2022 --force-test --no-graph-time --test integration/$test.npf --quiet-build ${@:3} &> res$test + $python $1 click-2022 --force-test --no-graph-time --test integration/$test.npf --quiet-build ${@:4} &> res$test if [ $? -ne 0 ] ; then echo "npf.py returned an error for test $test !" cat res$test @@ -19,12 +18,17 @@ compare() { echo "$test passed !" else echo "Error for $test : expected output does not match !" - echo "Command : $python npf.py click-2022 --force-test --test integration/$test.npf --quiet-build ${@:3}" + echo "Command : $python $1 click-2022 --force-test --test integration/$test.npf --quiet-build ${@:4}" diff res$test integration/$test.stdout ret=1 fi } +#Function that launches a npf test on click-2022 and compare the expected output +compare() { + compare_raw npf.py $@ +} + #Function that launch watcher on a npf test with click-2022 and compare the expected output compare_watcher() { test=watcher @@ -79,6 +83,12 @@ fi try integration/empty.npf $python +compare_raw npf_compare.py single $python --csv out.csv +diff out.csv integration/single.csv +if [ $? -ne 0 ] ; then + echo "single.csv changed !" + ret=1 +fi compare experimental $python compare pyexit $python compare integration-01 $python diff --git a/integration/single.csv b/integration/single.csv new file mode 100644 index 0000000..7c50133 --- /dev/null +++ b/integration/single.csv @@ -0,0 +1,4 @@ +index,build,test_index,y_D,run_index +0,Local,0,4.0,0 +1,Local,0,4.0,1 +2,Local,0,4.0,2 diff --git a/integration/single.npf b/integration/single.npf new file mode 100644 index 0000000..2c476d6 --- /dev/null +++ b/integration/single.npf @@ -0,0 +1,6 @@ +%variables +N=2 +X=3 + +%script +echo "RESULT-D 4" diff --git a/integration/single.stdout b/integration/single.stdout new file mode 100644 index 0000000..af7dcc1 --- /dev/null +++ b/integration/single.stdout @@ -0,0 +1,12 @@ +[Click 2022] Running test single.npf on version 9197a59... +Executing init scripts... +N = 2, X = 3 [run 1/3 for test 1/1] +[0] RESULT-D 4 +N = 2, X = 3 [run 2/3 for test 1/1] +[0] RESULT-D 4 +N = 2, X = 3 [run 3/3 for test 1/1] +[0] RESULT-D 4 +[4.0, 4.0, 4.0] +Generating graphs... +Pandas dataframe written to out.csv +Graph of test written to /npf/compare/single_click-2022-D.pdf