Skip to content

Commit

Permalink
make path to appSettings.json absoluteand present
Browse files Browse the repository at this point in the history
  • Loading branch information
fey101 committed Jul 9, 2024
1 parent 4cf5d06 commit e761ec8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 1 addition & 3 deletions pipelines/snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@ stages:
workingDirectory: '$(Build.SourcesDirectory)'
- pwsh: |
Write-Host "create file appSettings.json in the workingDirectory"
New-Item -Path $(Build.SourcesDirectory) -Name "appSettings.json" -ItemType "file" -Force
Write-Host "Creating folder Reports"
New-Item -Path $(Build.SourcesDirectory) -Name "Reports" -ItemType "Directory" -Force
displayName: Create requisite directory items
Expand All @@ -202,7 +200,7 @@ stages:
ScriptPath: "$(Build.SourcesDirectory)/scripts/categorizeErrors.ps1"
ScriptArguments: "
-trxFolderPath '$(Build.ArtifactStagingDirectory)/TestResults/'
-txtOutputFolderPath '$(Build.ArtifactStagingDirectory)/Reports/'
-reportOutputPath '$(Build.ArtifactStagingDirectory)/Reports/'
-snippetsBaseErrorPath '$(Build.ArtifactStagingDirectory)'
"
workingDirectory: '$(Build.SourcesDirectory)'
Expand Down
10 changes: 5 additions & 5 deletions scripts/categorizeErrors.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ param(
[Parameter(Mandatory=$true)]
[string]$snippetsBaseErrorPath,
[Parameter(Mandatory=$false)]
[string]$txtOutputFolderPath
[string]$reportOutputPath
)

Import-Module ImportExcel
Expand All @@ -15,10 +15,10 @@ if (!(Test-Path $trxFolderPath))
exit
}

#if $txtOutputFolderPath is not set, use current directory
if (-not $txtOutputFolderPath)
#if $reportOutputPath is not set, use current directory
if (-not $reportOutputPath)
{
$txtOutputFolderPath = $PSScriptRoot
$reportOutputPath = $PSScriptRoot
}

$outcomeLocal = "Failed" # Only process failed tests
Expand Down Expand Up @@ -113,7 +113,7 @@ foreach ($trxFilePath in $files){

}

$excelOutputPath = Join-Path $txtOutputFolderPath "report.xlsx"
$excelOutputPath = Join-Path $reportOutputPath "report.xlsx"
$methodNotFound | Export-Excel -Path $excelOutputPath -WorksheetName "MethodNotFound" -AutoSize
$pathNotFound | Export-Excel -Path $excelOutputPath -WorksheetName "PathNotFound" -AutoSize
$invalidStart | Export-Excel -Path $excelOutputPath -WorksheetName "InvalidStart" -AutoSize
Expand Down
10 changes: 5 additions & 5 deletions scripts/getWorkloadOwner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ function Get-AppSettings ()
return $AppSettings
}
# read app settings from Azure App Config
$baseWorkingDirectory = $env:WorkingDirectory
if (!$baseWorkingDirectory)
$baseSettingsDirectory = $env:WorkingDirectory
if (!$baseSettingsDirectory)
{
$baseWorkingDirectory = $env:TEMP
New-Item -Path $baseWorkingDirectory -Name "appSettings.json"
$baseSettingsDirectory = $env:TEMP
}
$appSettingsPath = Join-Path $baseWorkingDirectory "appSettings.json" -Resolve
New-Item -Path $baseSettingsDirectory -Name "appSettings.json" -Force
$appSettingsPath = Join-Path $baseSettingsDirectory "appSettings.json" -Resolve
write-host "appsettings path: $appSettingsPath"
# Support Reading Settings from a Custom Label, otherwise default to Development
$settingsLabel = $env:RAPTOR_CONFIGLABEL
Expand Down

0 comments on commit e761ec8

Please sign in to comment.