Skip to content

Commit

Permalink
Add self-contained and framework-dependent publish tests. (#1628)
Browse files Browse the repository at this point in the history
* Add self-contained and framework-dependent publish tests.
  • Loading branch information
crummel committed Jun 19, 2020
1 parent e89f045 commit 4d8b02d
Showing 1 changed file with 33 additions and 15 deletions.
48 changes: 33 additions & 15 deletions smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ VERSION_PREFIX=3.1
# needs to be compatible with the runtime produced from source-build
DEV_CERTS_VERSION_DEFAULT=3.0.0-preview8-28405-07
__ROOT_REPO=$(cat "$SCRIPT_ROOT/artifacts/obj/rootrepo.txt" | sed 's/\r$//') # remove CR if mounted repo on Windows drive
targetRid=$(cat "$SCRIPT_ROOT/artifacts/obj/x64/Release/TargetInfo.props" | grep -i targetrid | sed -E 's|\s*</?TargetRid>\s*||g')

export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
Expand Down Expand Up @@ -38,6 +39,7 @@ function usage() {
echo "usage:"
echo " --dotnetDir the directory from which to run dotnet"
echo " --configuration the configuration being tested (default=Release)"
echo " --targetRid override the target rid to use when needed (e.g. for self-contained publish tests)"
echo " --projectOutput echo dotnet's output to console"
echo " --keepProjects keep projects after tests are complete"
echo " --minimal run minimal set of tests - local sources only, no web"
Expand Down Expand Up @@ -74,6 +76,10 @@ while :; do
shift
configuration="$1"
;;
--targetrid)
shift
targetRid="$1"
;;
--projectoutput)
projectOutput=true
;;
Expand Down Expand Up @@ -167,7 +173,8 @@ function doCommand() {
binlogHttpsPart="https"
fi

binlog="$testingDir/${lang}_${proj}_${binlogOnlinePart}_${binlogHttpsPart}_$1.binlog"
binlogPrefix="$testingDir/${lang}_${proj}_${binlogOnlinePart}_${binlogHttpsPart}_"
binlog="${binlogPrefix}$1.binlog"
echo " running $1" | tee -a "$logFile"

if [ "$1" == "new" ]; then
Expand Down Expand Up @@ -197,6 +204,17 @@ function doCommand() {
$killCommand
wait $!
echo " terminated with exit code $?" | tee -a "$logFile"
elif [ "$1" == "publish" ]; then
runPublishScenarios() {
"${dotnetCmd}" publish --self-contained false /bl:"${binlogPrefix}publish-fx-dep.binlog"
"${dotnetCmd}" publish --self-contained true -r $targetRid /bl:"${binlogPrefix}publish-self-contained-${targetRid}.binlog"
"${dotnetCmd}" publish --self-contained true -r linux-x64 /bl:"${binlogPrefix}publish-self-contained-portable.binlog"
}
if [ "$projectOutput" == "true" ]; then
runPublishScenarios | tee -a "$logFile"
else
runPublishScenarios >> "$logFile" 2>&1
fi
else
if [ "$projectOutput" == "true" ]; then
"${dotnetCmd}" $1 /bl:"$binlog" | tee -a "$logFile"
Expand Down Expand Up @@ -235,18 +253,18 @@ function setupDevCerts() {
function runAllTests() {
# Run tests for each language and template
if [ "$excludeNonWebTests" == "false" ]; then
doCommand C# console new restore build run
doCommand C# classlib new restore build
doCommand C# console new restore build run publish
doCommand C# classlib new restore build publish
doCommand C# xunit new restore test
doCommand C# mstest new restore test

doCommand VB console new restore build run
doCommand VB classlib new restore build
doCommand VB console new restore build run publish
doCommand VB classlib new restore build publish
doCommand VB xunit new restore test
doCommand VB mstest new restore test

doCommand F# console new restore build run
doCommand F# classlib new restore build
doCommand F# console new restore build run publish
doCommand F# classlib new restore build publish
doCommand F# xunit new restore test
doCommand F# mstest new restore test
fi
Expand Down Expand Up @@ -276,14 +294,14 @@ function resetCaches() {
}

function runWebTests() {
doCommand C# web "$@" new restore build run
doCommand C# mvc "$@" new restore build run
doCommand C# webapi "$@" new restore build run
doCommand C# razor "$@" new restore build run

doCommand F# web "$@" new restore build run
doCommand F# mvc "$@" new restore build run
doCommand F# webapi "$@" new restore build run
doCommand C# web "$@" new restore build run publish
doCommand C# mvc "$@" new restore build run publish
doCommand C# webapi "$@" new restore build run publish
doCommand C# razor "$@" new restore build run publish

doCommand F# web "$@" new restore build run publish
doCommand F# mvc "$@" new restore build run publish
doCommand F# webapi "$@" new restore build run publish
}

function resetCaches() {
Expand Down

0 comments on commit 4d8b02d

Please sign in to comment.