Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions tests/Installer.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
Describe 'Installer.ps1' {
BeforeAll {
# Define project name
$project = 'VeeamNotify'

# Create temp install dir
$installDir = New-Item -Path (Join-Path -Path $PSScriptRoot -ChildPath 'test-install') -Type Directory -Force

Expand Down Expand Up @@ -32,24 +29,20 @@ Describe 'Installer.ps1' {
# Define required files check
[scriptblock]$expectedFilesCheck = {
foreach ($file in $expectedFiles) {
Join-Path -Path "$installDir\$project" -ChildPath $file | Should -Exist
Join-Path -Path "$installDir" -ChildPath 'VeeamNotify' | Join-Path -ChildPath $file | Should -Exist
}
}

# Get releases
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/tigattack/$project/releases" -Method Get
}

It 'Install from specific version' -Skip:(-not $releases) {
It 'Install from specific version' {
# Run installer
& $installerPath -Version 'v1.0' @installerParams
& $installerPath -Version 'v1.1.1' @installerParams

# Check for expected files
Invoke-Command -ScriptBlock $expectedFilesCheck
}

It 'Install from latest release' -Skip:(-not $releases) {
It 'Install from latest release' {
# Run installer
& $installerPath -Latest Release @installerParams

Expand All @@ -59,7 +52,7 @@ Describe 'Installer.ps1' {

It 'Install from branch' {
# Run installer
& $installerPath -Branch dev @installerParams
& $installerPath -Branch main @installerParams

# Check for expected files
Invoke-Command -ScriptBlock $expectedFilesCheck
Expand Down
Loading