Skip to content

Commit bb91fb3

Browse files
authored
Merge pull request #96 from DARMA-tasking/95-improve-ci-rendering-tests
#95: Improve CI rendering tests
2 parents 9f8e5a0 + b80c877 commit bb91fb3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+446
-247
lines changed

.github/workflows/build-and-test.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,6 @@ jobs:
7676
reporter: java-junit
7777
output-to: step-summary
7878

79-
- name: CCM Example output to summary
80-
if: ${{ (success() || failure()) && env.VT_TV_TESTS_ENABLED == 'ON' }}
81-
run: |
82-
echo '## CCM Example output' >> $GITHUB_STEP_SUMMARY
83-
if [ -f "${{ env.OUTPUT_DIR }}/tmp/artifacts/ccm_example0.png" ]; then
84-
echo '!'"[CCM Example](${{ env.OUTPUT_DIR }}/tmp/artifacts/ccm_example0.png)" >> $GITHUB_STEP_SUMMARY
85-
else
86-
echo 'Missing !' >> $GITHUB_STEP_SUMMARY
87-
fi
88-
8979
- name: Coverage summary
9080
if: ${{ (success() || failure()) && env.VT_TV_COVERAGE_ENABLED == 'ON' }}
9181
run: |

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ add_compile_definitions(SRC_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
5555
add_compile_definitions(BUILD_DIR="${CMAKE_BINARY_DIR}")
5656

5757
add_custom_target(vt_tv_examples)
58-
add_custom_target(vt_tv_tests)
58+
if (VT_TV_TESTS_ENABLED)
59+
add_custom_target(vt_tv_tests)
60+
endif()
5961
add_custom_target(vt_tv_apps)
6062

6163
set(PROJECT_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR})

README.md

Lines changed: 1 addition & 1 deletion

build.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ VT_TV_COVERAGE_ENABLED=$(on_off ${VT_TV_COVERAGE_ENABLED:-OFF})
4040
VT_TV_CLEAN=$(on_off ${VT_TV_CLEAN:-ON})
4141
VT_TV_PYTHON_BINDINGS_ENABLED=$(on_off ${VT_TV_PYTHON_BINDINGS_ENABLED:-OFF})
4242
VT_TV_WERROR_ENABLED=$(on_off ${VT_TV_WERROR_ENABLED:-OFF})
43+
VT_TV_XVFB_ENABLED=$(on_off ${VT_TV_XVFB_ENABLED:-OFF})
4344
# >> Run tests settings
4445
VT_TV_RUN_TESTS=$(on_off ${VT_TV_RUN_TESTS:-OFF})
4546
VT_TV_RUN_TESTS_FILTER=${VT_TV_RUN_TESTS_FILTER:-""}
@@ -76,6 +77,8 @@ help() {
7677
-r --tests-run=[bool] Run unit tests (and build coverage report if coverage is enabled) (VT_TV_RUN_TESTS=$VT_TV_RUN_TESTS)
7778
-f --tests-run-filter=[str] Filter unit test to run. (VT_TV_RUN_TESTS_FILTER=$VT_TV_RUN_TESTS_FILTER)
7879
80+
-x --xvfb=[bool] Use X Virtual Frame Buffer instead of default for rendering (VT_TV_XVFB_ENABLED=$VT_TV_XVFB_ENABLED)
81+
7982
-h --help Show help and default option values.
8083
8184
Examples:
@@ -123,6 +126,7 @@ while getopts btch-: OPT; do # allow -b -t -c -h, and --long_attr=value"
123126
r | tests-run ) VT_TV_RUN_TESTS=$(on_off $OPTARG) ;;
124127
f | tests-run-filter) VT_TV_RUN_TESTS_FILTER="$OPTARG" ;;
125128
k | vtk-dir ) VTK_DIR=$(realpath "$OPTARG") ;;
129+
x | xvfb ) VT_TV_XVFB_ENABLED=$(on_off $OPTARG) ;;
126130
h | help ) help ;;
127131

