From: Mark Hansen Date: Fri, 22 May 2020 04:42:55 +0000 (+1000) Subject: Redirect stderr to stdout for python unittest X-Git-Tag: 2.44.1~69^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e94dbec5e04e6cf0f50de7172928ab397dc5086;p=graphviz Redirect stderr to stdout for python unittest Powershell fails the entire batch file if it sees any output on stderr. Migrated to powershell because batch files are old, I don't really want to use batch. --- diff --git a/appveyor.yml b/appveyor.yml index 3551bf9cc..f1d62e58f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -76,7 +76,7 @@ build_script: $env:Path = $env:APPVEYOR_BUILD_FOLDER + "\" + $env:configuration + "\Graphviz\bin" + ";" + $env:Path; dot -c; cd tests\regression_tests; - ./regression_tests.bat; + ./regression_tests.ps1; } artifacts: diff --git a/tests/regression_tests/regression_tests.bat b/tests/regression_tests/regression_tests.bat deleted file mode 100644 index a076e83ae..000000000 --- a/tests/regression_tests/regression_tests.bat +++ /dev/null @@ -1,9 +0,0 @@ -@ECHO OFF - -pushd shapes -python shapes.py -popd - -REM Larger graph testing -# FIXME: re-enable when https://gitlab.com/graphviz/graphviz/-/issues/1710 is fixed -#python -m unittest discover large diff --git a/tests/regression_tests/regression_tests.ps1 b/tests/regression_tests/regression_tests.ps1 new file mode 100644 index 000000000..b9e05b1c5 --- /dev/null +++ b/tests/regression_tests/regression_tests.ps1 @@ -0,0 +1,10 @@ +Push-Location shapes +python shapes.py +Pop-Location + +# Larger graph testing +# Python unittest prints to stderr, but Powershell interprets stderr +# messages as an error, failing the pipeline. So we must redirect +# stderr to stdout. The line noise at the end does so. See +# https://stackoverflow.com/a/20950421/171898 for explanation. +python -m unittest discover large 2>&1 | %{ "$_" }