@@ -5,24 +5,31 @@ SCRIPT_ROOT="$(cd -P "$( dirname "$0" )" && pwd)"
5
5
TARBALL_PREFIX=dotnet-sdk-
6
6
VERSION_PREFIX=2.1
7
7
OUTPUT_DIR=" $SCRIPT_ROOT /bin/x64/Release/"
8
+ SOURCE_BUILT_PKGS_PATH=" $SCRIPT_ROOT /bin/obj/x64/Release/blob-feed/packages/"
8
9
DOTNET_TARBALL_REL=$( ls ${OUTPUT_DIR} dotnet-sdk-${VERSION_PREFIX} * )
9
10
DOTNET_TARBALL=$( readlink -e ${DOTNET_TARBALL_REL} )
10
11
11
12
projectOutput=false
12
13
keepProjects=false
13
14
dotnetDir=" "
14
- includeWeb=false
15
+ excludeWebTests=false
16
+ excludeLocalTests=false
17
+ excludeOnlineTests=false
15
18
testingDir=" $SCRIPT_ROOT /testing-smoke"
16
19
cliDir=" $testingDir /builtCli"
17
20
logFile=" $testingDir /smoke-test.log"
21
+ restoredPackagesDir=" $testingDir /packages"
18
22
19
23
function usage() {
20
24
echo " "
21
25
echo " usage:"
22
- echo " --dotnetDir the directory from which to run dotnet"
23
- echo " --projectOutput echo dotnet's output to console"
24
- echo " --keepProjects keep projects after tests are complete"
25
- echo " --includeWeb run tests for web projects"
26
+ echo " --dotnetDir the directory from which to run dotnet"
27
+ echo " --projectOutput echo dotnet's output to console"
28
+ echo " --keepProjects keep projects after tests are complete"
29
+ echo " --minimal run minimal set of tests - local sources only, no web"
30
+ echo " --excludeWebTests don't run tests for web projects"
31
+ echo " --excludeLocalTests exclude tests that use local sources for nuget packages"
32
+ echo " --excludeOnlineTests exclude test that use online sources for nuget packages"
26
33
echo " "
27
34
}
28
35
@@ -47,8 +54,18 @@ while :; do
47
54
--keepprojects)
48
55
keepProjects=true
49
56
;;
50
- --includeweb)
51
- includeWeb=true
57
+ --minimal)
58
+ excludeWebTests=true
59
+ excludeOnlineTests=true
60
+ ;;
61
+ --excludewebtests)
62
+ excludeWebTests=true
63
+ ;;
64
+ --excludelocaltests)
65
+ excludeLocalTests=true
66
+ ;;
67
+ --excludeonlinetests)
68
+ excludeOnlineTests=true
52
69
;;
53
70
* )
54
71
usage
@@ -122,6 +139,35 @@ function doCommand() {
122
139
echo " finished language $lang , type $proj " | tee -a smoke-test.log
123
140
}
124
141
142
+ function runAllTests() {
143
+ # Run tests for each language and template
144
+ doCommand C# console new restore run
145
+ doCommand C# classlib new restore build
146
+ doCommand C# xunit new restore test
147
+ doCommand C# mstest new restore test
148
+
149
+ doCommand VB console new restore run
150
+ doCommand VB classlib new restore build
151
+ doCommand VB xunit new restore test
152
+ doCommand VB mstest new restore test
153
+
154
+ doCommand F# console new restore run
155
+ doCommand F# classlib new restore build
156
+ doCommand F# xunit new restore test
157
+ doCommand F# mstest new restore test
158
+
159
+ if [ " $excludeWebTests " == " false" ]; then
160
+ doCommand C# web new restore run
161
+ doCommand C# mvc new restore run
162
+ doCommand C# webapi new restore run
163
+ doCommand C# razor new restore run
164
+
165
+ doCommand F# web new restore run
166
+ doCommand F# mvc new restore run
167
+ doCommand F# webapi new restore run
168
+ fi
169
+ }
170
+
125
171
# Clean up and create directory
126
172
if [ -e " $testingDir " ]; then
127
173
read -p " testing-smoke directory exists, remove it? [Y]es / [n]o" -n 1 -r
@@ -145,31 +191,33 @@ else
145
191
fi
146
192
fi
147
193
148
- # Run tests for each language and template
149
- doCommand C# console new restore run
150
- doCommand C# classlib new restore build
151
- doCommand C# xunit new restore test
152
- doCommand C# mstest new restore test
153
-
154
- doCommand VB console new restore run
155
- doCommand VB classlib new restore build
156
- doCommand VB xunit new restore test
157
- doCommand VB mstest new restore test
158
-
159
- doCommand F# console new restore run
160
- doCommand F# classlib new restore build
161
- doCommand F# xunit new restore test
162
- doCommand F# mstest new restore test
163
-
164
- if [ " $includeWeb " == " true" ]; then
165
- doCommand C# web new restore run
166
- doCommand C# mvc new restore run
167
- doCommand C# webapi new restore run
168
- doCommand C# razor new restore run
169
-
170
- doCommand F# web new restore run
171
- doCommand F# mvc new restore run
172
- doCommand F# webapi new restore run
194
+ # setup restore path
195
+ export NUGET_PACKAGES=" $restoredPackagesDir "
196
+
197
+ # Run all tests, local restore sources first, online restore sources second
198
+ if [ " $excludeLocalTests " == " false" ]; then
199
+ # Setup NuGet.Config with local restore source
200
+ if [ -e " $SCRIPT_ROOT /smoke-testNuGet.Config" ]; then
201
+ cp " $SCRIPT_ROOT /smoke-testNuGet.Config" " $testingDir /NuGet.Config"
202
+ sed -i " s|SOURCE_BUILT_PACKAGES|$SOURCE_BUILT_PKGS_PATH |g" " $testingDir /NuGet.Config"
203
+ fi
204
+ echo " RUN ALL TESTS - LOCAL RESTORE SOURCE"
205
+ runAllTests
206
+ echo " LOCAL RESTORE SOURCE - ALL TESTS PASSED!"
207
+ fi
208
+
209
+ # clean restore path
210
+ rm -rf " $restoredPackagesDir "
211
+
212
+ if [ " $excludeOnlineTests " == " false" ]; then
213
+ # Setup NuGet.Config to use online restore sources
214
+ if [ -e " $SCRIPT_ROOT /smoke-testNuGet.Config" ]; then
215
+ cp " $SCRIPT_ROOT /smoke-testNuGet.Config" " $testingDir /NuGet.Config"
216
+ sed -i " /SOURCE_BUILT_PACKAGES/d" " $testingDir /NuGet.Config"
217
+ fi
218
+ echo " RUN ALL TESTS - ONLINE RESTORE SOURCE"
219
+ runAllTests
220
+ echo " ONLINE RESTORE SOURCE - ALL TESTS PASSED!"
173
221
fi
174
222
175
223
rm -rf " $cliDir "
0 commit comments