Skip to content

Should expand relative paths in Pester path properties #121

Description

@johlju

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:

if (-not (Split-Path -IsAbsolute $DscTestOutputFolder))
{
$DscTestOutputFolder = Join-Path -Path $OutputDirectory -ChildPath $DscTestOutputFolder
}

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.

foreach ($propertyName in $propertyNames)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue is a bug.help wantedThe issue is up for grabs for anyone in the community.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions