Skip to content

Commit

Permalink
Merge pull request #7 from saltstack/fix_windows_tests
Browse files Browse the repository at this point in the history
Migrate tests from gitlab
  • Loading branch information
dmurphy18 authored Nov 27, 2024
2 parents ec27599 + 77957e4 commit 49e2836
Showing 1 changed file with 16 additions and 27 deletions.
43 changes: 16 additions & 27 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,23 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Python Dependencies
run: |
python3 -m pip install -r tests/requirements.txt
- name: Get Version
run: |
# We need to get the version here and make it an environment variable
# It is used to install via svtminion and in the test
# The version is in the instance name
$instance = "${{ matrix.instance }}"
$version = $instance -split "-",2
if ( $version.Count -gt 1 ) {
$version = $version[1].Replace("-", ".")
}
Write-Output "SaltVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: VMTools Salt
run: |
. .\windows\svtminion.ps1 -RunService $false -Version $env:SaltVersion
- name: Test svtminion
- name: Test SVT Minion Script
run: |
pytest --cache-clear -v -s -ra --log-cli-level=debug tests/integration/
# Make sure we can run the script
Write-Host "Run Script (no parameters)"
try { .\windows\svtminion.ps1 | Out-Null } catch {} finally { if ( $LASTEXITCODE -ne 126 ) { Write-Host "Failed to execute"; exit 1 } else { $LASTEXITCODE = 0 } }
# Make sure we can display help
Write-Host "Run Script (display help)"
try { .\windows\svtminion.ps1 -Help | Out-Null } catch {} finally { if ( $LASTEXITCODE -ne 0 ) { Write-Host "Status not 0"; exit 1 } }
# Make sure we get a status
Write-Host "Run Script (get status)"
try { .\windows\svtminion.ps1 -Status | Out-Null } catch {} finally { if ( $LASTEXITCODE -ge 100 ) { $LASTEXITCODE = 0 } else { Write-Host "Status: $LASTEXITCODE"; exit 1 } }
# Running functional tests (must be run with powershell -file)
Write-Host "Run Unit Tests"
powershell -file .\tests\windows\runtests.ps1
# Running integration tests (must be run with powershell -file)
Write-Host "Run Integration Tests"
powershell -file .\tests\windows\runtests.ps1 -Integration
- name: Set Exit Status
if: always()
Expand Down

0 comments on commit 49e2836

Please sign in to comment.