fixed Install-PipxPackages.ps1 and tests

This commit is contained in:
Nikita Bykov
2020-10-09 09:37:58 +03:00
parent b15e7c1c00
commit f683996383
3 changed files with 11 additions and 8 deletions

View File

@@ -1,12 +1,12 @@
$pipxToolset = (Get-ToolsetContent).pipx $pipxToolset = (Get-ToolsetContent).pipx
foreach($tool in $pipxToolset) { foreach($tool in $pipxToolset) {
if ($tool.python) { if ($tool.python) {
$pythonPath = "${env:AGENT_TOOLSDIRECTORY}\Python\${tool.python}*\${env:AGENT_OSARCHITECTURE}\python-${tool.python}*" $pythonPath = (Get-Item -Path "${env:AGENT_TOOLSDIRECTORY}\Python\${tool.python}.*\x64\python-${tool.python}*").FullName
Write-Host "Install ${tool.package} into python ${tool.python}" Write-Host "Install ${tool.package} into python ${tool.python}"
pipx install $tool.package --python $python_path pipx install $tool.package --python $pythonPath
} else { } else {
Write-Host "Install ${tool.package} into default python" Write-Host "Install ${tool.package} into default python"
pipx install $tool.package pipx install $tool.package
} }
Invoke-PesterTests -TestFile "PipxPackages" -TestName $tool.package }
} Invoke-PesterTests -TestFile "PipxPackages"

View File

@@ -1,5 +1,8 @@
Describe "yamllint" { Describe "PipxPackages" {
It "yamllint" { $pipxToolset = (Get-ToolsetContent).pipx
"yamllint --version" | Should -ReturnZeroExitCode foreach($tool in $pipxToolset) {
It "${tool.package}" {
"${tool.cmd}" | Should -ReturnZeroExitCode
}
} }
} }

View File

@@ -292,7 +292,7 @@
"pipx": [ "pipx": [
{ {
"package": "yamllint", "package": "yamllint",
"cmd": "yamllint" "cmd": "yamllint --version"
} }
] ]
} }