Repository navigation
Expand file tree
/
Copy pathrun-dotnet-tests.sh
More file actions
executable file
·125 lines (118 loc) · 4.95 KB
/
Copy pathrun-dotnet-tests.sh
File metadata and controls
executable file
·125 lines (118 loc) · 4.95 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/env bash
# Copyright (c) Microsoft Corporation. All rights reserved.
# Runs the requested .NET SDK test shard with optional backend filtering.
set -euo pipefail
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 TestResults
-p:RunAnalyzers=false
)
filter="${DOTNET_TEST_FILTER:-}"
shard="${DOTNET_TEST_SHARD:-full}"
runtime="${DOTNET_TEST_RUNTIME:-}"
if [[ "$shard" != "full" ]]; then
case "$shard" in
1)
initials="A C D H I J K L M N Q S U W Y"
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.ConnectionToken"
;;
2)
initials="B E F G O P R T V X Z"
shard_filter=""
;;
2a)
initials="B E F G"
shard_filter=""
;;
2b-pending)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.PendingWorkResumeE2ETests"
;;
2b-permission)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.PermissionE2ETests"
;;
2b-auth)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.PerSessionAuthE2ETests"
;;
2b-hooks)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.PreMcpToolCallHookE2ETests"
;;
2b-unit-p)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.Unit.P"
;;
2b-provider)
initials="O"
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.ProviderEndpointE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RewindE2ETests|FullyQualifiedName~GitHub.Copilot.Test.Unit.R"
;;
2b-rpc-additional)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcAdditionalEdgeCasesE2ETests"
;;
2b-rpc-agent)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcAgentE2ETests"
;;
2b-rpc-event-log)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcEventLogE2ETests"
;;
2b-rpc-event-effects)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcEventSideEffectsE2ETests"
;;
2b-rpc-mcp-skills)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcMcpAndSkillsE2ETests"
;;
2b-rpc-mcp-config)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcMcpConfigE2ETests"
;;
2b-rpc-mcp-lifecycle)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcMcpLifecycleE2ETests"
;;
2b-rpc-q-z)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcQueueE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcRemoteE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcScheduleE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcServerE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcServerMiscE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcServerPluginsE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcServerRemoteControlE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcSessionStateE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcSessionStateExtrasE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcShellAndFleetE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcShellEdgeCaseE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcShellUserRequestedE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcTasksAndHandlersE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcUiEphemeralQueryE2ETests|FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcWorkspaceCheckpointsE2ETests"
;;
extensions)
initials=""
shard_filter="FullyQualifiedName~GitHub.Copilot.Test.E2E.RpcExtensionsLoadedE2ETests"
;;
2c)
initials="T V X Z"
shard_filter=""
;;
*)
echo "Unknown .NET test shard: $shard" >&2
exit 2
;;
esac
for namespace in E2E Unit; do
for initial in $initials; do
clause="FullyQualifiedName~GitHub.Copilot.Test.${namespace}.${initial}"
shard_filter="${shard_filter:+${shard_filter}|}${clause}"
done
done
filter="${filter:+(${filter})&}(${shard_filter})"
fi
if [[ -n "$filter" ]]; then
args+=(--filter "$filter")
fi
if [[ -n "$runtime" ]]; then
args+=(--runtime "$runtime")
fi
dotnet test "${args[@]}"