Skip to content

Commit 0baa7e9

Browse files
authored
Reenable tests after ODBC issue is fixed (#3982)
* Reenable tests after ODBC issue is fixed * Add tests for v25 and v26 * Keep some tests disabled as they are failing on a different issue 7fc18a4 * Run tests weekly
1 parent b83ba31 commit 0baa7e9

12 files changed

+114
-21
lines changed

.github/workflows/RunTests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
description: Commaseparated list of patterns to match against test names (default is * for all tests)
1212
required: false
1313
default: ''
14+
schedule:
15+
- cron: '0 0 * * 0' # Every Sunday at midnight UTC
1416

1517
permissions:
1618
contents: read

Tests/AppHandling (NAV).Tests.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ AfterAll {
1515
. (Join-Path $PSScriptRoot '_RemoveNavContainer.ps1')
1616
}
1717

18-
# Test is disabled because of an error with missing ODBC driver when importing .fob files (supported only on older versions of NAV)
19-
Describe 'AppHandling' -Skip {
18+
Describe 'AppHandling' {
2019

2120
It 'Add-GitToAlProjectFolder' {
2221
#TODO

Tests/Bacpac (MT).Tests.ps1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ AfterAll {
1212
. (Join-Path $PSScriptRoot '_RemoveBcContainer.ps1')
1313
}
1414

15-
# Test is disabled because of an error with missing ODBC driver when importing .fob files (supported only on older versions of NAV)
1615
Describe 'Bacpac' -Skip {
1716

1817
It 'Export-NavContainerDatabasesAsBacpac (multitenant)' {

Tests/Bacpac (NAV).Tests.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ AfterAll {
1212
. (Join-Path $PSScriptRoot '_RemoveNavContainer.ps1')
1313
}
1414

15-
# Test is disabled because of an error with missing ODBC driver when importing .fob files (supported only on older versions of NAV)
16-
Describe 'Bacpac' -Skip {
15+
Describe 'Bacpac' {
1716

1817
It 'Backup-NavContainerDatabases' {
1918

@@ -24,7 +23,7 @@ Describe 'Bacpac' -Skip {
2423
-bakFolder $bakFolder
2524

2625
$bakFile | Should -Exist
27-
26+
2827
New-NavContainer -accept_eula `
2928
-accept_outdated `
3029
-artifactUrl $navArtifactUrl `

Tests/GetAndRunTests (version 10).Tests.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ AfterAll {
1616
. (Join-Path $PSScriptRoot '_RemoveNavContainer.ps1')
1717
}
1818

19-
# Test is disabled because of an error with missing ODBC driver when importing .fob files (supported only on older versions of NAV)
20-
Describe 'AppHandling' -Skip{
19+
Describe 'AppHandling' {
2120

2221
It 'Get/RunTests' {
2322
$artifactUrl = Get-BCArtifactUrl -type OnPrem -version "$runTestsInVersion" -country "w1" -select Latest
@@ -39,7 +38,7 @@ Describe 'AppHandling' -Skip{
3938

4039
$tests = (Get-TestsFromNavContainer -containerName $navContainerName -credential $credential).Codeunits
4140
$tests.Count | Should -be 2
42-
41+
4342
$first = $true
4443
$resultsFile = Join-Path $bcContainerHelperConfig.hostHelperFolder "Extensions\$navContainerName\result.xml"
4544
$tests | % {

Tests/GetAndRunTests (version 11).Tests.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ AfterAll {
1616
. (Join-Path $PSScriptRoot '_RemoveNavContainer.ps1')
1717
}
1818

19-
# Test is disabled because of an error with missing ODBC driver when importing .fob files (supported only on older versions of NAV)
20-
Describe 'AppHandling' -Skip {
19+
Describe 'AppHandling' {
2120

2221
It 'Get/RunTests' {
2322
$artifactUrl = Get-BCArtifactUrl -type OnPrem -version "$runTestsInVersion" -country "w1" -select Latest
@@ -39,7 +38,7 @@ Describe 'AppHandling' -Skip {
3938

4039
$tests = (Get-TestsFromNavContainer -containerName $navContainerName -credential $credential).Codeunits
4140
$tests.Count | Should -be 2
42-
41+
4342
$first = $true
4443
$resultsFile = Join-Path $bcContainerHelperConfig.hostHelperFolder "Extensions\$navContainerName\result.xml"
4544
$tests | % {

Tests/GetAndRunTests (version 14).Tests.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ AfterAll {
1616
. (Join-Path $PSScriptRoot '_RemoveNavContainer.ps1')
1717
}
1818

19-
# Test is disabled because of an error with missing ODBC driver when importing .fob files (supported only on older versions of NAV)
20-
Describe 'AppHandling' -Skip {
19+
Describe 'AppHandling' {
2120

2221
It 'Get/RunTests' {
2322
$artifactUrl = Get-BCArtifactUrl -type OnPrem -version "$runTestsInVersion" -country "w1" -select Latest
@@ -38,7 +37,7 @@ Describe 'AppHandling' -Skip {
3837

3938
$tests = (Get-TestsFromNavContainer -containerName $navContainerName -credential $credential).Codeunits
4039
$tests.Count | Should -be 2
41-
40+
4241
$first = $true
4342
$resultsFile = Join-Path $bcContainerHelperConfig.hostHelperFolder "Extensions\$navContainerName\result.xml"
4443
$tests | % {
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Param(
2+
[string] $licenseFile,
3+
[string] $buildlicenseFile
4+
)
5+
6+
BeforeAll {
7+
. (Join-Path $PSScriptRoot '_TestHelperFunctions.ps1')
8+
$appPublisher = "Cronus Denmark A/S"
9+
$appName = "Hello ÆØÅ"
10+
$appVersion = "1.0.0.0"
11+
$bcAppId = "cb99d78b-f9db-4a1e-822a-0c9c444535df"
12+
$runTestsInVersion = 25
13+
$bcContainerName = "bcserver"
14+
}
15+
16+
AfterAll {
17+
. (Join-Path $PSScriptRoot '_RemoveBcContainer.ps1')
18+
}
19+
20+
Describe 'AppHandling' {
21+
22+
It 'Get/RunTests' {
23+
$artifactUrl = Get-BCArtifactUrl -type OnPrem -version "$runTestsInVersion" -country "w1" -select Latest
24+
New-BcContainer -accept_eula `
25+
-accept_outdated `
26+
-containerName $bcContainerName `
27+
-artifactUrl $artifactUrl `
28+
-auth NavUserPassword `
29+
-Credential $credential `
30+
-updateHosts `
31+
-includeTestToolkit
32+
33+
$tests = (Get-TestsFromBCContainer -containerName $bcContainerName -credential $credential -extensionId "fa3e2564-a39e-417f-9be6-c0dbe3d94069") | Where-Object { $_.id -eq 134006 -or $_.id -eq 134007 }
34+
$tests.Count | Should -be 2
35+
36+
$first = $true
37+
$resultsFile = Join-Path $bcContainerHelperConfig.hostHelperFolder "Extensions\$bcContainerName\result.xml"
38+
$tests | ForEach-Object {
39+
Run-TestsInBcContainer -containerName $bcContainerName `
40+
-credential $credential `
41+
-XUnitResultFileName $resultsFile `
42+
-AppendToXUnitResultFile:(!$first) `
43+
-detailed `
44+
-testCodeunit $_.Id `
45+
-returnTrueIfAllPassed | Out-Null
46+
$first = $false
47+
}
48+
$resultsFile | Should -Exist
49+
}
50+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Param(
2+
[string] $licenseFile,
3+
[string] $buildlicenseFile
4+
)
5+
6+
BeforeAll {
7+
. (Join-Path $PSScriptRoot '_TestHelperFunctions.ps1')
8+
$appPublisher = "Cronus Denmark A/S"
9+
$appName = "Hello ÆØÅ"
10+
$appVersion = "1.0.0.0"
11+
$bcAppId = "cb99d78b-f9db-4a1e-822a-0c9c444535df"
12+
$runTestsInVersion = 26
13+
$bcContainerName = "bcserver"
14+
}
15+
16+
AfterAll {
17+
. (Join-Path $PSScriptRoot '_RemoveBcContainer.ps1')
18+
}
19+
20+
Describe 'AppHandling' {
21+
22+
It 'Get/RunTests' {
23+
$artifactUrl = Get-BCArtifactUrl -type OnPrem -version "$runTestsInVersion" -country "w1" -select Latest
24+
New-BcContainer -accept_eula `
25+
-accept_outdated `
26+
-containerName $bcContainerName `
27+
-artifactUrl $artifactUrl `
28+
-auth NavUserPassword `
29+
-Credential $credential `
30+
-updateHosts `
31+
-includeTestToolkit
32+
33+
$tests = (Get-TestsFromBCContainer -containerName $bcContainerName -credential $credential -extensionId "fa3e2564-a39e-417f-9be6-c0dbe3d94069") | Where-Object { $_.id -eq 134006 -or $_.id -eq 134007 }
34+
$tests.Count | Should -be 2
35+
36+
$first = $true
37+
$resultsFile = Join-Path $bcContainerHelperConfig.hostHelperFolder "Extensions\$bcContainerName\result.xml"
38+
$tests | ForEach-Object {
39+
Run-TestsInBcContainer -containerName $bcContainerName `
40+
-credential $credential `
41+
-XUnitResultFileName $resultsFile `
42+
-AppendToXUnitResultFile:(!$first) `
43+
-detailed `
44+
-testCodeunit $_.Id `
45+
-returnTrueIfAllPassed | Out-Null
46+
$first = $false
47+
}
48+
$resultsFile | Should -Exist
49+
}
50+
}

Tests/GetAndRunTests (version 9).Tests.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ AfterAll {
1616
. (Join-Path $PSScriptRoot '_RemoveNavContainer.ps1')
1717
}
1818

19-
# Test is disabled because of an error with missing ODBC driver when importing .fob files (supported only on older versions of NAV)
20-
Describe 'AppHandling' -Skip {
19+
Describe 'AppHandling' {
2120

2221
It 'Get/RunTests' {
2322
$artifactUrl = Get-BCArtifactUrl -type OnPrem -version "$runTestsInVersion" -country "w1" -select Latest
@@ -39,7 +38,7 @@ Describe 'AppHandling' -Skip {
3938

4039
$tests = (Get-TestsFromNavContainer -containerName $navContainerName -credential $credential).Codeunits
4140
$tests.Count | Should -be 2
42-
41+
4342
$first = $true
4443
$resultsFile = Join-Path $bcContainerHelperConfig.hostHelperFolder "Extensions\$navContainerName\result.xml"
4544
$tests | % {

0 commit comments

Comments
 (0)