@wdio/browserstack-service 9.36.0 → 9.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cleanup.js +2 -2
- package/build/cli/modules/testHubModule.d.ts +17 -1
- package/build/cli/skipReporter.d.ts +8 -1
- package/build/index.js +113 -43
- package/package.json +1 -1
|
@@ -19,8 +19,23 @@ export default class TestHubModule extends BaseModule {
|
|
|
19
19
|
* slot with a fresh instance for the next test — so it stays valid across tests.
|
|
20
20
|
* Flushed at the next test's first event (INIT_TEST / TEST PRE) or, for the worker's
|
|
21
21
|
* last test, from service.after() via flushPendingTestFinishEvent().
|
|
22
|
+
*
|
|
23
|
+
* SDK-7493: keyed by test uuid, NOT a single slot. wdio does not await `onTestSkip`, so a
|
|
24
|
+
* skip report runs detached and can interleave with a live test — its events land between
|
|
25
|
+
* the live test's own, on the same per-worker tracked-instance context. With one slot the
|
|
26
|
+
* second stash silently REPLACED the first (the old guard only flushed when the instance
|
|
27
|
+
* OBJECT differed, and an interleave can present the same object), so one test's
|
|
28
|
+
* TestRunFinished was never sent and TRA left it rendering "In Progress" until the ~60-min
|
|
29
|
+
* idle reap. A map cannot evict: every deferred finish is delivered, each under its own uuid.
|
|
30
|
+
*
|
|
31
|
+
* NOTE ON REDUNDANCY: SDK-7493's queue-and-drain (skipReporter) already stops a skip report
|
|
32
|
+
* running while a test is in flight, so on the normal path that collision can no longer be
|
|
33
|
+
* triggered and this map is not the primary fix. It is retained deliberately as
|
|
34
|
+
* defence-in-depth for a reporting path with a real incident history (SDK-7265, SDK-7493,
|
|
35
|
+
* ~60-min reaps): if any future caller reintroduces an interleave, the worst case degrades
|
|
36
|
+
* to a late send rather than a silently lost TestRunFinished.
|
|
22
37
|
*/
|
|
23
|
-
private
|
|
38
|
+
private pendingTestFinishes;
|
|
24
39
|
/**
|
|
25
40
|
* Create a new TestHubModule
|
|
26
41
|
*/
|
|
@@ -43,6 +58,7 @@ export default class TestHubModule extends BaseModule {
|
|
|
43
58
|
sendTestFrameworkEvent(args: Record<string, unknown>, stateOverride?: {
|
|
44
59
|
testFrameworkState: string;
|
|
45
60
|
testHookState: string;
|
|
61
|
+
uuid?: string;
|
|
46
62
|
}): Promise<boolean>;
|
|
47
63
|
/**
|
|
48
64
|
* Send test session event to the service
|
|
@@ -2,11 +2,18 @@ import type { Frameworks } from '@wdio/types';
|
|
|
2
2
|
import type TestFramework from './frameworks/testFramework.js';
|
|
3
3
|
export declare function markTestStarted(identifier: string): void;
|
|
4
4
|
export declare function drainSkipReports(): Promise<void>;
|
|
5
|
-
export declare function reportSkippedTest(framework: TestFramework, identifier: string, test: Frameworks.Test, suiteTitle?: string
|
|
5
|
+
export declare function reportSkippedTest(framework: TestFramework, identifier: string, test: Frameworks.Test, suiteTitle?: string, options?: {
|
|
6
|
+
immediate?: boolean;
|
|
7
|
+
}): Promise<void>;
|
|
6
8
|
/**
|
|
7
9
|
* Port of the legacy insights-handler skip propagation: when a BEFORE_ALL/BEFORE_EACH/
|
|
8
10
|
* AFTER_EACH hook fails (or skips), mocha silently drops the remaining tests in the
|
|
9
11
|
* suite — report each state-undefined test as skipped, recursing into nested describes.
|
|
12
|
+
*
|
|
13
|
+
* Reports IMMEDIATELY (SDK-7493): every caller of this — the failed-hook cascade in
|
|
14
|
+
* `afterHook` and the bail cascade in `afterTest` — is awaited by wdio, so these reports
|
|
15
|
+
* cannot interleave with a live test the way the un-awaited `onTestSkip` path could. They
|
|
16
|
+
* belong to the hook/test being reported, so they must not slide to end-of-run.
|
|
10
17
|
*/
|
|
11
18
|
export declare function reportSuiteSkipped(framework: TestFramework, suite: {
|
|
12
19
|
tests?: unknown[];
|