From ec1b8636a3f9db90c624d6f88ce5b9dbd231aaa6 Mon Sep 17 00:00:00 2001 From: Christopher Dwyer-Perkins Date: Mon, 20 Jan 2025 14:57:34 -0400 Subject: [PATCH] Started working on a fix onlys not being applied correctly when mixed with suites, groups, and tests --- .../src/lib/rooibos/RooibosSessionInfo.ts | 62 ++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/bsc-plugin/src/lib/rooibos/RooibosSessionInfo.ts b/bsc-plugin/src/lib/rooibos/RooibosSessionInfo.ts index d6d50142..52a79431 100644 --- a/bsc-plugin/src/lib/rooibos/RooibosSessionInfo.ts +++ b/bsc-plugin/src/lib/rooibos/RooibosSessionInfo.ts @@ -39,15 +39,13 @@ export class SessionInfo { this.addTestSuiteToPath(testSuite); if (testSuite.isSolo) { - this.hasSoloSuites = !this.hasSoloGroups && !this.hasSoloTests; + this.hasSoloSuites = true; } if (testSuite.hasSoloGroups) { - this.hasSoloGroups = !this.hasSoloTests; + this.hasSoloGroups = true; } if (testSuite.hasSoloTests) { this.hasSoloTests = true; - this.hasSoloGroups = false; - this.hasSoloSuites = false; } } else { this.allTestSuites.add(testSuite); @@ -72,17 +70,22 @@ export class SessionInfo { for (let testSuite of [...this.testSuites.values()]) { if (this.isExcludedByTag(testSuite, false)) { testSuite.isIncluded = false; - } else if (this.hasSoloTests && !testSuite.hasSoloTests) { - testSuite.isIncluded = false; - } else if (this.hasSoloSuites && !testSuite.isSolo) { - testSuite.isIncluded = false; - } else if (testSuite.isIgnored) { - testSuite.isIncluded = true; - this.ignoredTestNames.push(testSuite.name + ' [WHOLE SUITE]'); - this.ignoredCount++; + } + + if (!testSuite.isIgnored) { + if (this.hasSoloTests || this.hasSoloGroups || this.hasSoloSuites) { + if (testSuite.isSolo || testSuite.hasSoloGroups || testSuite.hasSoloTests) { + testSuite.isIncluded = true; + } + } } else { - testSuite.isIncluded = true; + if (!this.hasSoloTests && this.hasSoloGroups && this.hasSoloSuites) { + testSuite.isIncluded = true; + this.ignoredTestNames.push(testSuite.name + ' [WHOLE SUITE]'); + this.ignoredCount++; + } } + if (!testSuite.isIncluded) { continue; } @@ -92,13 +95,6 @@ export class SessionInfo { testGroup.isIgnored = true; } - //'GROUP ' + testGroup.name); - if (testGroup.isIgnored) { - this.ignoredCount += testGroup.ignoredTestCases.length; - this.ignoredTestNames.push(testGroup.name + ' [WHOLE GROUP]'); - testGroup.isIncluded = true; - } - if (testGroup.ignoredTestCases.length > 0) { this.ignoredTestNames.push(testGroup.name); this.ignoredCount += testGroup.ignoredTestCases.length; @@ -114,13 +110,18 @@ export class SessionInfo { } } } - if (this.isExcludedByTag(testGroup, true)) { - testGroup.isIncluded = false; - } else if (this.hasSoloTests && !testGroup.hasSoloTests) { - testGroup.isIncluded = false; - } else if (this.hasSoloGroups && !testGroup.isSolo) { - testGroup.isIncluded = false; + + if (!testGroup.isIgnored && !this.isExcludedByTag(testGroup, true)) { + if (testSuite.isSolo || testSuite.hasSoloGroups || testSuite.hasSoloTests) { + if (testGroup.isSolo || testGroup.hasSoloTests) { + testGroup.isIncluded = true; + } else { + testGroup.isIncluded = testSuite.isSolo; + } + } } else { + this.ignoredCount += testGroup.ignoredTestCases.length; + this.ignoredTestNames.push(testGroup.name + ' [WHOLE GROUP]'); testGroup.isIncluded = true; } @@ -129,6 +130,7 @@ export class SessionInfo { let testCases = [...testGroup.testCases.values()]; for (let testCase of testCases) { + testCase.isIncluded = false; if (testGroup.isIgnored) { testCase.isIgnored = true; } @@ -137,10 +139,14 @@ export class SessionInfo { testCase.isIncluded = false; } else if (testCase.isIgnored) { testCase.isIncluded = true; - } else if (this.hasSoloTests && !testCase.isSolo) { + } else if (testGroup.hasSoloTests && !testCase.isSolo) { testCase.isIncluded = false; } else { - testCase.isIncluded = testGroup.isIncluded || testCase.isSolo; + if (testGroup.hasSoloTests) { + testCase.isIncluded = testCase.isSolo; + } else { + testCase.isIncluded = testGroup.isIncluded || testCase.isSolo; + } } }