File: check_windows_test_ignore_list

package info (click to toggle)
gitlab-ci-multi-runner 14.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 31,248 kB
  • sloc: sh: 1,694; makefile: 384; asm: 79; ruby: 68
file content (45 lines) | stat: -rwxr-xr-x 1,496 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash

set -eo pipefail

borderTop() {
    echo
    echo "========================================================================================================================="
}

borderBottom() {
    echo "========================================================================================================================="
    echo
}

WINDOWS_VERSION=${WINDOWS_VERSION:-servercore1809}
TESTDEFINITIONFILES=${TESTDEFINITIONFILES:-$(ls -1 */testsdefinitions.txt)}

effectiveTestNamesFile="$(mktemp)"
ignoredTestNamesFile="$(mktemp)"
diffsFile="$(mktemp)"

cleanup_trap() {
  local error_code=$?

  rm -f "${effectiveTestNamesFile}" "${ignoredTestNamesFile}" "${diffsFile}"

  exit "${error_code}"
}

trap cleanup_trap ERR SIGINT SIGTERM

# Massage the files into files that are sorted and contain only root test names so they can be compared
grep --no-filename -oP 'Test[a-zA-Z_0-9]+' ${TESTDEFINITIONFILES} | sort | uniq > "${effectiveTestNamesFile}"
grep --no-filename -v '/' "ci/.test-failures.${WINDOWS_VERSION}.txt" | sort | uniq > "${ignoredTestNamesFile}"
# Check for lines in ignoredTestNamesFile which are not in effectiveTestNamesFile
comm -23 "${ignoredTestNamesFile}" "${effectiveTestNamesFile}" > "${diffsFile}"
if [[ $(wc -l < "${diffsFile}") -ne 0 ]]; then
  borderTop
  echo "Please remove the following test names from ci/.test-failures.${WINDOWS_VERSION}.txt. They no longer exist in the codebase:"
  echo
  cat "${diffsFile}"
  borderBottom

  exit 1
fi