From 3d42b462fabba0afe23675d1b5f778fbf1238b1d Mon Sep 17 00:00:00 2001 From: "Haoran Sun (Business Central)" Date: Thu, 30 Oct 2025 16:30:40 +0100 Subject: [PATCH 1/4] try to run Isolation for IntegrationTests --- build/projects/Apps (W1)/.AL-Go/RunTestsInBcContainer.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/projects/Apps (W1)/.AL-Go/RunTestsInBcContainer.ps1 b/build/projects/Apps (W1)/.AL-Go/RunTestsInBcContainer.ps1 index 139254859c..2e918a592c 100644 --- a/build/projects/Apps (W1)/.AL-Go/RunTestsInBcContainer.ps1 +++ b/build/projects/Apps (W1)/.AL-Go/RunTestsInBcContainer.ps1 @@ -10,8 +10,8 @@ $parameters["returnTrueIfAllPassed"] = $true $script = Join-Path $PSScriptRoot "../../../scripts/RunTestsInBcContainer.ps1" -Resolve $AllTestsPassed = (. $script -parameters $parameters -TestType $testType) -# TODO: For now only run disabled test isolation for unit tests -if ($testType -ne "UnitTest") { +# Uncategorized tests do not have RequiredTestIsolation set on the codeunits +if ($testType -eq "Uncategorized") { return $AllTestsPassed } From c6fc7f4534cb51664274064fa2aa4e3000ea8cef Mon Sep 17 00:00:00 2001 From: "Haoran Sun (Business Central)" Date: Thu, 30 Oct 2025 16:30:51 +0100 Subject: [PATCH 2/4] same for business foundation? --- .../.AL-Go/RunTestsInBcContainer.ps1 | 13 +++++++++++-- .../Business Foundation Tests/.AL-Go/settings.json | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/build/projects/Business Foundation Tests/.AL-Go/RunTestsInBcContainer.ps1 b/build/projects/Business Foundation Tests/.AL-Go/RunTestsInBcContainer.ps1 index afce4643bc..55c85d6a07 100644 --- a/build/projects/Business Foundation Tests/.AL-Go/RunTestsInBcContainer.ps1 +++ b/build/projects/Business Foundation Tests/.AL-Go/RunTestsInBcContainer.ps1 @@ -2,7 +2,16 @@ Param( [Hashtable]$parameters ) -$parameters["testType"] = "UnitTest" +Import-Module (Join-Path $PSScriptRoot "../../../scripts/EnlistmentHelperFunctions.psm1" -Resolve) +$testType = Get-ALGoSetting -Key "testType" +$parameters["returnTrueIfAllPassed"] = $true + +# run test codeunits with specified TestType $script = Join-Path $PSScriptRoot "../../../scripts/RunTestsInBcContainer.ps1" -Resolve -. $script -parameters $parameters \ No newline at end of file +$AllTestsPassed = (. $script -parameters $parameters -TestType $testType) + +# Run test codeunits with RequiredTestIsolation set to Disabled +$AllTestsPassedIsolation = (. $script -parameters $parameters -DisableTestIsolation -TestType $testType) + +return $AllTestsPassed -and $AllTestsPassedIsolation \ No newline at end of file diff --git a/build/projects/Business Foundation Tests/.AL-Go/settings.json b/build/projects/Business Foundation Tests/.AL-Go/settings.json index cc3595e344..b7fe2b4a4f 100644 --- a/build/projects/Business Foundation Tests/.AL-Go/settings.json +++ b/build/projects/Business Foundation Tests/.AL-Go/settings.json @@ -4,5 +4,6 @@ "testFolders": [ "../../../src/Business Foundation/Test" ], - "installOnlyReferencedApps": false + "installOnlyReferencedApps": false, + "testType": "UnitTest" } From e2a8d4413d01ff3c111139bb2bcd90b884a0f360 Mon Sep 17 00:00:00 2001 From: "Haoran Sun (Business Central)" Date: Fri, 31 Oct 2025 08:38:47 +0100 Subject: [PATCH 3/4] reset the parameters for RequiredTestIsolation = None --- build/scripts/RunTestsInBcContainer.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/scripts/RunTestsInBcContainer.ps1 b/build/scripts/RunTestsInBcContainer.ps1 index 44dba024b2..43bc946227 100644 --- a/build/scripts/RunTestsInBcContainer.ps1 +++ b/build/scripts/RunTestsInBcContainer.ps1 @@ -69,6 +69,11 @@ if ($DisableTestIsolation) $parameters["testRunnerCodeunitId"] = "130451" # Test Runner with disabled test isolation return Invoke-TestsWithReruns -parameters $parameters -maxReruns 1 # do not retry for Isolation Disabled tests, as they leave traces in the DB +} else +{ # this is neded to reset the parameters, in case of previous run with -DisableTestIsolation + Write-Host "Using RequiredTestIsolation: None" + $parameters["requiredTestIsolation"] = "None" # filtering on tests that don't require Test Isolation + $parameters["testRunnerCodeunitId"] = "130450" # Test Runner with Codeunit test isolation } return Invoke-TestsWithReruns -parameters $parameters From 8e0bb75d2d6d9230ea94c61f011b290942c8b432 Mon Sep 17 00:00:00 2001 From: "Haoran Sun (Business Central)" Date: Fri, 31 Oct 2025 12:36:10 +0100 Subject: [PATCH 4/4] try run tests in CZ --- build/projects/Apps (W1)/.AL-Go/settings.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/projects/Apps (W1)/.AL-Go/settings.json b/build/projects/Apps (W1)/.AL-Go/settings.json index d4642af59e..462ba90436 100644 --- a/build/projects/Apps (W1)/.AL-Go/settings.json +++ b/build/projects/Apps (W1)/.AL-Go/settings.json @@ -88,8 +88,7 @@ "CZ" ], "settings": { - "country": "cz", - "doNotRunTests": true + "country": "cz" } }, {