From ac0dc9a666e4f1f3b6f7744796377f56df717d36 Mon Sep 17 00:00:00 2001 From: piotrp Date: Sun, 10 Jan 2016 23:06:02 -0800 Subject: [PATCH] Create test packages directory --- scripts/test/package-command-test.ps1 | 9 +++++++-- scripts/test/package-command-test.sh | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/test/package-command-test.ps1 b/scripts/test/package-command-test.ps1 index 9a82a2107..ec3e769b3 100644 --- a/scripts/test/package-command-test.ps1 +++ b/scripts/test/package-command-test.ps1 @@ -5,12 +5,17 @@ . "$PSScriptRoot\..\common\_common.ps1" +$TestPackagesPath = "$RepoRoot\tests\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 "$RepoRoot\artifacts\packages" + cp "$RepoRoot\test\PackagedCommands\Commands\dotnet-hello\$_\dotnet-hello\bin\Debug\*.nupkg" -Destination $TestPackagesPath if (!$?) { error "Command failed: dotnet pack" Exit 1 @@ -27,7 +32,7 @@ foreach { #restore test projects pushd "$RepoRoot\test\PackagedCommands\Consumers" -dotnet restore -s "$RepoRoot\artifacts\packages" --no-cache --ignore-failed-sources --parallel +dotnet restore -s "$TestPackagesPath" --no-cache --ignore-failed-sources --parallel if (!$?) { error "Command failed: dotnet restore" Exit 1 diff --git a/scripts/test/package-command-test.sh b/scripts/test/package-command-test.sh index 53906df60..592f5999d 100755 --- a/scripts/test/package-command-test.sh +++ b/scripts/test/package-command-test.sh @@ -17,10 +17,15 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" source "$DIR/../common/_common.sh" +TestPackagesPath="$REPOROOT/tests/packages" + +mkdir "$REPOROOT/tests" +mkdir "$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 "$REPOROOT/artifacts/packages" +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 "$REPOROOT/artifacts/packages" +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") @@ -32,7 +37,7 @@ done # restore test projects pushd "$REPOROOT/test/PackagedCommands/Consumers" -dotnet restore -s "$REPOROOT/artifacts/packages" --no-cache --ignore-failed-sources --parallel +dotnet restore -s "$TestPackagesPath" --no-cache --ignore-failed-sources --parallel popd #compile tests with direct dependencies