Skip to content

Commit fbecb06

Browse files
authored
Uptake requireTestIsolation to replace TestGroups.json (#4165)
#### Summary <!-- Provide a general summary of your changes --> ~Replace `System Application Tests (No Isolation)` project with the latest `RequireTestIsolation` property.~ Couldn't figure out how to run `Run-TestsInBcContainer` twice, it is failing build... Replace `TestGroups.json` with the latest `RequireTestIsolation` property. This is a follow up for #4137 . The change simplifies the build script, removing the need to maintain the `TestGroups.json`. #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes [AB#581153](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/581153)
1 parent 6a6dd18 commit fbecb06

File tree

2 files changed

+1
-40
lines changed

2 files changed

+1
-40
lines changed

build/scripts/RunTestsInBcContainer.ps1

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,44 +19,12 @@ function Get-DisabledTests
1919
return @($disabledTests)
2020
}
2121

22-
function Get-TestsInGroup {
23-
param(
24-
[Parameter(Mandatory = $true)]
25-
[string] $groupName
26-
)
27-
28-
$baseFolder = Get-BaseFolder
29-
30-
$groupFiles = Get-ChildItem -Path $baseFolder -Filter 'TestGroups.json' -Recurse -File
31-
32-
$testsInGroup = @()
33-
foreach($groupFile in $groupFiles)
34-
{
35-
$testsInGroup += Get-Content -Raw -Path $groupFile.FullName | ConvertFrom-Json | Where-Object { $_.group -eq $groupName }
36-
}
37-
38-
return $testsInGroup
39-
}
40-
4122
$disabledTests = @(Get-DisabledTests)
42-
$noIsolationTests = Get-TestsInGroup -groupName "No Test Isolation"
4323

4424
if ($DisableTestIsolation)
4525
{
26+
$parameters["requiredTestIsolation"] = "Disabled" # filtering on tests that require Disabled Test Isolation
4627
$parameters["testRunnerCodeunitId"] = "130451" # Test Runner with disabled test isolation
47-
48-
# When test isolation is disabled, only tests from the "No Test Isolation" group should be run
49-
$parameters["testCodeunitRange"] = @($noIsolationTests | ForEach-Object { $_.codeunitId }) -join "|"
50-
}
51-
else { # Test isolation is enabled
52-
# Manually disable the test codeunits, as they need to be run without test isolation
53-
$noIsolationTests | ForEach-Object {
54-
$disabledTests += @{
55-
"codeunitId" = $_.codeunitId
56-
"codeunitName" = $_.codeunitName
57-
"method" = "*"
58-
}
59-
}
6028
}
6129

6230
if ($disabledTests)

src/System Application/Test/TestGroups.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)