Skip to content

Commit

Permalink
make tests responsible for checking exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
nzbr committed Nov 10, 2022
1 parent 3bda6c1 commit b0aed50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
File renamed without changes.
5 changes: 5 additions & 0 deletions tests/installer.spec.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ $id = WSL-Install

try {
WSL-Launch $id "nixos-version"
if ($LASTEXITCODE -ne 0) {
throw "Failed to run nixos-version inside the container"
}

# TODO: WSL-Shutdown
}
finally {
WSL-Uninstall($id)
Expand Down
3 changes: 0 additions & 3 deletions tests/lib/lib_linux.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ function WSL-Install() {

function WSL-Launch([string]$id, [string]$command) {
docker exec -t $id /nix/nixos-wsl/entrypoint -c "$command"
if ($LASTEXITCODE -ne 0) {
throw "$command failed"
}
}

function WSL-Uninstall([string]$id) {
Expand Down

0 comments on commit b0aed50

Please sign in to comment.