Pester
Pester copied to clipboard
Cache nuget packages in CI-pipeline
Checklist
- [X] Issue has a meaningful title
- [X] I have searched the existing issues. See all issues
- [X] I have tested using the latest version of Pester. See Installation and update guide.
What is the issue?
Azure Pipeline CI takes forever to restore and build c# projects. 1-1.5min on restoring the empty PesterTests-project itself. Ex.
Microsoft (R) Build Engine version 16.11.3+5d7fe36cf for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored D:\a\1\s\src\csharp\Pester\Pester.csproj **(in 35.09 sec).**
Restored D:\a\1\s\src\csharp\PesterTests\PesterTests.csproj **(in 1.5 min).**
Pester -> D:\a\1\s\src\csharp\Pester\bin\Release\net452\Pester.dll
Pester -> D:\a\1\s\src\csharp\Pester\bin\Release\netstandard2.0\Pester.dll
PesterTests -> D:\a\1\s\src\csharp\PesterTests\bin\Release\netcoreapp3.1\PesterTests.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:01:55.37
Expected Behavior
Build in CI-pipeline goes faster
Steps To Reproduce
No response
Describe your environment
No response
Possible Solution?
Add caching-steps, see. https://docs.microsoft.com/en-us/azure/devops/pipelines/artifacts/caching-nuget?view=azure-devops
Will have to add lock-file AFAIK
Interesting, is that on any CI or just macos? I remember seeing it on macos a lot. The tests project does not use anything special, I don't see why that would take 1.5 minutes to restore.
dotnet restore "S:\p\pester\src\csharp\Pester.sln" --force-evaluate --no-cache --force
Determining projects to restore...
Restored S:\p\pester\src\csharp\Pester\Pester.csproj (in 157 ms).
Restored S:\p\pester\src\csharp\PesterTests\PesterTests.csproj (in 202 ms).
It was pester CI, build step on windows_2019. Check a PR :) it's been slower lately, but still a minute ++ we don't need for mostly static dependencies.
The PesterTests-project itself could also be deleted until until someone actually wants to write the tests. Most is probably covered through the PowerShell tests.