This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
Change ProjectPath parameter for Build task to avoid future potential duplicate Pester tests #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
Pull Request (PR) description
This PR will look mostly useless considering we don't use Pester in BicepNet, but I found a crazy edge case in https://github.com/PalmEmanuel/AzBobbyTables when implementing Sampler and felt the need to document it somewhere 😅
If the parameter to this task (likely to any task run after
Build_Module_ModuleBuilder
) is named$ProjectPath
, it will overwrite whatever value Sampler set up to provide for Pester. Since Pester accepts multiple paths, the result is that it will try to find "$ProjectPath/$WhateverValueIsConfiguredHere" for all paths. For BicepNet it would try to find tests in bothBicepNet.PS/Tests
andBicepNet.Core/Tests
, and if you change the line linked above to a relative paths it will result in all tests being found and run twice.Even if we don't use Pester here, I felt like this was a good place to fix it and explain why.
Task list
build.ps1 -ResolveDependency
).