Skip to content
This repository was archived by the owner on Aug 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
887c8e1
Add test for elastictube1d tutorial
Eder-K Sep 29, 2019
bd2fe35
Add referenceOutput for elastictube1d test
Eder-K Sep 29, 2019
d4d8859
Add travis commands for elastictube1d test
Eder-K Sep 29, 2019
90707d9
Add 1dtube to solver directory
Eder-K Sep 29, 2019
30a03b9
Fix wording
Eder-K Sep 29, 2019
0dc24ff
Print avg/max diff values after file content
Eder-K Sep 29, 2019
46a3f0d
Add 1dtube to test_type
Eder-K Sep 29, 2019
2a35fc3
Rename test to describe python version
Eder-K Oct 4, 2019
ebc814d
Add test for c++ version
Eder-K Oct 4, 2019
6b6d3d0
Add C++ version of elastictube1d test
Eder-K Oct 4, 2019
755c83a
Differentiate py and cxx version of elastictube1d
Eder-K Oct 4, 2019
a992016
Add C++ version of elastictube1d test
Eder-K Oct 4, 2019
efd4521
Add missing root permissions for copying results
Eder-K Oct 4, 2019
7cc0727
Update name of 1dtube argument
Eder-K Oct 4, 2019
4fa9c7b
Remove wrong cp command
Eder-K Oct 4, 2019
23f04b8
Run whole Dockerfile as root
Eder-K Oct 4, 2019
cceaa54
Remove unnecessary abbreviations
Eder-K Oct 4, 2019
ac9e172
Update 1dtube test names
Eder-K Oct 4, 2019
f01784f
Update 1dtube test names
Eder-K Oct 4, 2019
6fbbe57
Merge with develop and update to more recent folder structure (#155)
BenjaminRodenberg Jan 15, 2020
d9c372b
Merge branch 'develop' into EderK-add_elastictube1d_test
BenjaminRodenberg Jan 15, 2020
bdc1b17
Use branch of PR https://github.com/precice/elastictube1d/pull/22 unt…
BenjaminRodenberg Jan 16, 2020
a0f0497
Revert "Use branch of PR https://github.com/precice/elastictube1d/pul…
IshaanDesai Jan 17, 2020
92876ef
Update referenceOutput files for 1dtube_py (#161)
Eder-K Feb 15, 2020
71b7808
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K Feb 15, 2020
9d92ec8
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K Feb 15, 2020
53fbc65
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K Feb 15, 2020
2b49b05
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K Feb 17, 2020
46c1b90
Add os version to foldername
Eder-K Feb 17, 2020
1242506
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K Feb 25, 2020
31e7a9e
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K Mar 4, 2020
8e248e0
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K Mar 10, 2020
8cd9d96
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K Apr 22, 2020
2255e2b
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K May 10, 2020
f93b42c
Add 1dtube cxx to compose tests
Eder-K May 10, 2020
5991fee
Remove folder permission
Eder-K May 10, 2020
d48423d
Only run elastictube tests
Eder-K May 10, 2020
0c4461a
Add env variable
Eder-K May 10, 2020
65c5363
Restore user creation
Eder-K May 11, 2020
715115e
Add permissions
Eder-K May 11, 2020
62f8f2a
Remove unused volumes
Eder-K May 11, 2020
a39e79e
Make elastictube tests verbose
Eder-K May 11, 2020
f8aa6f9
Update 1dtube cxx reference
Eder-K May 13, 2020
bce48d1
Merge branch 'EderK-add_elastictube1d_test' of github.com:precice/sys…
Eder-K May 13, 2020
452e7a7
Use default develop branch
Eder-K May 14, 2020
b942efe
Improve text filter in compare_results.sh (#212)
Eder-K May 15, 2020
a6d2944
Fix style
Eder-K May 15, 2020
424fb8e
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K May 15, 2020
3cb0063
Merge branch 'develop' into EderK-add_elastictube1d_test
Eder-K May 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
94 changes: 52 additions & 42 deletions .travis.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion common.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_test_variants(test_name, root = os.path.join(os.getcwd(), 'tests')):

def get_test_participants(test_name):
""" Returns solvers that participate in the test """
solvers_abbr = {"ccx": "calculix-adapter", "su2": "su2-adapter", "of": "openfoam-adapter",
solvers_abbr = {"ccx": "calculix-adapter", "su2": "su2-adapter", "of": "openfoam-adapter",
"dealii":"dealii-adapter", "bindings": "bindings", "fe":"fenics-adapter", "nutils": "nutils"}

return [solvers_abbr[abbr] for abbr in test_name.lower().split('_')[0].split('-')]
Expand Down
25 changes: 19 additions & 6 deletions compare_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,34 @@ if [ -n "$diff_files" ]; then
mapfile -t array_files < <( echo "$diff_files" | sed 's/Files\|and\|differ//g' )
arr_len="${#array_files[@]}"

# loop through differing files
for (( i = 0; i<${arr_len}; i = i + 1));
do
file1=$( echo "${array_files[i]}" | awk '{print $1}' )
file2=$( echo "${array_files[i]}" | awk '{print $2}' )

raw_diff=$( diff -y --speed-large-files --suppress-common-lines "$file1" "$file2" )
# Filter output files, ignore lines with words (probably not the results)
# removes |<>() characters
# Do not delete "e", since it can be used as exponent
num_diff=$( echo "$raw_diff" | sed 's/(\|)\||\|>\|<//g; /[a-df-zA-Z]\|Version/d' )
# removes |<>() characters
num_filter='s/(\|)\||\|>\|<//g; /[a-df-zA-Z]\|[vV]ersion/d'
# Filter for text lines. Compare these seperately from numerical lines
text_diff=$( echo "$raw_diff" | sed '/[A-Za-df-z]/!d' )
# Ignore any timestamps
txt_filter='s/(\|)\||\|>\|<//g; /[a-df-zA-Z]\|[vV]ersion/!d; s/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]//g; /Timestamp\|[rR]untime\|Unexpected end of/d; /Run finished/q'
file1_num=$( cat "$file1" | sed "$num_filter")
file2_num=$( cat "$file2" | sed "$num_filter")

file1_txt=$( cat "$file1" | sed "$txt_filter")
file2_txt=$( cat "$file2" | sed "$txt_filter")


num_diff=$( diff -y --speed-large-files --suppress-common-lines <(echo "$file1_num") <(echo "$file2_num") )
txt_diff=$( diff -y --speed-large-files --suppress-common-lines <(echo "$file1_txt") <(echo "$file2_txt") )


# Pairwise compares files fields, that are produces from diffs and computes average and maximum
# relative differences
filename=$(basename $file1) # total file paths are pretty long, this keep info concise
echo "Comparing values in '$filename'..."
if [ -n "$num_diff" ]; then
rel_max_difference=$( export max_diff_limit; export avg_diff_limit; echo "$num_diff" | awk 'function abs(v) {return v < 0 ? -v : v} { radius=NF/2;
max_diff=0;
Expand All @@ -89,12 +101,13 @@ if [ -n "$diff_files" ]; then
# Split by space and transform into the array
difference=( $rel_max_difference )
echo -e "> Numerical difference in $file1 and $file2"
echo -e "$num_diff"
echo -e "Average: ${difference[0]} ; Maximum: ${difference[1]} ${NC}"
ret=1
fi
if [ -n "$text_diff" ]; then
if [ -n "$txt_diff" ]; then
echo -e "> Text difference in $file1 and $file2"
echo -e "$text_diff"
echo -e "$txt_diff"
ret=1
fi
done
Expand Down
4 changes: 2 additions & 2 deletions system_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def comparison(pathToRef, pathToOutput):
def build_run_compare(test, tag, branch, local_precice, force_rebuild, rm_all=False, verbose=False):
""" Runs and compares test, using precice branch. """
compose_tests = ["dealii-of", "of-of", "su2-ccx", "of-ccx", "of-of_np",
"fe-fe","nutils-of", "of-ccx_fsi"]
"fe-fe","nutils-of", "of-ccx_fsi", "1dtube_cxx", "1dtube_py"]
test_basename = test.split(".")[0]
if local_precice:
build_adapters(test_basename, tag, branch, local_precice, force_rebuild)
Expand Down Expand Up @@ -225,7 +225,7 @@ def compose_tag(docker_username, base, features, branch):
parser.add_argument('-l', '--local', action='store_true', help="Use local preCICE image (default: use remote image)")
parser.add_argument('-s', '--systemtest', type=str, help="Choose system tests you want to use",
choices = common.get_tests(), required = True)
parser.add_argument('-b', '--branch', help="preCICE branch to use", default=os.environ["TRAVIS_BRANCH"] if os.environ["TRAVIS_PULL_REQUEST"] == "false" else "develop") # make sure that branch corresponding to system tests branch is used, if no branch is explicitly specified. If we are testing a pull request, will test against develop by default.
parser.add_argument('-b', '--branch', help="preCICE branch to use", default="develop") # make sure that branch corresponding to system tests branch is used, if no branch is explicitly specified. If we are testing a pull request, will test against develop by default.
# Usage of the branch argument:
# When on a PR, this will by default use the develop versions of preCICE and adapter images.
# This makes it easier to experiment with tests, which are most commonly addressed by PRs
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCompose_1dtube_cxx.Ubuntu1604.home/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SYSTEST_REMOTE=precice/
PRECICE_BASE=
20 changes: 20 additions & 0 deletions tests/TestCompose_1dtube_cxx.Ubuntu1604.home/Dockerfile.1dtubecxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ARG from=precice/precice-ubuntu1604.home-develop
FROM $from
USER root

RUN apt-get -qq update && apt-get -qq install \
liblapack-dev && \
rm -rf /var/lib/apt/lists/*


ARG CACHEBUST


USER precice

WORKDIR /home/precice/
RUN git clone https://github.com/precice/elastictube1d.git

RUN mkdir -p Data/Output/Postproc
WORKDIR /home/precice/elastictube1d/cxx
RUN cmake . && make all
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from alpine

RUN apk add git
ARG branch=develop

WORKDIR /
# adjust configuration and paths
RUN mkdir Output
RUN addgroup -g 1000 precice && adduser -u 1000 -G precice -D precice Output
USER precice
34 changes: 34 additions & 0 deletions tests/TestCompose_1dtube_cxx.Ubuntu1604.home/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3'
services:
1dtube-ccx:
build:
context: .
dockerfile: Dockerfile.1dtubecxx
args:
from: "${SYSTEST_REMOTE}precice${PRECICE_BASE}"
networks:
- precicecomm
volumes:
- output:/home/precice/Data/Output/
command: >
/bin/bash -c "./Allrun &&
cp *.log /home/precice/Data/Output/ &&
cp -r Postproc /home/precice/Data/Output/ &&
rm /home/precice/Data/Output/*summary.log"
container_name: 1dtube-ccx

tutorial-data:
build:
context: .
dockerfile: Dockerfile.tutorial_data
args:
branch: "develop"
volumes:
- output:/Output/
container_name: tutorial-data


networks:
precicecomm:
volumes:
output:
Loading