Skip to content

Commit

Permalink
Add more versions to test (#3469)
Browse files Browse the repository at this point in the history
Co-authored-by: freddydk <[email protected]>
  • Loading branch information
freddydk and freddydk committed Apr 23, 2024
1 parent f905714 commit f3af93a
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Tests/GetAndRunTests (latest).Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Param(
[string] $licenseFile,
[string] $buildlicenseFile
)

BeforeAll {
. (Join-Path $PSScriptRoot '_TestHelperFunctions.ps1')
$appPublisher = "Cronus Denmark A/S"
$appName = "Hello ÆØÅ"
$appVersion = "1.0.0.0"
$bcAppId = "cb99d78b-f9db-4a1e-822a-0c9c444535df"
$runTestsInVersion = 24
$bcContainerName = "bcserver"
}

AfterAll {
. (Join-Path $PSScriptRoot '_RemoveBcContainer.ps1')
}

Describe 'AppHandling' {

It 'Get/RunTests' {
$artifactUrl = Get-BCArtifactUrl -type Sandbox -version "$runTestsInVersion" -country "w1" -select Latest
New-BcContainer -accept_eula `
-accept_outdated `
-containerName $bcContainerName `
-artifactUrl $artifactUrl `
-auth NavUserPassword `
-Credential $credential `
-updateHosts `
-includeTestToolkit

$tests = (Get-TestsFromBCContainer -containerName $bcContainerName -credential $credential -extensionId "fa3e2564-a39e-417f-9be6-c0dbe3d94069") | Where-Object { $_.id -eq 134006 -or $_.id -eq 134007 }
$tests.Count | Should -be 2

$first = $true
$resultsFile = Join-Path $bcContainerHelperConfig.hostHelperFolder "Extensions\$bcContainerName\result.xml"
$tests | ForEach-Object {
Run-TestsInBcContainer -containerName $bcContainerName `
-credential $credential `
-XUnitResultFileName $resultsFile `
-AppendToXUnitResultFile:(!$first) `
-detailed `
-testCodeunit $_.Id `
-returnTrueIfAllPassed | Out-Null
$first = $false
}
$resultsFile | Should -Exist
}
}
50 changes: 50 additions & 0 deletions Tests/GetAndRunTests (version 22).Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Param(
[string] $licenseFile,
[string] $buildlicenseFile
)

BeforeAll {
. (Join-Path $PSScriptRoot '_TestHelperFunctions.ps1')
$appPublisher = "Cronus Denmark A/S"
$appName = "Hello ÆØÅ"
$appVersion = "1.0.0.0"
$bcAppId = "cb99d78b-f9db-4a1e-822a-0c9c444535df"
$runTestsInVersion = 22
$bcContainerName = "bcserver"
}

AfterAll {
. (Join-Path $PSScriptRoot '_RemoveBcContainer.ps1')
}

Describe 'AppHandling' {

It 'Get/RunTests' {
$artifactUrl = Get-BCArtifactUrl -type OnPrem -version "$runTestsInVersion" -country "w1" -select Latest
New-BcContainer -accept_eula `
-accept_outdated `
-containerName $bcContainerName `
-artifactUrl $artifactUrl `
-auth NavUserPassword `
-Credential $credential `
-updateHosts `
-includeTestToolkit

$tests = (Get-TestsFromBCContainer -containerName $bcContainerName -credential $credential -extensionId "fa3e2564-a39e-417f-9be6-c0dbe3d94069") | Where-Object { $_.id -eq 134006 -or $_.id -eq 134007 }
$tests.Count | Should -be 2

$first = $true
$resultsFile = Join-Path $bcContainerHelperConfig.hostHelperFolder "Extensions\$bcContainerName\result.xml"
$tests | ForEach-Object {
Run-TestsInBcContainer -containerName $bcContainerName `
-credential $credential `
-XUnitResultFileName $resultsFile `
-AppendToXUnitResultFile:(!$first) `
-detailed `
-testCodeunit $_.Id `
-returnTrueIfAllPassed | Out-Null
$first = $false
}
$resultsFile | Should -Exist
}
}
50 changes: 50 additions & 0 deletions Tests/GetAndRunTests (version 23).Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Param(
[string] $licenseFile,
[string] $buildlicenseFile
)

BeforeAll {
. (Join-Path $PSScriptRoot '_TestHelperFunctions.ps1')
$appPublisher = "Cronus Denmark A/S"
$appName = "Hello ÆØÅ"
$appVersion = "1.0.0.0"
$bcAppId = "cb99d78b-f9db-4a1e-822a-0c9c444535df"
$runTestsInVersion = 23
$bcContainerName = "bcserver"
}

AfterAll {
. (Join-Path $PSScriptRoot '_RemoveBcContainer.ps1')
}

Describe 'AppHandling' {

It 'Get/RunTests' {
$artifactUrl = Get-BCArtifactUrl -type OnPrem -version "$runTestsInVersion" -country "w1" -select Latest
New-BcContainer -accept_eula `
-accept_outdated `
-containerName $bcContainerName `
-artifactUrl $artifactUrl `
-auth NavUserPassword `
-Credential $credential `
-updateHosts `
-includeTestToolkit

$tests = (Get-TestsFromBCContainer -containerName $bcContainerName -credential $credential -extensionId "fa3e2564-a39e-417f-9be6-c0dbe3d94069") | Where-Object { $_.id -eq 134006 -or $_.id -eq 134007 }
$tests.Count | Should -be 2

$first = $true
$resultsFile = Join-Path $bcContainerHelperConfig.hostHelperFolder "Extensions\$bcContainerName\result.xml"
$tests | ForEach-Object {
Run-TestsInBcContainer -containerName $bcContainerName `
-credential $credential `
-XUnitResultFileName $resultsFile `
-AppendToXUnitResultFile:(!$first) `
-detailed `
-testCodeunit $_.Id `
-returnTrueIfAllPassed | Out-Null
$first = $false
}
$resultsFile | Should -Exist
}
}
50 changes: 50 additions & 0 deletions Tests/GetAndRunTests (version 24).Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Param(
[string] $licenseFile,
[string] $buildlicenseFile
)

BeforeAll {
. (Join-Path $PSScriptRoot '_TestHelperFunctions.ps1')
$appPublisher = "Cronus Denmark A/S"
$appName = "Hello ÆØÅ"
$appVersion = "1.0.0.0"
$bcAppId = "cb99d78b-f9db-4a1e-822a-0c9c444535df"
$runTestsInVersion = 24
$bcContainerName = "bcserver"
}

AfterAll {
. (Join-Path $PSScriptRoot '_RemoveBcContainer.ps1')
}

Describe 'AppHandling' {

It 'Get/RunTests' {
$artifactUrl = Get-BCArtifactUrl -type OnPrem -version "$runTestsInVersion" -country "w1" -select Latest
New-BcContainer -accept_eula `
-accept_outdated `
-containerName $bcContainerName `
-artifactUrl $artifactUrl `
-auth NavUserPassword `
-Credential $credential `
-updateHosts `
-includeTestToolkit

$tests = (Get-TestsFromBCContainer -containerName $bcContainerName -credential $credential -extensionId "fa3e2564-a39e-417f-9be6-c0dbe3d94069") | Where-Object { $_.id -eq 134006 -or $_.id -eq 134007 }
$tests.Count | Should -be 2

$first = $true
$resultsFile = Join-Path $bcContainerHelperConfig.hostHelperFolder "Extensions\$bcContainerName\result.xml"
$tests | ForEach-Object {
Run-TestsInBcContainer -containerName $bcContainerName `
-credential $credential `
-XUnitResultFileName $resultsFile `
-AppendToXUnitResultFile:(!$first) `
-detailed `
-testCodeunit $_.Id `
-returnTrueIfAllPassed | Out-Null
$first = $false
}
$resultsFile | Should -Exist
}
}

0 comments on commit f3af93a

Please sign in to comment.