Skip to content

Commit

Permalink
Merge pull request grpc#7568 from apolcyn/update_tests_for_new_nuget_ga
Browse files Browse the repository at this point in the history
update to use new nuget client in tests
  • Loading branch information
kpayson64 authored Jul 29, 2016
2 parents 623e4fc + 1617677 commit 531c909
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 11 deletions.
6 changes: 0 additions & 6 deletions src/csharp/.nuget/packages.config

This file was deleted.

5 changes: 4 additions & 1 deletion src/csharp/Grpc.Core.Tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
<package id="NUnit" version="3.2.0" targetFramework="net45" />
<package id="NUnitLite" version="3.2.0" targetFramework="net45" />
</packages>
<package id="NUnit.ConsoleRunner" version="3.2.0" />
<package id="OpenCover" version="4.6.519" />
<package id="ReportGenerator" version="2.4.4.0" />
</packages>
5 changes: 4 additions & 1 deletion src/csharp/Grpc.Core.Tests/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
},
"Newtonsoft.Json": "8.0.3",
"NUnit": "3.2.0",
"NUnitLite": "3.2.0-*"
"NUnitLite": "3.2.0-*",
"NUnit.ConsoleRunner": "3.2.0",
"OpenCover": "4.6.519",
"ReportGenerator": "2.4.4.0"
},
"frameworks": {
"net45": { },
Expand Down
3 changes: 3 additions & 0 deletions src/csharp/Grpc.Examples.MathClient/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
</packages>
3 changes: 3 additions & 0 deletions src/csharp/Grpc.Examples.MathServer/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
</packages>
3 changes: 3 additions & 0 deletions src/csharp/Grpc.IntegrationTesting.QpsWorker/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
</packages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
</packages>
5 changes: 4 additions & 1 deletion templates/src/csharp/Grpc.Core.Tests/project.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
},
"Newtonsoft.Json": "8.0.3",
"NUnit": "3.2.0",
"NUnitLite": "3.2.0-*"
"NUnitLite": "3.2.0-*",
"NUnit.ConsoleRunner": "3.2.0",
"OpenCover": "4.6.519",
"ReportGenerator": "2.4.4.0"
},
"frameworks": {
"net45": { },
Expand Down
55 changes: 54 additions & 1 deletion tools/run_tests/pre_build_csharp.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,61 @@ cd /d %~dp0\..\..
set NUGET=C:\nuget\nuget.exe

if exist %NUGET% (
@rem Restore Grpc packages by packages since Nuget client 3.4.4 doesnt support restore
@rem by solution
@rem Moving into each directory to let the restores work with both nuget 3.4 and 2.8
%NUGET% restore vsprojects/grpc_csharp_ext.sln || goto :error
%NUGET% restore src/csharp/Grpc.sln || goto :error

cd src/csharp

cd Grpc.Auth || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.Core || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.Core.Tests || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.Examples.MathClient || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.Examples.MathServer || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.Examples || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.HealthCheck.Tests || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.HealthCheck || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.IntegrationTesting.Client || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.IntegrationTesting.QpsWorker || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.IntegrationTesting.StressClient || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error
cd ..

cd Grpc.IntegrationTesting || goto :error
%NUGET% restore -PackagesDirectory ../packages || goto :error

cd /d %~dp0\..\.. || goto :error
)

endlocal
Expand Down
51 changes: 50 additions & 1 deletion tools/run_tests/pre_build_csharp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,54 @@ root=`pwd`

if [ -x "$(command -v nuget)" ]
then
nuget restore Grpc.sln
# Restoring Nuget packages by packages rather than by solution because of
# inability to restore by solution with Nuget client 3.4.4
# Moving into each directory to let the restores work with nuget 3.4 and 2.8
cd Grpc.Auth
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.Core.Tests
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.Core
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.Examples.MathClient
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.Examples.MathServer
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.Examples
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.HealthCheck.Tests
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.HealthCheck
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.IntegrationTesting.Client
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.IntegrationTesting.QpsWorker
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.IntegrationTesting.StressClient
nuget restore -PackagesDirectory ../packages
cd ..

cd Grpc.IntegrationTesting
nuget restore -PackagesDirectory ../packages
cd ..
fi

0 comments on commit 531c909

Please sign in to comment.