128132
\? ) exit 2 ;; # bad short option (error reported via getopts)
@@ -142,6 +146,7 @@ echo VT_TV_PYTHON_BINDINGS_ENABLED=$VT_TV_PYTHON_BINDINGS_ENABLED
142146
echo VT_TV_RUN_TESTS=$VT_TV_RUN_TESTS
143147
echo VT_TV_TESTS_ENABLED=$VT_TV_TESTS_ENABLED
144148
echo VT_TV_TEST_REPORT=$VT_TV_TEST_REPORT
149+
echo VT_TV_XVFB_ENABLED=$VT_TV_XVFB_ENABLED
145150
echo VT_TV_RUN_TESTS_FILTER=$VT_TV_RUN_TESTS_FILTER
146151
echo VT_TV_COVERAGE_ENABLED=$VT_TV_COVERAGE_ENABLED
147152
echo VT_TV_COVERAGE_REPORT=$VT_TV_COVERAGE_REPORT
@@ -208,10 +213,21 @@ if [[ "$VT_TV_RUN_TESTS" == "ON" ]]; then
208213

209214
gtest_cmd="\"$VT_TV_BUILD_DIR/tests/unit/AllTests\" $GTEST_OPTIONS"
210215
echo "Run GTest..."
216+
217+
CURRENT_DISPLAY=$(echo $DISPLAY)
218+
if [[ "$VT_TV_RUN_TESTS" == "ON" ]]; then
219+
export DISPLAY=:99.0
220+
Xvfb :99 -screen 0 1024x768x24 -nolisten tcp > /dev/null 2>&1 &
221+
sleep 1s
222+
fi
211223
eval "$gtest_cmd" || true
224+
if [[ "$VT_TV_RUN_TESTS" == "ON" ]]; then
225+
pkill Xvfb
226+
export DISPLAY=$CURRENT_DISPLAY
227+
rm -rf /tmp/.X11-unix/X99
228+
fi
212229

213230
echo "Tests done."
214-
215231
popd
216232
fi
217233

ci/build.sh

100755100644
File mode changed.

ci/docker/README.md

Lines changed: 12 additions & 0 deletions

ci/docker/build-and-test.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG BASE_IMAGE=lifflander1/vt:ubuntu_22.04-gcc_11-vtk_9.2.2-py_3.8
22
ARG VT_TV_TESTS_ENABLED=OFF
33
ARG VT_TV_COVERAGE_ENABLED=OFF
4-
ARG VT_TV_PYTHON_BINDINGS_ENABLED=OFF
4+
ARG VT_TV_PYTHON_BINDINGS_ENABLED=ON
55

66
FROM ${BASE_IMAGE} AS base
77

ci/docker/make-base.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG BASE_IMAGE=ubuntu:22.04
77
FROM ${BASE_IMAGE} AS base
88

99
# Arguments
10-
ARG VTK_VERSION=v9.2.2
10+
ARG VTK_VERSION=9.2.2
1111
ARG PYTHON_VERSION=3.8
1212
ARG CC=gcc-11
1313
ARG CXX=g++-11

ci/test_cpp.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
set -ex
44

5-
export DISPLAY=:99.0
6-
7-
# Start custom display with X virtual frame buffer
8-
Xvfb :99 -screen 0 1024x768x24 -nolisten tcp > /dev/null 2>&1 &
9-
sleep 1s
10-
115
VT_TV_OUTPUT_DIR=/var/vt-tv/output
126
VT_TV_TESTS_OUTPUT_DIR=/opt/src/vt-tv/output/tests
137

@@ -19,6 +13,7 @@ bash -c "VTK_DIR=/opt/build/vtk \
1913
VT_TV_COVERAGE_ENABLED=${VT_TV_COVERAGE_ENABLED:-OFF} \
2014
VT_TV_OUTPUT_DIR=$VT_TV_OUTPUT_DIR \
2115
VT_TV_RUN_TESTS=ON \
16+
VT_TV_XVFB_ENABLED=ON \
2217
/opt/src/vt-tv/build.sh"
2318

2419
# Add artifacts
@@ -53,8 +48,3 @@ popd
5348

5449
# list artifacts dir content
5550
ls $VT_TV_ARTIFACTS_DIR
56-
57-
# Clean and restore regular display
58-
pkill Xvfb
59-
rm -rf /tmp/.X11-unix/X99
60-
export DISPLAY=:0

config/conf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
input:
2-
directory: tests/data/lb_test_data
2+
directory: data/lb_test_data
33
n_ranks: 4
44

55
viz:

0 commit comments

Comments
 (0)