diff --git a/ci/azure/posix.yml b/ci/azure/posix.yml index c5676e0a2a6a0..62532f7630318 100644 --- a/ci/azure/posix.yml +++ b/ci/azure/posix.yml @@ -53,18 +53,22 @@ jobs: echo "Creating Environment" ci/setup_env.sh displayName: 'Setup environment and build pandas' + - script: | export PATH=$HOME/miniconda3/bin:$PATH source activate pandas-dev ci/run_tests.sh displayName: 'Test' + - script: | export PATH=$HOME/miniconda3/bin:$PATH source activate pandas-dev && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd + - task: PublishTestResults@2 inputs: testResultsFiles: 'test-data-*.xml' testRunTitle: ${{ format('{0}-$(CONDA_PY)', parameters.name) }} + - powershell: | $junitXml = "test-data-single.xml" $(Get-Content $junitXml | Out-String) -match 'failures="(.*?)"' @@ -90,6 +94,7 @@ jobs: Write-Error "$($matches[1]) tests failed" } displayName: 'Check for test failures' + - script: | export PATH=$HOME/miniconda3/bin:$PATH source activate pandas-dev diff --git a/ci/run_tests.sh b/ci/run_tests.sh index ee46da9f52eab..103385c9a2541 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -46,9 +46,20 @@ do fi PYTEST_CMD="pytest -m \"$TYPE_PATTERN$PATTERN\" -n $NUM_JOBS -s --strict --durations=10 --junitxml=test-data-$TYPE.xml $TEST_ARGS $COVERAGE pandas" + echo $AGENT_OS + if [[ "$AGENT_OS" == "Linux" ]]; then + echo "Emulating X server with xvfb for clipboard tests to run (this should only be displayed in Linux build of Azure Pipelines)" + DISPLAY=:99.0 + PYTEST_CMD="xvfb-run $PYTEST_CMD" + # Sleeping a bit the second time we execute the tests with xvfb to make sure the previous execution finished + if [ -n $PYTEST_PID ]; then + timeout 60 tail --pid=$pid -f /dev/null + fi + fi echo $PYTEST_CMD # if no tests are found (the case of "single and slow"), pytest exits with code 5, and would make the script fail, if not for the below code sh -c "$PYTEST_CMD; ret=\$?; [ \$ret = 5 ] && exit 0 || exit \$ret" + PYTEST_PID=$! if [[ "$COVERAGE" && $? == 0 ]]; then echo "uploading coverage for $TYPE tests"