Skip to content
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

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

PalmEmanuel
Copy link
Member

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 both BicepNet.PS/Tests and BicepNet.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

  • The PR represents a single logical change. i.e. Cosmetic updates should go in different PRs.
  • Added an entry under the Unreleased section of in the CHANGELOG.md as per format.
  • Local clean build passes without issue or fail tests (build.ps1 -ResolveDependency).
  • Markdown help added/updated.
  • Unit tests added/updated.

Copy link

github-actions bot commented Jan 6, 2024

Linux Test Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 466fa3e.

♻️ This comment has been updated with latest results.

@SimonWahlin SimonWahlin merged commit bafcf07 into main Jan 9, 2024
3 of 6 checks passed
@SimonWahlin SimonWahlin deleted the preemptive-pester-conflict-avoidance branch January 9, 2024 06:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants