dsccommunity / dsccommunity/DscResource.Test

Should expand relative paths in Pester path properties

Open
#121 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
PowerShell
Stars
6
Forks
9
PR merge metrics
No merged PRs in 30d

Description

If the property OutputPath is used in the build.yaml with a relative path (to the project path), it will not be made an absolute path by the task, meaning in this case, the test result file end up in the wrong place.

DscTest:
  Pester:
    Configuration:
      TestResult:
        OutputPath: ./output/testResults/NUnitXml_HQRM_Tests.xml

The variable $DscTestOutputFolder is set to the absolute path of the projects './output/testResults' folder here:

https://github.com/dsccommunity/DscResource.Test/blob/27c70ec121b41eff95f17747f0dc2176f89cdfa8/source/tasks/Invoke_HQRM_Tests.build.ps1#L90-L93

So here for each property that is a path, e.g. OutputPath, should be checked whether it is an absolute path. If not, join the relative path with the path in the variable above.

https://github.com/dsccommunity/DscResource.Test/blob/27c70ec121b41eff95f17747f0dc2176f89cdfa8/source/tasks/Invoke_HQRM_Tests.build.ps1#L240

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect source/tasks/Invoke_HQRM_Tests.build.ps1, especially the setup around lines 90-93 and the Pester configuration around line 240. Check how OutputPath and other path properties are handled relative to $DscTestOutputFolder. Done means relative paths resolve under that absolute project output folder while absolute paths remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.