Debian Codegraph @

ansible_collections/community/docker/.azure-pipelines/scripts/process-results.sh

raw
1 #!/usr/bin/env bash
2 # Check the test results and set variables for use in later steps.
3
4 # Copyright (c) Ansible Project
5 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
6 # SPDX-License-Identifier: GPL-3.0-or-later
7
8 set -o pipefail -eu
9
10 if [[ "$PWD" =~ /ansible_collections/ ]]; then
11 output_path="tests/output"
12 else
13 output_path="test/results"
14 fi
15
16 echo "##vso[task.setVariable variable=outputPath]${output_path}"
17
18 if compgen -G "${output_path}"'/junit/*.xml' > /dev/null; then
19 echo "##vso[task.setVariable variable=haveTestResults]true"
20 fi
21
22 if compgen -G "${output_path}"'/bot/ansible-test-*' > /dev/null; then
23 echo "##vso[task.setVariable variable=haveBotResults]true"
24 fi
25
26 if compgen -G "${output_path}"'/coverage/*' > /dev/null; then
27 echo "##vso[task.setVariable variable=haveCoverageData]true"
28 fi