-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathrun-dotnet-tests.sh
More file actions
executable file
·51 lines (43 loc) · 1.22 KB
/
Copy pathrun-dotnet-tests.sh
File metadata and controls
executable file
·51 lines (43 loc) · 1.22 KB
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
46
47
48
49
50
51
#!/usr/bin/env bash
# Copyright (c) Microsoft Corporation. All rights reserved.
# Runs .NET SDK tests with optional backend filtering.
set -euo pipefail
usage() {
cat <<'EOF'
Usage: run-dotnet-tests.sh [--help]
Runs the full .NET SDK test project. Environment variables:
DOTNET_TEST_FILTER Optional dotnet test filter (e.g. for a backend or transport).
DOTNET_TEST_RUNTIME Optional runtime identifier passed to dotnet test.
DOTNET_TEST_RESULTS_DIRECTORY Results directory (default: TestResults).
EOF
}
if (($# == 1)) && [[ "$1" == "--help" ]]; then
usage
exit 0
fi
if (($# != 0)); then
usage >&2
exit 2
fi
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
cd "$script_dir/../../dotnet"
args=(
test/GitHub.Copilot.SDK.Test.csproj
--no-build
-v n
--blame-hang
--blame-hang-timeout 10m
--blame-hang-dump-type none
--logger "trx;LogFilePrefix=test-results"
--results-directory "${DOTNET_TEST_RESULTS_DIRECTORY:-TestResults}"
-p:RunAnalyzers=false
)
filter="${DOTNET_TEST_FILTER:-}"
runtime="${DOTNET_TEST_RUNTIME:-}"
if [[ -n "$filter" ]]; then
args+=(--filter "$filter")
fi
if [[ -n "$runtime" ]]; then
args+=(--runtime "$runtime")
fi
dotnet test "${args[@]}"