From 51eca0bcba4b86d36f63e8508ba63fda33efa78b Mon Sep 17 00:00:00 2001 From: piotrp Date: Sat, 23 Jan 2016 12:55:03 -0800 Subject: [PATCH 1/6] Refactoring test scripts _nuget needs some RepoRoots get the cats in line (d) spaces Fix Linux build breaks add execution permissions Pick up #999 Finish refactoring test scripts remove auth Reorder publishing to work! fix rebase errors fix more rebase errors small fixes --- NuGet.Config | 2 +- scripts/build/build.ps1 | 16 +----- scripts/build/build.sh | 9 +--- scripts/build/restore-packages.ps1 | 10 +--- scripts/build/restore-packages.sh | 8 +-- scripts/common/_common.ps1 | 11 ++-- scripts/common/_common.sh | 11 ++-- scripts/common/_configuration.ps1 | 24 +++++++++ scripts/common/_configuration.sh | 25 +++++++++ scripts/common/_nuget.ps1 | 16 ++++++ scripts/common/_nuget.sh | 10 ++++ scripts/compile/compile-stage.ps1 | 28 ++-------- scripts/compile/compile-stage.sh | 21 +------- scripts/configuration/buildProjects.csv | 20 +++++++ scripts/configuration/testPackageProjects.csv | 2 + scripts/configuration/testProjects.csv | 5 ++ scripts/configuration/testScripts.csv | 2 + scripts/test/build-tests.ps1 | 18 +++++++ scripts/test/build-tests.sh | 26 ++++++++++ scripts/test/package-command-test.ps1 | 34 ------------ scripts/test/package-command-test.sh | 22 -------- scripts/test/restore-tests.ps1 | 12 +++++ scripts/test/restore-tests.sh | 25 +++++++++ scripts/test/{runtests.ps1 => run-tests.ps1} | 52 +++++-------------- scripts/test/{runtests.sh => run-tests.sh} | 48 +++++------------ .../test/setup/build-test-prerequisites.ps1 | 17 ++++++ .../test/setup/build-test-prerequisites.sh | 25 +++++++++ .../test/setup/restore-test-prerequisites.ps1 | 14 +++++ .../test/setup/restore-test-prerequisites.sh | 24 +++++++++ scripts/test/setup/setup-tests.ps1 | 12 +++++ scripts/test/setup/setup-tests.sh | 22 ++++++++ scripts/test/test.ps1 | 18 +++++++ scripts/test/test.sh | 30 +++++++++++ scripts/test/validate-dependencies.sh | 2 +- .../dotnet-hello/v1/dotnet-hello/Program.cs | 0 .../v1/dotnet-hello/dotnet-hello.xproj | 19 +++++++ .../dotnet-hello/v1/dotnet-hello/project.json | 0 .../dotnet-hello/v2/dotnet-hello/Program.cs | 0 .../v2/dotnet-hello/dotnet-hello.xproj | 19 +++++++ .../dotnet-hello/v2/dotnet-hello/project.json | 0 40 files changed, 443 insertions(+), 216 deletions(-) create mode 100644 scripts/common/_configuration.ps1 create mode 100644 scripts/common/_configuration.sh create mode 100644 scripts/common/_nuget.ps1 create mode 100644 scripts/common/_nuget.sh create mode 100644 scripts/configuration/buildProjects.csv create mode 100644 scripts/configuration/testPackageProjects.csv create mode 100644 scripts/configuration/testProjects.csv create mode 100644 scripts/configuration/testScripts.csv create mode 100644 scripts/test/build-tests.ps1 create mode 100755 scripts/test/build-tests.sh create mode 100644 scripts/test/restore-tests.ps1 create mode 100755 scripts/test/restore-tests.sh rename scripts/test/{runtests.ps1 => run-tests.ps1} (52%) rename scripts/test/{runtests.sh => run-tests.sh} (61%) create mode 100644 scripts/test/setup/build-test-prerequisites.ps1 create mode 100644 scripts/test/setup/build-test-prerequisites.sh create mode 100644 scripts/test/setup/restore-test-prerequisites.ps1 create mode 100644 scripts/test/setup/restore-test-prerequisites.sh create mode 100644 scripts/test/setup/setup-tests.ps1 create mode 100644 scripts/test/setup/setup-tests.sh create mode 100644 scripts/test/test.ps1 create mode 100755 scripts/test/test.sh rename test/{PackagedCommands/Commands => TestPackages}/dotnet-hello/v1/dotnet-hello/Program.cs (100%) create mode 100644 test/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.xproj rename test/{PackagedCommands/Commands => TestPackages}/dotnet-hello/v1/dotnet-hello/project.json (100%) rename test/{PackagedCommands/Commands => TestPackages}/dotnet-hello/v2/dotnet-hello/Program.cs (100%) create mode 100644 test/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.xproj rename test/{PackagedCommands/Commands => TestPackages}/dotnet-hello/v2/dotnet-hello/project.json (100%) diff --git a/NuGet.Config b/NuGet.Config index df6374b89..ac98ff716 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -10,7 +10,7 @@ - + diff --git a/scripts/build/build.ps1 b/scripts/build/build.ps1 index cbe1b690f..f2b7e633a 100644 --- a/scripts/build/build.ps1 +++ b/scripts/build/build.ps1 @@ -14,18 +14,6 @@ $ErrorActionPreference="Stop" . "$RepoRoot\scripts\build\generate-version.ps1" -if ($env:CI_BUILD -eq "1") { - $env:NUGET_PACKAGES = (Join-Path $RepoRoot "artifacts\home\.nuget\packages") -} else { - $env:NUGET_PACKAGES = (Join-Path $env:USERPROFILE ".nuget\packages") -} - -$env:DOTNET_PACKAGES = $env:NUGET_PACKAGES -$env:DNX_PACKAGES = $env:NUGET_PACKAGES -if(!(Test-Path $env:NUGET_PACKAGES)) { - mkdir $env:NUGET_PACKAGES | Out-Null -} - header "Building dotnet tools version $($env:DOTNET_CLI_VERSION) - $Configuration" header "Checking Pre-Reqs" @@ -51,8 +39,8 @@ _ "$RepoRoot\scripts\compile\compile.ps1" @("$Configuration") header "Setting Stage2 as PATH and DOTNET_TOOLS" setPathAndHome "$Stage2Dir" -header "Running Tests" -_ "$RepoRoot\scripts\test\runtests.ps1" +header "Testing" +_ "$RepoRoot\scripts\test\test.ps1" header "Validating Dependencies" _ "$RepoRoot\scripts\test\validate-dependencies.ps1" diff --git a/scripts/build/build.sh b/scripts/build/build.sh index 0458cb1f9..834111bca 100755 --- a/scripts/build/build.sh +++ b/scripts/build/build.sh @@ -19,11 +19,6 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" source "$REPOROOT/scripts/build/generate-version.sh" -## Temporarily redirect to the NuGet package installation location -export NUGET_PACKAGES=~/.nuget/packages -export DOTNET_PACKAGES=$NUGET_PACKAGES -export DNX_PACKAGES=$NUGET_PACKAGES - header "Building dotnet tools version $DOTNET_CLI_VERSION - $CONFIGURATION" header "Checking Pre-Reqs" @@ -55,8 +50,8 @@ $REPOROOT/scripts/compile/compile.sh header "Setting Stage2 as PATH, DOTNET_HOME, and DOTNET_TOOLS" export DOTNET_HOME=$STAGE2_DIR && export DOTNET_TOOLS=$STAGE2DIR && export PATH=$STAGE2_DIR/bin:$PATH -header "Running Tests" -$REPOROOT/scripts/test/runtests.sh +header "Testing" +$REPOROOT/scripts/test/test.sh header "Validating Dependencies" $REPOROOT/scripts/test/validate-dependencies.sh diff --git a/scripts/build/restore-packages.ps1 b/scripts/build/restore-packages.ps1 index 2d9613291..7ec12dced 100644 --- a/scripts/build/restore-packages.ps1 +++ b/scripts/build/restore-packages.ps1 @@ -8,12 +8,6 @@ # Restore packages # NOTE(anurse): I had to remove --quiet, because NuGet3 is too quiet when that's provided :( header "Restoring packages" -dotnet restore "$RepoRoot\src" --runtime "$Rid" -dotnet restore "$RepoRoot\test" --runtime "$Rid" -dotnet restore "$RepoRoot\tools" --runtime "$Rid" - -$oldErrorAction=$ErrorActionPreference -$ErrorActionPreference="SilentlyContinue" -dotnet restore "$RepoRoot\testapp" --runtime "$Rid" 2>&1 | Out-Null -$ErrorActionPreference=$oldErrorAction +& dotnet restore "$RepoRoot\src" --runtime "$Rid" +& dotnet restore "$RepoRoot\tools" --runtime "$Rid" diff --git a/scripts/build/restore-packages.sh b/scripts/build/restore-packages.sh index bc3aba062..3c0b45945 100755 --- a/scripts/build/restore-packages.sh +++ b/scripts/build/restore-packages.sh @@ -18,9 +18,5 @@ source "$DIR/../common/_common.sh" header "Restoring packages" -dotnet restore "$REPOROOT/src" --runtime $RID -dotnet restore "$REPOROOT/test" --runtime $RID -dotnet restore "$REPOROOT/tools" --runtime $RID -set +e -dotnet restore "$REPOROOT/testapp" --runtime $RID >/dev/null 2>&1 -set -e +dotnet restore "$REPOROOT/src" --runtime "$RID" +dotnet restore "$REPOROOT/tools" --runtime "$RID" diff --git a/scripts/common/_common.ps1 b/scripts/common/_common.ps1 index 7176ae246..7bf2ed56a 100644 --- a/scripts/common/_common.ps1 +++ b/scripts/common/_common.ps1 @@ -9,21 +9,24 @@ $Rid = "win7-x64" $Tfm = "dnxcore50" $RepoRoot = Resolve-Path "$PSScriptRoot\..\.." $OutputDir = "$RepoRoot\artifacts\$Rid" -$DnxDir = "$OutputDir\dnx" -$DnxRoot = "$DnxDir\bin" $Stage1Dir = "$OutputDir\stage1" $Stage1CompilationDir = "$OutputDir\stage1compilation" $Stage2Dir = "$OutputDir\stage2" $Stage2CompilationDir = "$OutputDir\stage2compilation" $HostDir = "$OutputDir\corehost" $PackageDir = "$RepoRoot\artifacts\packages\dnvm" +$TestBinRoot = "$RepoRoot\artifacts\tests" +$TestPackageDir = "$TestBinRoot\packages" + $env:ReleaseSuffix = "beta" $env:Channel = "$env:ReleaseSuffix" -$env:TEST_ROOT = "$OutputDir\tests" -$env:TEST_ARTIFACTS = "$env:TEST_ROOT\artifacts" # Set reasonable defaults for unset variables setEnvIfDefault "DOTNET_INSTALL_DIR" "$(Convert-Path "$PSScriptRoot\..")\.dotnet_stage0\win7-x64" setEnvIfDefault "DOTNET_CLI_VERSION" "0.1.0.0" setPathAndHomeIfDefault "$Stage2Dir" setVarIfDefault "Configuration" "Debug" + +# Common Files which depend on above properties +. $PSScriptRoot\_nuget.ps1 +. $PSScriptRoot\_configuration.ps1 \ No newline at end of file diff --git a/scripts/common/_common.sh b/scripts/common/_common.sh index e6e3f016f..4bcc5a1f6 100644 --- a/scripts/common/_common.sh +++ b/scripts/common/_common.sh @@ -18,13 +18,14 @@ source "$COMMONDIR/_rid.sh" export TFM=dnxcore50 export REPOROOT=$(cd $COMMONDIR/../.. && pwd) export OUTPUT_ROOT=$REPOROOT/artifacts/$RID -export DNX_DIR=$OUTPUT_ROOT/dnx -export DNX_ROOT=$DNX_DIR/bin export STAGE1_DIR=$OUTPUT_ROOT/stage1 export STAGE1_COMPILATION_DIR=$OUTPUT_ROOT/stage1compilation export STAGE2_DIR=$OUTPUT_ROOT/stage2 export STAGE2_COMPILATION_DIR=$OUTPUT_ROOT/stage2compilation export HOST_DIR=$OUTPUT_ROOT/corehost +export TEST_BIN_ROOT="$REPOROOT/artifacts/tests" +export TEST_PACKAGE_DIR="$TEST_BIN_ROOT/packages" + export RELEASE_SUFFIX=beta export CHANNEL=$RELEASE_SUFFIX @@ -33,5 +34,9 @@ export CHANNEL=$RELEASE_SUFFIX [ -z "$DOTNET_HOME" ] && export DOTNET_HOME=$STAGE2_DIR && export PATH=$STAGE2_DIR/bin:$PATH [ -z "$CONFIGURATION" ] && export CONFIGURATION=Debug +# Common Files which depend on above properties +source "$COMMONDIR/_nuget.sh" +source "$COMMONDIR/_configuration.sh" + unset COMMONSOURCE -unset COMMONDIR +unset COMMONDIR \ No newline at end of file diff --git a/scripts/common/_configuration.ps1 b/scripts/common/_configuration.ps1 new file mode 100644 index 000000000..e019a55c8 --- /dev/null +++ b/scripts/common/_configuration.ps1 @@ -0,0 +1,24 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +function loadTestProjectList() +{ + return Import-CSV "$RepoRoot\scripts\configuration\testProjects.csv" -Header "ProjectName" +} + +function loadTestScriptList() +{ + return Import-CSV "$RepoRoot\scripts\configuration\testScripts.csv" -Header "ProjectName" +} + +function loadTestPackageList() +{ + return Import-CSV "$RepoRoot\scripts\configuration\testPackageProjects.csv" -Header "ProjectName" +} + +function loadBuildProjectList() +{ + return Import-CSV "$RepoRoot\scripts\configuration\buildProjects.csv" -Header "ProjectName" +} \ No newline at end of file diff --git a/scripts/common/_configuration.sh b/scripts/common/_configuration.sh new file mode 100644 index 000000000..45d2502a7 --- /dev/null +++ b/scripts/common/_configuration.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +loadTestProjectList() +{ + echo $(cat "$REPOROOT/scripts/configuration/testProjects.csv") +} + +loadTestScriptList() +{ + echo $(cat "$REPOROOT/scripts/configuration/testScripts.csv") +} + +loadTestPackageList() +{ + echo $(cat "$REPOROOT/scripts/configuration/testPackageProjects.csv") +} + +loadBuildProjectList() +{ + echo $(cat "$REPOROOT/scripts/configuration/buildProjects.csv") +} \ No newline at end of file diff --git a/scripts/common/_nuget.ps1 b/scripts/common/_nuget.ps1 new file mode 100644 index 000000000..8fe724905 --- /dev/null +++ b/scripts/common/_nuget.ps1 @@ -0,0 +1,16 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +if ($env:CI_BUILD -eq "1") { + $env:NUGET_PACKAGES = (Join-Path $RepoRoot "artifacts\home\.nuget\packages") +} else { + $env:NUGET_PACKAGES = (Join-Path $env:USERPROFILE ".nuget\packages") +} + +$env:DOTNET_PACKAGES = $env:NUGET_PACKAGES +$env:DNX_PACKAGES = $env:NUGET_PACKAGES +if(!(Test-Path $env:NUGET_PACKAGES)) { + mkdir $env:NUGET_PACKAGES | Out-Null +} \ No newline at end of file diff --git a/scripts/common/_nuget.sh b/scripts/common/_nuget.sh new file mode 100644 index 000000000..8261dd446 --- /dev/null +++ b/scripts/common/_nuget.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +## Temporarily redirect to the NuGet package installation location +export NUGET_PACKAGES=~/.nuget/packages +export DOTNET_PACKAGES=$NUGET_PACKAGES +export DNX_PACKAGES=$NUGET_PACKAGES \ No newline at end of file diff --git a/scripts/compile/compile-stage.ps1 b/scripts/compile/compile-stage.ps1 index 15c269d93..72c465311 100644 --- a/scripts/compile/compile-stage.ps1 +++ b/scripts/compile/compile-stage.ps1 @@ -12,30 +12,10 @@ param( [Parameter(Mandatory=$true)][string]$HostDir, [Parameter(Mandatory=$true)][string]$CompilationOutputDir) +. $PSScriptRoot\..\common\_common.ps1 . $REPOROOT\scripts\package\projectsToPack.ps1 -$Projects = @( - "dotnet", - "dotnet-build", - "dotnet-compile", - "dotnet-compile-csc", - "dotnet-compile-fsc", - "dotnet-compile-native", - "dotnet-new", - "dotnet-pack", - "dotnet-projectmodel-server", - "dotnet-publish", - "dotnet-restore", - "dotnet-repl", - "dotnet-repl-csi", - "dotnet-resgen", - "dotnet-run", - "dotnet-test", - "Microsoft.DotNet.Cli.Utils", - "Microsoft.DotNet.ProjectModel.Loader", - "Microsoft.DotNet.ProjectModel.Workspaces", - "Microsoft.Extensions.Testing.Abstractions" -) +$Projects = loadBuildProjectList $BinariesForCoreHost = @( "csi" @@ -55,9 +35,9 @@ $RuntimeOutputDir = "$OutputDir\runtime\coreclr" # Publish each project $Projects | ForEach-Object { - dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$OutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$_" + dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$CompilationOutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$($_.ProjectName)" if (!$?) { - Write-Host Command failed: dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$OutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$_" + Write-Host Command failed: dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$CompilationOutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$($_.ProjectName)" exit 1 } } diff --git a/scripts/compile/compile-stage.sh b/scripts/compile/compile-stage.sh index 6ea70b89a..6e4a679c2 100755 --- a/scripts/compile/compile-stage.sh +++ b/scripts/compile/compile-stage.sh @@ -22,24 +22,7 @@ source "$DIR/../common/_common.sh" [ ! -z "$OUTPUT_DIR" ] || die "Missing required environment variable OUTPUT_DIR" [ ! -z "$HOST_DIR" ] || die "Missing required environment variable HOST_DIR" -PROJECTS=( \ - dotnet \ - dotnet-build \ - dotnet-compile \ - dotnet-compile-csc \ - dotnet-compile-fsc \ - dotnet-compile-native \ - dotnet-new \ - dotnet-pack \ - dotnet-projectmodel-server \ - dotnet-publish \ - dotnet-repl \ - dotnet-repl-csi \ - dotnet-restore \ - dotnet-resgen \ - dotnet-run \ - dotnet-test \ -) +PROJECTS=$(loadBuildProjectList) BINARIES_FOR_COREHOST=( \ csi \ @@ -57,7 +40,7 @@ FILES_TO_CLEAN=( \ RUNTIME_OUTPUT_DIR="$OUTPUT_DIR/runtime/coreclr" -for project in ${PROJECTS[@]} +for project in $PROJECTS do echo dotnet publish --native-subdirectory --framework "$TFM" --output "$OUTPUT_DIR/bin" --configuration "$CONFIGURATION" "$REPOROOT/src/$project" dotnet publish --native-subdirectory --framework "$TFM" --output "$OUTPUT_DIR/bin" --configuration "$CONFIGURATION" "$REPOROOT/src/$project" diff --git a/scripts/configuration/buildProjects.csv b/scripts/configuration/buildProjects.csv new file mode 100644 index 000000000..35248851d --- /dev/null +++ b/scripts/configuration/buildProjects.csv @@ -0,0 +1,20 @@ +dotnet +dotnet-build +dotnet-compile +dotnet-compile-csc +dotnet-compile-fsc +dotnet-compile-native +dotnet-new +dotnet-pack +dotnet-projectmodel-server +dotnet-publish +dotnet-restore +dotnet-repl +dotnet-repl-csi +dotnet-resgen +dotnet-run +dotnet-test +Microsoft.DotNet.Cli.Utils +Microsoft.DotNet.ProjectModel.Loader +Microsoft.DotNet.ProjectModel.Workspaces +Microsoft.Extensions.Testing.Abstractions diff --git a/scripts/configuration/testPackageProjects.csv b/scripts/configuration/testPackageProjects.csv new file mode 100644 index 000000000..90069c976 --- /dev/null +++ b/scripts/configuration/testPackageProjects.csv @@ -0,0 +1,2 @@ +dotnet-hello/v1/dotnet-hello +dotnet-hello/v2/dotnet-hello \ No newline at end of file diff --git a/scripts/configuration/testProjects.csv b/scripts/configuration/testProjects.csv new file mode 100644 index 000000000..79ec1225a --- /dev/null +++ b/scripts/configuration/testProjects.csv @@ -0,0 +1,5 @@ +E2E +StreamForwarderTests +dotnet-publish.Tests +dotnet-compile.Tests +dotnet-build.Tests \ No newline at end of file diff --git a/scripts/configuration/testScripts.csv b/scripts/configuration/testScripts.csv new file mode 100644 index 000000000..6ce784583 --- /dev/null +++ b/scripts/configuration/testScripts.csv @@ -0,0 +1,2 @@ +argument-forwarding-tests +package-command-test \ No newline at end of file diff --git a/scripts/test/build-tests.ps1 b/scripts/test/build-tests.ps1 new file mode 100644 index 000000000..e70d2d44d --- /dev/null +++ b/scripts/test/build-tests.ps1 @@ -0,0 +1,18 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +. "$PSScriptRoot\..\common\_common.ps1" + +# Publish each test project +loadTestProjectList | foreach { + dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$TestBinRoot" --configuration "$Configuration" "$RepoRoot\test\$($_.ProjectName)" + if (!$?) { + Write-Host Command failed: dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$TestBinRoot" --configuration "$Configuration" "$RepoRoot\test\$($_.ProjectName)" + exit 1 + } +} + +# TODO: Remove this when publish paths change back +cp -rec -Force "$TestBinRoot\Debug\dnxcore50\*" "$TestBinRoot" diff --git a/scripts/test/build-tests.sh b/scripts/test/build-tests.sh new file mode 100755 index 000000000..c16a3beff --- /dev/null +++ b/scripts/test/build-tests.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done + +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +for project in loadTestList() +do + dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$TestBinRoot" --configuration "$CONFIGURATION" "$REPOROOT/test/$project" +done + +# TODO: Remove this when publish paths change back +cp -a "$TestBinRoot/Debug/dnxcore50/." "$TestBinRoot" diff --git a/scripts/test/package-command-test.ps1 b/scripts/test/package-command-test.ps1 index 914c02b0a..bc8431cbb 100644 --- a/scripts/test/package-command-test.ps1 +++ b/scripts/test/package-command-test.ps1 @@ -5,40 +5,6 @@ . "$PSScriptRoot\..\common\_common.ps1" -$TestPackagesPath = "$RepoRoot\artifacts\tests\package-command-test\packages" - -if((Test-Path $TestPackagesPath) -eq 0) -{ - mkdir $TestPackagesPath; -} - -"v1", "v2" | -foreach { - dotnet pack "$RepoRoot\test\PackagedCommands\Commands\dotnet-hello\$_\dotnet-hello" - cp "$RepoRoot\test\PackagedCommands\Commands\dotnet-hello\$_\dotnet-hello\bin\Debug\*.nupkg" -Destination $TestPackagesPath - if (!$?) { - error "Command failed: dotnet pack" - Exit 1 - } -} - -# workaround for dotnet-restore from the root failing for these tests since their dependencies aren't built yet -dir "$RepoRoot\test\PackagedCommands\Consumers" | where {$_.PsIsContainer} | -foreach { - pushd "$RepoRoot\test\PackagedCommands\Consumers\$_" - copy project.json.template project.json - popd -} - -#restore test projects -pushd "$RepoRoot\test\PackagedCommands\Consumers" -dotnet restore -s "$TestPackagesPath" -if (!$?) { - error "Command failed: dotnet restore" - Exit 1 -} -popd - #compile apps dir "$RepoRoot\test\PackagedCommands\Consumers" | where {$_.PsIsContainer} | where {$_.Name.Contains("Direct")} | foreach { diff --git a/scripts/test/package-command-test.sh b/scripts/test/package-command-test.sh index 75fab53ab..8d52e8c33 100755 --- a/scripts/test/package-command-test.sh +++ b/scripts/test/package-command-test.sh @@ -17,28 +17,6 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" -TestPackagesPath="$REPOROOT/artifacts/tests/package-command-test/packages" - -mkdir -p "$TestPackagesPath" - -dotnet pack "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello" -cp "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello/bin/Debug/"*.nupkg "$TestPackagesPath" -dotnet pack "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello" -cp "$REPOROOT/test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello/bin/Debug/"*.nupkg "$TestPackagesPath" - -# enable restore for test projects -for test in $(ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "AppWith") -do - pushd "$REPOROOT/test/PackagedCommands/Consumers/$test" - cp "project.json.template" "project.json" - popd -done - -# restore test projects -pushd "$REPOROOT/test/PackagedCommands/Consumers" -dotnet restore -s "$TestPackagesPath" -popd - #compile tests with direct dependencies for test in $(ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "Direct") do diff --git a/scripts/test/restore-tests.ps1 b/scripts/test/restore-tests.ps1 new file mode 100644 index 000000000..ea9e46f0f --- /dev/null +++ b/scripts/test/restore-tests.ps1 @@ -0,0 +1,12 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +. $PSScriptRoot\..\common\_common.ps1 + +info "Restoring Test Projects" + +# Restore packages +& dotnet restore "$RepoRoot\test" -f "$TestPackageDir" + diff --git a/scripts/test/restore-tests.sh b/scripts/test/restore-tests.sh new file mode 100755 index 000000000..a632b06ff --- /dev/null +++ b/scripts/test/restore-tests.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +header "Restoring Test Packages" + +dotnet restore "$REPOROOT/test" -f "$TEST_PACKAGE_DIR" + +set +e +dotnet restore "$REPOROOT/testapp" >/dev/null 2>&1 +set -e \ No newline at end of file diff --git a/scripts/test/runtests.ps1 b/scripts/test/run-tests.ps1 similarity index 52% rename from scripts/test/runtests.ps1 rename to scripts/test/run-tests.ps1 index 904fea10d..269447c3b 100644 --- a/scripts/test/runtests.ps1 +++ b/scripts/test/run-tests.ps1 @@ -5,35 +5,13 @@ . "$PSScriptRoot\..\common\_common.ps1" -$failCount = 0 - $TestBinRoot = "$RepoRoot\artifacts\tests" -$TestProjects = @( - "E2E", - "StreamForwarderTests", - "dotnet-publish.Tests", - "dotnet-compile.Tests", - "dotnet-build.Tests" -) +$TestProjects = loadTestProjectList +$TestScripts = loadTestScriptList -$TestScripts = @( - "package-command-test.ps1", - "argument-forwarding-tests.ps1" -) - -# Publish each test project -$TestProjects | ForEach-Object { - dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$TestBinRoot" --configuration "$Configuration" "$RepoRoot\test\$_" - if (!$?) { - Write-Host Command failed: dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$TestBinRoot" --configuration "$Configuration" "$RepoRoot\test\$_" - exit 1 - } -} - -if (Test-Path $TestBinRoot\$Configuration\dnxcore50) { - cp $TestBinRoot\$Configuration\dnxcore50\* $TestBinRoot -force -recurse -} +$failCount = 0 +$failingTests = @() ## Temporary Workaround for Native Compilation ## Need x64 Native Tools Dev Prompt Env Vars @@ -47,21 +25,17 @@ foreach { } popd -# copy TestProjects folder which is used by the test cases +# copy TestProjects to $TestBinRoot mkdir -Force "$TestBinRoot\TestProjects" cp -rec -Force "$RepoRoot\test\TestProjects\*" "$TestBinRoot\TestProjects" -$failCount = 0 -$failingTests = @() - pushd "$TestBinRoot" - # Run each test project -$TestProjects | ForEach-Object { - & ".\corerun" "xunit.console.netcore.exe" "$_.dll" -xml "$_-testResults.xml" -notrait category=failing +$TestProjects | foreach { + & ".\corerun" "xunit.console.netcore.exe" "$($_.ProjectName).dll" -xml "$($_.ProjectName)-testResults.xml" -notrait category=failing $exitCode = $LastExitCode if ($exitCode -ne 0) { - $failingTests += "$_" + $failingTests += "$($_.ProjectName)" } $failCount += $exitCode @@ -69,18 +43,20 @@ $TestProjects | ForEach-Object { popd -$TestScripts | ForEach-Object { - & "$RepoRoot\scripts\test\$_" +$TestScripts | foreach { + $scriptName = "$($_.ProjectName).ps1" + + & "$RepoRoot\scripts\test\$scriptName" $exitCode = $LastExitCode if ($exitCode -ne 0) { - $failingTests += "$_" + $failingTests += "$scriptName" $failCount += 1 } } if ($failCount -ne 0) { Write-Host -ForegroundColor Red "The following tests failed." - $failingTests | ForEach-Object { + $failingTests | foreach { Write-Host -ForegroundColor Red "$_.dll failed. Logs in '$TestBinRoot\$_-testResults.xml'" } } else { diff --git a/scripts/test/runtests.sh b/scripts/test/run-tests.sh similarity index 61% rename from scripts/test/runtests.sh rename to scripts/test/run-tests.sh index 942c277ce..d1542857e 100755 --- a/scripts/test/runtests.sh +++ b/scripts/test/run-tests.sh @@ -12,48 +12,24 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli SOURCE="$(readlink "$SOURCE")" [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" -TestBinRoot="$REPOROOT/artifacts/tests" +local TestProjects=$(loadTestProjectList) +local TestScripts=$(loadTestScriptList) -TestProjects=( \ - E2E \ - StreamForwarderTests \ - dotnet-publish.Tests \ - dotnet-compile.Tests \ - dotnet-build.Tests \ -) +local failedTests=() +local failCount=0 -TestScripts=( \ - "package-command-test.sh" \ - "argument-forwarding-tests.sh" \ -) - -for project in ${TestProjects[@]} -do - dotnet publish --framework "dnxcore50" --output "$TestBinRoot" --configuration "$CONFIGURATION" "$REPOROOT/test/$project" -done - -if [ -d "$TestBinRoot/$CONFIGURATION/dnxcore50" ] -then - cp -R -f $TestBinRoot/$CONFIGURATION/dnxcore50/* $TestBinRoot -fi - -# copy TestProjects folder which is used by the test cases +# Copy TestProjects to $TestBinRoot mkdir -p "$TestBinRoot/TestProjects" cp -a $REPOROOT/test/TestProjects/* $TestBinRoot/TestProjects - pushd "$TestBinRoot" set +e -failedTests=() -failCount=0 - -for project in ${TestProjects[@]} +for project in $TestProjects do ./corerun "xunit.console.netcore.exe" "$project.dll" -xml "${project}-testResults.xml" -notrait category=failing exitCode=$? @@ -63,12 +39,15 @@ do fi done -for script in ${TestScripts[@]} -do - "$REPOROOT/scripts/test/$script" +popd + +for script in $TestScripts + local scriptName=${script}.sh + + "$REPOROOT/scripts/test/${scriptName}" exitCode=$? if [ $exitCode -ne 0 ]; then - failedTests+=($script) + failedTests+=("$scriptName") failCount+=1 fi done @@ -78,7 +57,6 @@ do error "$test failed. Logs in '$TestBinRoot/${test}-testResults.xml'" done -popd set -e exit $failCount diff --git a/scripts/test/setup/build-test-prerequisites.ps1 b/scripts/test/setup/build-test-prerequisites.ps1 new file mode 100644 index 000000000..8a80aba9c --- /dev/null +++ b/scripts/test/setup/build-test-prerequisites.ps1 @@ -0,0 +1,17 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +. "$PSScriptRoot\..\..\common\_common.ps1" + +mkdir -Force $TestPackageDir + +loadTestPackageList | foreach { + dotnet pack "$RepoRoot\test\TestPackages\$($_.ProjectName)" --output "$TestPackageDir" + + if (!$?) { + error "Command failed: dotnet pack" + Exit 1 + } +} diff --git a/scripts/test/setup/build-test-prerequisites.sh b/scripts/test/setup/build-test-prerequisites.sh new file mode 100644 index 000000000..7576bf57f --- /dev/null +++ b/scripts/test/setup/build-test-prerequisites.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done + +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../../common/_common.sh" + +mkdir -p "$TEST_PACKAGE_DIR" + +for project in loadTestPackageList() +do + dotnet pack "$REPOROOT/test/TestPackages/$project" --output "$TEST_PACKAGE_DIR" +done \ No newline at end of file diff --git a/scripts/test/setup/restore-test-prerequisites.ps1 b/scripts/test/setup/restore-test-prerequisites.ps1 new file mode 100644 index 000000000..158220e4b --- /dev/null +++ b/scripts/test/setup/restore-test-prerequisites.ps1 @@ -0,0 +1,14 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +". $PSScriptRoot\..\..\common\_common.ps1" + +header "Restoring packages" +& dotnet restore "$RepoRoot\test\TestPackages" --quiet --runtime "$Rid" + +$oldErrorAction=$ErrorActionPreference +$ErrorActionPreference="SilentlyContinue" +& dotnet restore "$RepoRoot\testapp" "$Rid" 2>&1 | Out-Null +$ErrorActionPreference=$oldErrorAction diff --git a/scripts/test/setup/restore-test-prerequisites.sh b/scripts/test/setup/restore-test-prerequisites.sh new file mode 100644 index 000000000..779d579de --- /dev/null +++ b/scripts/test/setup/restore-test-prerequisites.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../../common/_common.sh" + +header "Restoring packages" +dotnet restore "$REPOROOT/test/TestPackages" --quiet + +set +e +dotnet restore "$REPOROOT/testapp" >/dev/null 2>&1 +set -e \ No newline at end of file diff --git a/scripts/test/setup/setup-tests.ps1 b/scripts/test/setup/setup-tests.ps1 new file mode 100644 index 000000000..816c3950c --- /dev/null +++ b/scripts/test/setup/setup-tests.ps1 @@ -0,0 +1,12 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +. "$PSScriptRoot\..\..\common\_common.ps1" + +header "Test Setup: Restoring Prerequisites" +_ "$RepoRoot\scripts\test\setup\restore-test-prerequisites.ps1" + +header "Test Setup: Building Prerequisites" +_ "$RepoRoot\scripts\test\setup\build-test-prerequisites.ps1" \ No newline at end of file diff --git a/scripts/test/setup/setup-tests.sh b/scripts/test/setup/setup-tests.sh new file mode 100644 index 000000000..270632276 --- /dev/null +++ b/scripts/test/setup/setup-tests.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done + +source "$DIR/../../common/_common.sh" + +header "Test Setup: Restoring Prerequisites" +"$RepoRoot/scripts/test/restore-test-prerequisites.sh" + +header "Test Setup: Building Prerequisites" +"$RepoRoot/scripts/test/build-test-prerequisites.sh" \ No newline at end of file diff --git a/scripts/test/test.ps1 b/scripts/test/test.ps1 new file mode 100644 index 000000000..d586fb74e --- /dev/null +++ b/scripts/test/test.ps1 @@ -0,0 +1,18 @@ +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +. "$PSScriptRoot\..\common\_common.ps1" + +header "Setting up Tests" +_ "$RepoRoot\scripts\test\setup\setup-tests.ps1" + +header "Restoring test projects" +_ "$RepoRoot\scripts\test\restore-tests.ps1" + +header "Building test projects" +_ "$RepoRoot\scripts\test\build-tests.ps1" + +header "Running Tests" +_ "$RepoRoot\scripts\test\run-tests.ps1" \ No newline at end of file diff --git a/scripts/test/test.sh b/scripts/test/test.sh new file mode 100755 index 000000000..f05fe115a --- /dev/null +++ b/scripts/test/test.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# Copyright (c) .NET Foundation and contributors. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done + +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +source "$DIR/../common/_common.sh" + +header "Setting up Tests" +"$REPOROOT/scripts/test/setup/setup-tests.sh" + +header "Restoring test projects" +"$REPOROOT/scripts/test/restore-tests.sh" + +header "Building test projects" +"$REPOROOT/scripts/test/build-tests.sh" + +header "Running Tests" +"$REPOROOT/scripts/test/run-tests.sh" \ No newline at end of file diff --git a/scripts/test/validate-dependencies.sh b/scripts/test/validate-dependencies.sh index 80a93e8a9..a9e476097 100755 --- a/scripts/test/validate-dependencies.sh +++ b/scripts/test/validate-dependencies.sh @@ -14,7 +14,7 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" -source "$DIR/../common/_common.sh" +. "$DIR/../common/_common.sh" # Run Validation for Project.json dependencies dotnet publish "$REPOROOT/tools/MultiProjectValidator" -o "$STAGE2_DIR/../tools" -c "$CONFIGURATION" diff --git a/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello/Program.cs b/test/TestPackages/dotnet-hello/v1/dotnet-hello/Program.cs similarity index 100% rename from test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello/Program.cs rename to test/TestPackages/dotnet-hello/v1/dotnet-hello/Program.cs diff --git a/test/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.xproj b/test/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.xproj new file mode 100644 index 000000000..635819547 --- /dev/null +++ b/test/TestPackages/dotnet-hello/v1/dotnet-hello/dotnet-hello.xproj @@ -0,0 +1,19 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + b8055234-9a66-4ba0-8b4c-d5e431494fe3 + dotnet-hello + ..\..\..\..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\..\..\..\artifacts\bin\$(MSBuildProjectName)\ + + + + 2.0 + + + \ No newline at end of file diff --git a/test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello/project.json b/test/TestPackages/dotnet-hello/v1/dotnet-hello/project.json similarity index 100% rename from test/PackagedCommands/Commands/dotnet-hello/v1/dotnet-hello/project.json rename to test/TestPackages/dotnet-hello/v1/dotnet-hello/project.json diff --git a/test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello/Program.cs b/test/TestPackages/dotnet-hello/v2/dotnet-hello/Program.cs similarity index 100% rename from test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello/Program.cs rename to test/TestPackages/dotnet-hello/v2/dotnet-hello/Program.cs diff --git a/test/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.xproj b/test/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.xproj new file mode 100644 index 000000000..7011c102d --- /dev/null +++ b/test/TestPackages/dotnet-hello/v2/dotnet-hello/dotnet-hello.xproj @@ -0,0 +1,19 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 282c5014-d0cd-4dde-af4e-531e4a2e7bcd + dotnet-hello + ..\..\..\..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\..\..\..\artifacts\bin\$(MSBuildProjectName)\ + + + + 2.0 + + + \ No newline at end of file diff --git a/test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello/project.json b/test/TestPackages/dotnet-hello/v2/dotnet-hello/project.json similarity index 100% rename from test/PackagedCommands/Commands/dotnet-hello/v2/dotnet-hello/project.json rename to test/TestPackages/dotnet-hello/v2/dotnet-hello/project.json From afacc2c0a61b0b300df5e05c8c7b75880bd3e242 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Fri, 29 Jan 2016 19:13:07 +0000 Subject: [PATCH 2/6] Finish Refactoring Test Scripts remove publish todo small fixes small fixes fix packaging test bug Fix script bug script changes fix packaging test NuGet task cancelled workaround script fixes further more script fixes, + workaround tweak use build rather than compile in package command test --- .gitignore | 1 - scripts/build/build_appdeps.sh | 2 +- scripts/build/restore-packages.sh | 4 +-- scripts/common/_common.sh | 7 +++++- scripts/compile/compile-stage.ps1 | 25 +++++++++---------- scripts/test/build-tests.ps1 | 3 --- scripts/test/package-command-test.ps1 | 3 +-- scripts/test/package-command-test.sh | 3 +-- scripts/test/restore-tests.sh | 6 +---- .../test/setup/build-test-prerequisites.sh | 6 +++-- .../test/setup/restore-test-prerequisites.sh | 4 +-- scripts/test/setup/setup-tests.sh | 5 ++-- .../{project.json.template => project.json} | 0 .../{project.json.template => project.json} | 0 .../{project.json.template => project.json} | 0 15 files changed, 33 insertions(+), 36 deletions(-) mode change 100644 => 100755 scripts/test/setup/build-test-prerequisites.sh mode change 100644 => 100755 scripts/test/setup/restore-test-prerequisites.sh mode change 100644 => 100755 scripts/test/setup/setup-tests.sh rename test/PackagedCommands/Consumers/AppWithDirectAndToolDependency/{project.json.template => project.json} (100%) rename test/PackagedCommands/Consumers/AppWithDirectDependency/{project.json.template => project.json} (100%) rename test/PackagedCommands/Consumers/AppWithToolDependency/{project.json.template => project.json} (100%) diff --git a/.gitignore b/.gitignore index 432146b80..8deb70e27 100644 --- a/.gitignore +++ b/.gitignore @@ -269,4 +269,3 @@ _Pvt_Extensions # Exceptions # Build Scripts !scripts/build/ -test/PackagedCommands/Consumers/*/project.json diff --git a/scripts/build/build_appdeps.sh b/scripts/build/build_appdeps.sh index 92da1179e..0270f50a0 100755 --- a/scripts/build/build_appdeps.sh +++ b/scripts/build/build_appdeps.sh @@ -25,7 +25,7 @@ popd ## App Deps ## pushd $APPDEPS_PROJECT_DIR -dotnet restore --packages $APPDEPS_PROJECT_DIR/packages +dotnet restore --packages $APPDEPS_PROJECT_DIR/packages $DISABLE_PARALLEL APPDEP_SDK=$APPDEPS_PROJECT_DIR/packages/toolchain*/*/ popd diff --git a/scripts/build/restore-packages.sh b/scripts/build/restore-packages.sh index 3c0b45945..f5235c4aa 100755 --- a/scripts/build/restore-packages.sh +++ b/scripts/build/restore-packages.sh @@ -18,5 +18,5 @@ source "$DIR/../common/_common.sh" header "Restoring packages" -dotnet restore "$REPOROOT/src" --runtime "$RID" -dotnet restore "$REPOROOT/tools" --runtime "$RID" +dotnet restore "$REPOROOT/src" --runtime "$RID" $DISABLE_PARALLEL +dotnet restore "$REPOROOT/tools" --runtime "$RID" $DISABLE_PARALLEL diff --git a/scripts/common/_common.sh b/scripts/common/_common.sh index 4bcc5a1f6..2a80c6a0a 100644 --- a/scripts/common/_common.sh +++ b/scripts/common/_common.sh @@ -38,5 +38,10 @@ export CHANNEL=$RELEASE_SUFFIX source "$COMMONDIR/_nuget.sh" source "$COMMONDIR/_configuration.sh" +#TODO this is a workaround for a nuget bug on ubuntu. Remove +export DISABLE_PARALLEL="" +[[ "$RID" =~ "ubuntu" ]] && export DISABLE_PARALLEL="--disable-parallel" && echo "heyheyhey" + + unset COMMONSOURCE -unset COMMONDIR \ No newline at end of file +unset COMMONDIR diff --git a/scripts/compile/compile-stage.ps1 b/scripts/compile/compile-stage.ps1 index 72c465311..49724c18a 100644 --- a/scripts/compile/compile-stage.ps1 +++ b/scripts/compile/compile-stage.ps1 @@ -7,12 +7,11 @@ param( [Parameter(Mandatory=$true)][string]$Tfm, [Parameter(Mandatory=$true)][string]$Rid, [Parameter(Mandatory=$true)][string]$Configuration, - [Parameter(Mandatory=$true)][string]$OutputDir, + [Parameter(Mandatory=$true)][string]$StageOutputDir, [Parameter(Mandatory=$true)][string]$RepoRoot, [Parameter(Mandatory=$true)][string]$HostDir, [Parameter(Mandatory=$true)][string]$CompilationOutputDir) -. $PSScriptRoot\..\common\_common.ps1 . $REPOROOT\scripts\package\projectsToPack.ps1 $Projects = loadBuildProjectList @@ -31,13 +30,13 @@ $FilesToClean = @( "Microsoft.DotNet.Runtime.pdb" ) -$RuntimeOutputDir = "$OutputDir\runtime\coreclr" +$RuntimeOutputDir = "$StageOutputDir\runtime\coreclr" # Publish each project $Projects | ForEach-Object { - dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$CompilationOutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$($_.ProjectName)" + dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$StageOutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$($_.ProjectName)" if (!$?) { - Write-Host Command failed: dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$CompilationOutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$($_.ProjectName)" + Write-Host Command failed: dotnet publish --native-subdirectory --framework "$Tfm" --runtime "$Rid" --output "$StageOutputDir\bin" --configuration "$Configuration" "$RepoRoot\src\$($_.ProjectName)" exit 1 } } @@ -67,7 +66,7 @@ $FilesToClean | ForEach-Object { } # Copy the runtime app-local for the tools -cp -rec "$RuntimeOutputDir\*" "$OutputDir\bin" -ErrorVariable capturedErrors -ErrorAction SilentlyContinue +cp -rec "$RuntimeOutputDir\*" "$StageOutputDir\bin" -ErrorVariable capturedErrors -ErrorAction SilentlyContinue $capturedErrors | foreach-object { if ($_ -notmatch "already exists") { write-error $_ @@ -76,22 +75,22 @@ $capturedErrors | foreach-object { } # Deploy the CLR host to the output -cp "$HostDir\corehost.exe" "$OutputDir\bin" -cp "$HostDir\hostpolicy.dll" "$OutputDir\bin" +cp "$HostDir\corehost.exe" "$StageOutputDir\bin" +cp "$HostDir\hostpolicy.dll" "$StageOutputDir\bin" # corehostify externally-provided binaries (csc, vbc, etc.) $BinariesForCoreHost | ForEach-Object { - mv $OutputDir\bin\$_.exe $OutputDir\bin\$_.dll -Force - cp $OutputDir\bin\corehost.exe $OutputDir\bin\$_.exe -Force + mv $StageOutputDir\bin\$_.exe $StageOutputDir\bin\$_.dll -Force + cp $StageOutputDir\bin\corehost.exe $StageOutputDir\bin\$_.exe -Force } # Crossgen Roslyn -#if (-not (Test-Path "$OutputDir\bin\csc.ni.exe")) { +#if (-not (Test-Path "$StageOutputDir\bin\csc.ni.exe")) { #header "Crossgening Roslyn compiler ..." - #_cmd "$RepoRoot\scripts\crossgen\crossgen_roslyn.cmd ""$OutputDir""" + #_cmd "$RepoRoot\scripts\crossgen\crossgen_roslyn.cmd ""$StageOutputDir""" #} # Copy in AppDeps header "Acquiring Native App Dependencies" -_ "$RepoRoot\scripts\build\build_appdeps.ps1" @("$RepoRoot", "$OutputDir") +_ "$RepoRoot\scripts\build\build_appdeps.ps1" @("$RepoRoot", "$StageOutputDir") diff --git a/scripts/test/build-tests.ps1 b/scripts/test/build-tests.ps1 index e70d2d44d..8a2256935 100644 --- a/scripts/test/build-tests.ps1 +++ b/scripts/test/build-tests.ps1 @@ -13,6 +13,3 @@ loadTestProjectList | foreach { exit 1 } } - -# TODO: Remove this when publish paths change back -cp -rec -Force "$TestBinRoot\Debug\dnxcore50\*" "$TestBinRoot" diff --git a/scripts/test/package-command-test.ps1 b/scripts/test/package-command-test.ps1 index bc8431cbb..476a171c9 100644 --- a/scripts/test/package-command-test.ps1 +++ b/scripts/test/package-command-test.ps1 @@ -9,7 +9,7 @@ dir "$RepoRoot\test\PackagedCommands\Consumers" | where {$_.PsIsContainer} | where {$_.Name.Contains("Direct")} | foreach { pushd "$RepoRoot\test\PackagedCommands\Consumers\$_" - dotnet compile + dotnet build popd } @@ -21,7 +21,6 @@ foreach { $outputArray = dotnet hello | Out-String $output = [string]::Join('\n', $outputArray).Trim("`r", "`n") - del "project.json" if ($output -ne "hello") { error "Test Failed: $testName\dotnet hello" error " printed $output" diff --git a/scripts/test/package-command-test.sh b/scripts/test/package-command-test.sh index 8d52e8c33..6baf6eb59 100755 --- a/scripts/test/package-command-test.sh +++ b/scripts/test/package-command-test.sh @@ -21,7 +21,7 @@ source "$DIR/../common/_common.sh" for test in $(ls -l "$REPOROOT/test/PackagedCommands/Consumers" | grep ^d | awk '{print $9}' | grep "Direct") do pushd "$REPOROOT/test/PackagedCommands/Consumers/$test" - dotnet compile + dotnet build popd done @@ -34,7 +34,6 @@ do output=$(dotnet hello) - rm "project.json" if [ "$output" == "Hello" ] ; then diff --git a/scripts/test/restore-tests.sh b/scripts/test/restore-tests.sh index a632b06ff..c8c60dbf0 100755 --- a/scripts/test/restore-tests.sh +++ b/scripts/test/restore-tests.sh @@ -18,8 +18,4 @@ source "$DIR/../common/_common.sh" header "Restoring Test Packages" -dotnet restore "$REPOROOT/test" -f "$TEST_PACKAGE_DIR" - -set +e -dotnet restore "$REPOROOT/testapp" >/dev/null 2>&1 -set -e \ No newline at end of file +dotnet restore "$REPOROOT/test" -f "$TEST_PACKAGE_DIR" $DISABLE_PARALLEL diff --git a/scripts/test/setup/build-test-prerequisites.sh b/scripts/test/setup/build-test-prerequisites.sh old mode 100644 new mode 100755 index 7576bf57f..a7d5bdbb4 --- a/scripts/test/setup/build-test-prerequisites.sh +++ b/scripts/test/setup/build-test-prerequisites.sh @@ -19,7 +19,9 @@ source "$DIR/../../common/_common.sh" mkdir -p "$TEST_PACKAGE_DIR" -for project in loadTestPackageList() +PROJECTS=$(loadTestPackageList) + +for project in $PROJECTS do dotnet pack "$REPOROOT/test/TestPackages/$project" --output "$TEST_PACKAGE_DIR" -done \ No newline at end of file +done diff --git a/scripts/test/setup/restore-test-prerequisites.sh b/scripts/test/setup/restore-test-prerequisites.sh old mode 100644 new mode 100755 index 779d579de..f5f1e7d2b --- a/scripts/test/setup/restore-test-prerequisites.sh +++ b/scripts/test/setup/restore-test-prerequisites.sh @@ -17,8 +17,8 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../../common/_common.sh" header "Restoring packages" -dotnet restore "$REPOROOT/test/TestPackages" --quiet +dotnet restore "$REPOROOT/test/TestPackages" --quiet $DISABLE_PARALLEL set +e -dotnet restore "$REPOROOT/testapp" >/dev/null 2>&1 +dotnet restore "$REPOROOT/testapp" $DISABLE_PARALLEL >/dev/null 2>&1 set -e \ No newline at end of file diff --git a/scripts/test/setup/setup-tests.sh b/scripts/test/setup/setup-tests.sh old mode 100644 new mode 100755 index 270632276..d8ad16d6d --- a/scripts/test/setup/setup-tests.sh +++ b/scripts/test/setup/setup-tests.sh @@ -12,11 +12,12 @@ while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symli SOURCE="$(readlink "$SOURCE")" [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../../common/_common.sh" header "Test Setup: Restoring Prerequisites" -"$RepoRoot/scripts/test/restore-test-prerequisites.sh" +"$REPOROOT/scripts/test/setup/restore-test-prerequisites.sh" header "Test Setup: Building Prerequisites" -"$RepoRoot/scripts/test/build-test-prerequisites.sh" \ No newline at end of file +"$REPOROOT/scripts/test/setup/build-test-prerequisites.sh" \ No newline at end of file diff --git a/test/PackagedCommands/Consumers/AppWithDirectAndToolDependency/project.json.template b/test/PackagedCommands/Consumers/AppWithDirectAndToolDependency/project.json similarity index 100% rename from test/PackagedCommands/Consumers/AppWithDirectAndToolDependency/project.json.template rename to test/PackagedCommands/Consumers/AppWithDirectAndToolDependency/project.json diff --git a/test/PackagedCommands/Consumers/AppWithDirectDependency/project.json.template b/test/PackagedCommands/Consumers/AppWithDirectDependency/project.json similarity index 100% rename from test/PackagedCommands/Consumers/AppWithDirectDependency/project.json.template rename to test/PackagedCommands/Consumers/AppWithDirectDependency/project.json diff --git a/test/PackagedCommands/Consumers/AppWithToolDependency/project.json.template b/test/PackagedCommands/Consumers/AppWithToolDependency/project.json similarity index 100% rename from test/PackagedCommands/Consumers/AppWithToolDependency/project.json.template rename to test/PackagedCommands/Consumers/AppWithToolDependency/project.json From 39682cd14b2db0d5bc380bac5d303ea0ae17afe2 Mon Sep 17 00:00:00 2001 From: Bryan Date: Fri, 29 Jan 2016 19:04:18 -0800 Subject: [PATCH 3/6] dotnet-restore fix add rid to all restores in test Add Rid to appdep script, fix common more script fixes! fixes script fix script fix Fix up the Runtests script more fixes :) --- scripts/build/build_appdeps.sh | 2 +- scripts/common/_common.sh | 3 +-- scripts/test/build-tests.sh | 8 +++---- scripts/test/restore-tests.ps1 | 1 - scripts/test/restore-tests.sh | 2 +- scripts/test/run-tests.sh | 21 ++++++++++--------- .../test/setup/restore-test-prerequisites.sh | 4 ++-- src/dotnet-restore/Program.cs | 5 +++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/scripts/build/build_appdeps.sh b/scripts/build/build_appdeps.sh index 0270f50a0..3327fb7c2 100755 --- a/scripts/build/build_appdeps.sh +++ b/scripts/build/build_appdeps.sh @@ -25,7 +25,7 @@ popd ## App Deps ## pushd $APPDEPS_PROJECT_DIR -dotnet restore --packages $APPDEPS_PROJECT_DIR/packages $DISABLE_PARALLEL +dotnet restore --runtime $RID --packages $APPDEPS_PROJECT_DIR/packages $DISABLE_PARALLEL APPDEP_SDK=$APPDEPS_PROJECT_DIR/packages/toolchain*/*/ popd diff --git a/scripts/common/_common.sh b/scripts/common/_common.sh index 2a80c6a0a..df84fdad5 100644 --- a/scripts/common/_common.sh +++ b/scripts/common/_common.sh @@ -40,8 +40,7 @@ source "$COMMONDIR/_configuration.sh" #TODO this is a workaround for a nuget bug on ubuntu. Remove export DISABLE_PARALLEL="" -[[ "$RID" =~ "ubuntu" ]] && export DISABLE_PARALLEL="--disable-parallel" && echo "heyheyhey" - +[[ "$RID" =~ "ubuntu" ]] && export DISABLE_PARALLEL="--disable-parallel" unset COMMONSOURCE unset COMMONDIR diff --git a/scripts/test/build-tests.sh b/scripts/test/build-tests.sh index c16a3beff..fadfc67ec 100755 --- a/scripts/test/build-tests.sh +++ b/scripts/test/build-tests.sh @@ -17,10 +17,10 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" -for project in loadTestList() +PROJECTS=$(loadTestProjectList) + +for project in $PROJECTS do - dotnet publish --framework "dnxcore50" --runtime "$Rid" --output "$TestBinRoot" --configuration "$CONFIGURATION" "$REPOROOT/test/$project" + dotnet publish --framework "dnxcore50" --runtime "$RID" --output "$TEST_BIN_ROOT" --configuration "$CONFIGURATION" "$REPOROOT/test/$project" done -# TODO: Remove this when publish paths change back -cp -a "$TestBinRoot/Debug/dnxcore50/." "$TestBinRoot" diff --git a/scripts/test/restore-tests.ps1 b/scripts/test/restore-tests.ps1 index ea9e46f0f..48d1dd5e7 100644 --- a/scripts/test/restore-tests.ps1 +++ b/scripts/test/restore-tests.ps1 @@ -9,4 +9,3 @@ info "Restoring Test Projects" # Restore packages & dotnet restore "$RepoRoot\test" -f "$TestPackageDir" - diff --git a/scripts/test/restore-tests.sh b/scripts/test/restore-tests.sh index c8c60dbf0..29a2c9fe6 100755 --- a/scripts/test/restore-tests.sh +++ b/scripts/test/restore-tests.sh @@ -18,4 +18,4 @@ source "$DIR/../common/_common.sh" header "Restoring Test Packages" -dotnet restore "$REPOROOT/test" -f "$TEST_PACKAGE_DIR" $DISABLE_PARALLEL +dotnet restore "$REPOROOT/test" --runtime $RID -f "$TEST_PACKAGE_DIR/debug" $DISABLE_PARALLEL diff --git a/scripts/test/run-tests.sh b/scripts/test/run-tests.sh index d1542857e..d5e36ed81 100755 --- a/scripts/test/run-tests.sh +++ b/scripts/test/run-tests.sh @@ -16,17 +16,17 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" -local TestProjects=$(loadTestProjectList) -local TestScripts=$(loadTestScriptList) +TestProjects=$(loadTestProjectList) +TestScripts=$(loadTestScriptList) -local failedTests=() -local failCount=0 +failedTests=() +failCount=0 -# Copy TestProjects to $TestBinRoot -mkdir -p "$TestBinRoot/TestProjects" -cp -a $REPOROOT/test/TestProjects/* $TestBinRoot/TestProjects +# Copy TestProjects to $TEST_BIN_ROOT +mkdir -p "$TEST_BIN_ROOT/TestProjects" +cp -a $REPOROOT/test/TestProjects/* $TEST_BIN_ROOT/TestProjects -pushd "$TestBinRoot" +pushd "$TEST_BIN_ROOT" set +e for project in $TestProjects @@ -42,7 +42,8 @@ done popd for script in $TestScripts - local scriptName=${script}.sh +do + scriptName=${script}.sh "$REPOROOT/scripts/test/${scriptName}" exitCode=$? @@ -54,7 +55,7 @@ done for test in ${failedTests[@]} do - error "$test failed. Logs in '$TestBinRoot/${test}-testResults.xml'" + error "$test failed. Logs in '$TEST_BIN_ROOT/${test}-testResults.xml'" done set -e diff --git a/scripts/test/setup/restore-test-prerequisites.sh b/scripts/test/setup/restore-test-prerequisites.sh index f5f1e7d2b..76d01a581 100755 --- a/scripts/test/setup/restore-test-prerequisites.sh +++ b/scripts/test/setup/restore-test-prerequisites.sh @@ -17,8 +17,8 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../../common/_common.sh" header "Restoring packages" -dotnet restore "$REPOROOT/test/TestPackages" --quiet $DISABLE_PARALLEL +dotnet restore "$REPOROOT/test/TestPackages" --runtime $RID --quiet $DISABLE_PARALLEL set +e -dotnet restore "$REPOROOT/testapp" $DISABLE_PARALLEL >/dev/null 2>&1 +dotnet restore "$REPOROOT/testapp" --runtime $RID $DISABLE_PARALLEL >/dev/null 2>&1 set -e \ No newline at end of file diff --git a/src/dotnet-restore/Program.cs b/src/dotnet-restore/Program.cs index 5406b6d7e..6e183f4b0 100644 --- a/src/dotnet-restore/Program.cs +++ b/src/dotnet-restore/Program.cs @@ -41,8 +41,9 @@ namespace Microsoft.DotNet.Tools.Restore if (!args.Any(s => s.Equals("--runtime", StringComparison.OrdinalIgnoreCase))) { args = Enumerable.Concat( - PlatformServices.Default.Runtime.GetOverrideRestoreRuntimeIdentifiers().SelectMany(r => new [] { "--runtime", r }), - args).ToArray(); + args, + PlatformServices.Default.Runtime.GetOverrideRestoreRuntimeIdentifiers().SelectMany(r => new [] { "--runtime", r }) + ).ToArray(); } app.OnExecute(() => From 1a1e755dd22bd6da6bd184aa94e2cd9987173768 Mon Sep 17 00:00:00 2001 From: Bryan Date: Fri, 29 Jan 2016 21:44:53 -0800 Subject: [PATCH 4/6] add back assertion for deps file not existing --- .../dotnet-publish.Tests/Microsoft.DotNet.Tools.Publish.Tests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/dotnet-publish.Tests/Microsoft.DotNet.Tools.Publish.Tests.cs b/test/dotnet-publish.Tests/Microsoft.DotNet.Tools.Publish.Tests.cs index 3a5af1d39..0ddfc3ee2 100644 --- a/test/dotnet-publish.Tests/Microsoft.DotNet.Tools.Publish.Tests.cs +++ b/test/dotnet-publish.Tests/Microsoft.DotNet.Tools.Publish.Tests.cs @@ -149,6 +149,7 @@ namespace Microsoft.DotNet.Tools.Publish.Tests publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryLesser.dll"); publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryLesser.pdb"); publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryLesser.dll.config"); + publishCommand.GetOutputDirectory().Should().NotHaveFile("TestLibraryLesser.deps"); // dependencies should also be copied publishCommand.GetOutputDirectory().Should().HaveFile("Newtonsoft.Json.dll"); From 7172cea49c8f6f29bd516b98c41929b82a6cbc10 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Sat, 30 Jan 2016 00:20:09 -0800 Subject: [PATCH 5/6] add back assert for deps file --- .../Microsoft.DotNet.Tools.Publish.Tests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/dotnet-publish.Tests/Microsoft.DotNet.Tools.Publish.Tests.cs b/test/dotnet-publish.Tests/Microsoft.DotNet.Tools.Publish.Tests.cs index 0ddfc3ee2..0a804dc2a 100644 --- a/test/dotnet-publish.Tests/Microsoft.DotNet.Tools.Publish.Tests.cs +++ b/test/dotnet-publish.Tests/Microsoft.DotNet.Tools.Publish.Tests.cs @@ -161,6 +161,8 @@ namespace Microsoft.DotNet.Tools.Publish.Tests publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryLesser.dll"); publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryLesser.pdb"); publishCommand.GetOutputDirectory().Should().NotHaveFile("TestLibraryLesser.dll.config"); + publishCommand.GetOutputDirectory().Should().HaveFile("TestLibraryLesser.deps"); + // dependencies should also be copied publishCommand.GetOutputDirectory().Should().HaveFile("Newtonsoft.Json.dll"); } From f4bf77044b0fc1efd5e71ac4425877aa577cc848 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Mon, 1 Feb 2016 12:52:42 -0800 Subject: [PATCH 6/6] update paths to generated nuget packages --- scripts/test/restore-tests.ps1 | 2 +- scripts/test/restore-tests.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/test/restore-tests.ps1 b/scripts/test/restore-tests.ps1 index 48d1dd5e7..870e54bf5 100644 --- a/scripts/test/restore-tests.ps1 +++ b/scripts/test/restore-tests.ps1 @@ -8,4 +8,4 @@ info "Restoring Test Projects" # Restore packages -& dotnet restore "$RepoRoot\test" -f "$TestPackageDir" +& dotnet restore "$RepoRoot\test" -f "$TestPackageDir\Debug" diff --git a/scripts/test/restore-tests.sh b/scripts/test/restore-tests.sh index 29a2c9fe6..4757e79a5 100755 --- a/scripts/test/restore-tests.sh +++ b/scripts/test/restore-tests.sh @@ -18,4 +18,4 @@ source "$DIR/../common/_common.sh" header "Restoring Test Packages" -dotnet restore "$REPOROOT/test" --runtime $RID -f "$TEST_PACKAGE_DIR/debug" $DISABLE_PARALLEL +dotnet restore "$REPOROOT/test" --runtime $RID -f "$TEST_PACKAGE_DIR/Debug" $DISABLE_PARALLEL