Skip to content

Commit 8c742fa

Browse files
crummeldagood
authored andcommitted
Add self-contained and framework-dependent publish tests. (#1628)
* Add self-contained and framework-dependent publish tests.
1 parent 5399878 commit 8c742fa

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

smoke-test.sh

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ VERSION_PREFIX=5.0
99
DEV_CERTS_VERSION_DEFAULT=5.0.0-preview.3
1010
__ROOT_REPO=$(cat "$SCRIPT_ROOT/artifacts/obj/rootrepo.txt" | sed 's/\r$//') # remove CR if mounted repo on Windows drive
1111
executingUserHome=${HOME:-}
12+
targetRid=$(cat "$SCRIPT_ROOT/artifacts/obj/x64/Release/TargetInfo.props" | grep -i targetrid | sed -E 's|\s*</?TargetRid>\s*||g')
1213

1314
export DOTNET_CLI_TELEMETRY_OPTOUT=1
1415
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
@@ -66,6 +67,7 @@ function usage() {
6667
echo "usage:"
6768
echo " --dotnetDir the directory from which to run dotnet"
6869
echo " --configuration the configuration being tested (default=Release)"
70+
echo " --targetRid override the target rid to use when needed (e.g. for self-contained publish tests)"
6971
echo " --projectOutput echo dotnet's output to console"
7072
echo " --keepProjects keep projects after tests are complete"
7173
echo " --minimal run minimal set of tests - local sources only, no web"
@@ -102,6 +104,10 @@ while :; do
102104
shift
103105
configuration="$1"
104106
;;
107+
--targetrid)
108+
shift
109+
targetRid="$1"
110+
;;
105111
--projectoutput)
106112
projectOutput=true
107113
;;
@@ -195,7 +201,8 @@ function doCommand() {
195201
binlogHttpsPart="https"
196202
fi
197203

198-
binlog="$testingDir/${lang}_${proj}_${binlogOnlinePart}_${binlogHttpsPart}_$1.binlog"
204+
binlogPrefix="$testingDir/${lang}_${proj}_${binlogOnlinePart}_${binlogHttpsPart}_"
205+
binlog="${binlogPrefix}$1.binlog"
199206
echo " running $1" | tee -a "$logFile"
200207

201208
if [ "$1" == "new" ]; then
@@ -225,6 +232,17 @@ function doCommand() {
225232
$killCommand
226233
wait $!
227234
echo " terminated with exit code $?" | tee -a "$logFile"
235+
elif [ "$1" == "publish" ]; then
236+
runPublishScenarios() {
237+
"${dotnetCmd}" publish --self-contained false /bl:"${binlogPrefix}publish-fx-dep.binlog"
238+
"${dotnetCmd}" publish --self-contained true -r $targetRid /bl:"${binlogPrefix}publish-self-contained-${targetRid}.binlog"
239+
"${dotnetCmd}" publish --self-contained true -r linux-x64 /bl:"${binlogPrefix}publish-self-contained-portable.binlog"
240+
}
241+
if [ "$projectOutput" == "true" ]; then
242+
runPublishScenarios | tee -a "$logFile"
243+
else
244+
runPublishScenarios >> "$logFile" 2>&1
245+
fi
228246
else
229247
if [ "$projectOutput" == "true" ]; then
230248
"${dotnetCmd}" $1 /bl:"$binlog" | tee -a "$logFile"
@@ -263,18 +281,18 @@ function setupDevCerts() {
263281
function runAllTests() {
264282
# Run tests for each language and template
265283
if [ "$excludeNonWebTests" == "false" ]; then
266-
doCommand C# console new restore build run
267-
doCommand C# classlib new restore build
284+
doCommand C# console new restore build run publish
285+
doCommand C# classlib new restore build publish
268286
doCommand C# xunit new restore test
269287
doCommand C# mstest new restore test
270288

271-
doCommand VB console new restore build run
272-
doCommand VB classlib new restore build
289+
doCommand VB console new restore build run publish
290+
doCommand VB classlib new restore build publish
273291
doCommand VB xunit new restore test
274292
doCommand VB mstest new restore test
275293

276-
doCommand F# console new restore build run
277-
doCommand F# classlib new restore build
294+
doCommand F# console new restore build run publish
295+
doCommand F# classlib new restore build publish
278296
doCommand F# xunit new restore test
279297
doCommand F# mstest new restore test
280298
fi

0 commit comments

Comments
 (0)