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
foreach($tool in $pipxToolset) {
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}"
pipx install $tool.package --python $python_path
pipx install $tool.package --python $pythonPath
} else {
Write-Host "Install ${tool.package} into default python"
pipx install $tool.package
}
Invoke-PesterTests -TestFile "PipxPackages" -TestName $tool.package
}
}
Invoke-PesterTests -TestFile "PipxPackages"

View File

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

View File

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