Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chaofan Chen
ogs
Commits
c1fde293
Commit
c1fde293
authored
1 year ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[scr/ci] Work around xvfb-run errors
parent
6e376506
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/ci/extends/template-build-linux.yml
+26
-4
26 additions, 4 deletions
scripts/ci/extends/template-build-linux.yml
scripts/ci/jobs/jupyter.yml
+15
-1
15 additions, 1 deletion
scripts/ci/jobs/jupyter.yml
with
41 additions
and
5 deletions
scripts/ci/extends/template-build-linux.yml
+
26
−
4
View file @
c1fde293
...
...
@@ -18,6 +18,25 @@
# Activate .venv
-
test -f $build_dir_full/.venv/bin/activate && source $build_dir_full/.venv/bin/activate
-
|
function maybe_run_with_xvfb()
{
if [[ "$OSTYPE" == "darwin"* ]]; then
"$@"
elif command -v xvfb-run &> /dev/null ; then
local ctest_status_file="$build_dir_full/ctest_status"
rm -f "$ctest_status_file"
# status file and sh -c to workaround xvfb-run problems:
# /usr/bin/xvfb-run: line 186: kill: (<PID>) - No such process"
xvfb-run -a \
sh -c 'statf="$1"; shift; "$@"; echo "$?" >"$statf"' \
-- "$ctest_status_file" "$@" \
|| true
[ 0 = "`cat "$ctest_status_file"`" ]
else
"$@"
fi
}
if [[ -z "$TARGETS" ]]; then
if [ "$BUILD_PACKAGE" = false ]; then
...
...
@@ -41,11 +60,8 @@
preset_postfix="-large"
fi
xvfb_run_cmd=""
if [[ "$OSTYPE" == "darwin"* ]]; then
alias date=gdate
elif command -v xvfb-run &> /dev/null ; then
xvfb_run_cmd="xvfb-run -a"
fi
ctest_arguments=""
...
...
@@ -68,7 +84,13 @@
if [[ "$CI_MERGE_REQUEST_LABELS" =~ .*unit_tests.* ]]; then
echo "Skipping ctests because of unit_tests-label."
else
eval ${xvfb_run_cmd} ctest -M Experimental --group ${ctest_group} ${regex_argument} --test-dir ${build_dir_full} -T Start -T Test -T Submit ${ctest_arguments} --output-junit Tests/ctest.xml --stop-time `date -d "today + ${ctest_timeout} minutes" +'%H:%M:%S'`
maybe_run_with_xvfb ctest \
-M Experimental --group "${ctest_group}" "${regex_argument}" \
--test-dir "${build_dir_full}" -T Start -T Test -T Submit \
${ctest_arguments} \
--output-junit Tests/ctest.xml \
--stop-time "`date -d "today + ${ctest_timeout} minutes" +'%H:%M:%S'`" \
--no-tests=error
fi
fi
...
...
This diff is collapsed.
Click to expand it.
scripts/ci/jobs/jupyter.yml
+
15
−
1
View file @
c1fde293
...
...
@@ -11,7 +11,21 @@ test notebooks via wheel:
# TODO:
# - better timeout
# - run in parallel
-
find . -type f -iname '*.ipynb' | grep -vP '\.ipynb_checkpoints|\.ci-skip.ipynb$|_out|.venv|PhaseField' | xargs xvfb-run -a python Notebooks/testrunner.py --out _out
-
|
status_file="`mktemp --tmpdir`"
echo 0 >"$status_file" # success if no Notebooks are found
# status file and sh -c to workaround xvfb-run problems:
# /usr/bin/xvfb-run: line 186: kill: (<PID>) - No such process"
find . -type f -iname '*.ipynb' \
| grep -vP '\.ipynb_checkpoints|\.ci-skip\.ipynb$|_out|\.venv|PhaseField' \
| xargs xvfb-run -a \
sh -c 'statf="$1"; shift; "$@" || echo "$?" >"$statf"' \
-- "$status_file" \
python Notebooks/testrunner.py --out _out \
|| true
status="`cat "$status_file"`"
rm "$status_file"
[ 0 = "$status" ]
artifacts
:
when
:
always
paths
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment