detox 20.0.11-prerelease.0 → 20.0.13-is-hittable-over-master.0
Sign up to get free protection for your applications and to get access to all the features.
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-prerelease.0-javadoc.jar → 20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0-javadoc.jar} +0 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0-javadoc.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0-javadoc.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0-javadoc.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0-javadoc.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-prerelease.0-sources.jar → 20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0-sources.jar} +0 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0-sources.jar.md5 +1 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0-sources.jar.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0-sources.jar.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0-sources.jar.sha512 +1 -0
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-prerelease.0.aar → 20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0.aar} +0 -0
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-prerelease.0.aar.md5 → 20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0.aar.md5} +0 -0
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-prerelease.0.aar.sha1 → 20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0.aar.sha1} +0 -0
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-prerelease.0.aar.sha256 → 20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0.aar.sha256} +0 -0
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-prerelease.0.aar.sha512 → 20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0.aar.sha512} +0 -0
- package/Detox-android/com/wix/detox/{20.0.11-prerelease.0/detox-20.0.11-prerelease.0.pom → 20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0.pom} +1 -1
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0.pom.md5 +1 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0.pom.sha1 +1 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0.pom.sha256 +1 -0
- package/Detox-android/com/wix/detox/20.0.13-is-hittable-over-master.0/detox-20.0.13-is-hittable-over-master.0.pom.sha512 +1 -0
- package/Detox-android/com/wix/detox/maven-metadata.xml +4 -4
- package/Detox-android/com/wix/detox/maven-metadata.xml.md5 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha1 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha256 +1 -1
- package/Detox-android/com/wix/detox/maven-metadata.xml.sha512 +1 -1
- package/Detox-ios-src.tbz +0 -0
- package/Detox-ios.tbz +0 -0
- package/index.d.ts +18 -2
- package/internals.d.ts +36 -14
- package/local-cli/cli.js +7 -5
- package/local-cli/init.js +1 -1
- package/local-cli/reset-lock-file.js +16 -0
- package/local-cli/test.test.js +58 -14
- package/local-cli/testCommand/TestRunnerCommand.js +10 -3
- package/package.json +2 -2
- package/runners/jest/reporters/DetoxReporter.js +22 -2
- package/runners/jest/testEnvironment/index.js +83 -82
- package/runners/jest/testEnvironment/listeners/DetoxCoreListener.js +9 -24
- package/runners/jest/testEnvironment/listeners/DetoxPlatformFilterListener.js +1 -1
- package/src/configuration/composeRunnerConfig.js +3 -1
- package/src/devices/allocation/drivers/android/emulator/AVDValidator.js +4 -4
- package/src/devices/allocation/drivers/android/emulator/EmulatorAllocDriver.js +1 -1
- package/src/ipc/IPCClient.js +9 -5
- package/src/ipc/IPCServer.js +17 -13
- package/src/ipc/SessionState.js +2 -4
- package/src/realms/DetoxContext.js +2 -2
- package/src/realms/DetoxInternalsFacade.js +1 -1
- package/src/realms/DetoxPrimaryContext.js +6 -8
- package/src/realms/DetoxSecondaryContext.js +2 -2
- package/src/symbols.js +2 -2
- package/src/utils/Timer.js +55 -38
- package/src/utils/errorUtils.js +20 -0
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-javadoc.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-javadoc.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-javadoc.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-javadoc.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-sources.jar.md5 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-sources.jar.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-sources.jar.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0-sources.jar.sha512 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0.pom.md5 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0.pom.sha1 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0.pom.sha256 +0 -1
- package/Detox-android/com/wix/detox/20.0.11-prerelease.0/detox-20.0.11-prerelease.0.pom.sha512 +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
46b8c5579a2192bb6b5dbcc74d00146a
|
@@ -0,0 +1 @@
|
|
1
|
+
18f17be0cde4bbe17ba47ace2dc814c705aed955
|
@@ -0,0 +1 @@
|
|
1
|
+
32e7dad08149fd68b710d1a52304849b9887761dcabb1a07aa85662abe51ad54
|
@@ -0,0 +1 @@
|
|
1
|
+
2d79955bcaef50813752fcd8b859cb404b1b98034c47af0b61d4e2d406712db8b4dc69d56f13dca18dcb54a4cd3297dbf9589440894d0254033ea32526c89f65
|
@@ -0,0 +1 @@
|
|
1
|
+
56ffcd4b159b75ad9a736c5ffeffc9d4
|
@@ -0,0 +1 @@
|
|
1
|
+
6301fdd10c90318cec1a4a6c6d4befe85e471b15
|
@@ -0,0 +1 @@
|
|
1
|
+
44973b24e24924c26fa6df03b9b9e39a5e59f6dd94c755426582873715332637
|
@@ -0,0 +1 @@
|
|
1
|
+
8d6633f64860a1e9765e8a9a3ff36bdc2b068c1f73166f0566d1699ad93b4d1e92c492e3c7c03840443baf8e9f5bff195cc54000132194dda2b793c8b02f9b92
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<modelVersion>4.0.0</modelVersion>
|
4
4
|
<groupId>com.wix</groupId>
|
5
5
|
<artifactId>detox</artifactId>
|
6
|
-
<version>20.0.
|
6
|
+
<version>20.0.13-is-hittable-over-master.0</version>
|
7
7
|
<packaging>aar</packaging>
|
8
8
|
<name>Detox</name>
|
9
9
|
<description>Gray box end-to-end testing and automation library for mobile apps</description>
|
@@ -0,0 +1 @@
|
|
1
|
+
c12e872ea8fcc3b9d444224811c1c471
|
@@ -0,0 +1 @@
|
|
1
|
+
1debc119cc2996b93ec9beb30a8f591849ca4195
|
@@ -0,0 +1 @@
|
|
1
|
+
e9d4e60ac7b43c06e34b18c37175f77da03d6739c9ead58d1ba647c6a71f93a7
|
@@ -0,0 +1 @@
|
|
1
|
+
4663d530e10cab54de779e5730c59cec7345b7a4f99e0d04f16f71b59f2e98a0f40a025c101b0c389dfaa863f0de249492e9e914ba964667f14572d34d48d1d3
|
@@ -3,11 +3,11 @@
|
|
3
3
|
<groupId>com.wix</groupId>
|
4
4
|
<artifactId>detox</artifactId>
|
5
5
|
<versioning>
|
6
|
-
<latest>20.0.
|
7
|
-
<release>20.0.
|
6
|
+
<latest>20.0.13-is-hittable-over-master.0</latest>
|
7
|
+
<release>20.0.13-is-hittable-over-master.0</release>
|
8
8
|
<versions>
|
9
|
-
<version>20.0.
|
9
|
+
<version>20.0.13-is-hittable-over-master.0</version>
|
10
10
|
</versions>
|
11
|
-
<lastUpdated>
|
11
|
+
<lastUpdated>20221103130525</lastUpdated>
|
12
12
|
</versioning>
|
13
13
|
</metadata>
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
a3c33c552dbf92dc59b9e463233a84d5
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
afe6331be318d4580debfc0895acec66a037f0c6
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
572d1a034b59858231a34c4e05bfd5c6f910236573db97c33e582c6404dc516a
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
6e6785e4ad075200449611e8aa0bbe4dfa904808797d20f5dc2dfe599ee480226fc53f6242a6d85cf6922a0efdcbff28cd7b1b4b1515c4d87a41918978e3785c
|
package/Detox-ios-src.tbz
CHANGED
Binary file
|
package/Detox-ios.tbz
CHANGED
Binary file
|
package/index.d.ts
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
import { BunyanDebugStreamOptions } from 'bunyan-debug-stream';
|
12
12
|
|
13
13
|
declare global {
|
14
|
+
const detox: Detox.DetoxExportWrapper;
|
14
15
|
const device: Detox.DetoxExportWrapper['device'];
|
15
16
|
const element: Detox.DetoxExportWrapper['element'];
|
16
17
|
const waitFor: Detox.DetoxExportWrapper['waitFor'];
|
@@ -20,6 +21,7 @@ declare global {
|
|
20
21
|
|
21
22
|
namespace NodeJS {
|
22
23
|
interface Global {
|
24
|
+
detox: Detox.DetoxExportWrapper;
|
23
25
|
device: Detox.DetoxExportWrapper['device'];
|
24
26
|
element: Detox.DetoxExportWrapper['element'];
|
25
27
|
waitFor: Detox.DetoxExportWrapper['waitFor'];
|
@@ -137,9 +139,13 @@ declare global {
|
|
137
139
|
*/
|
138
140
|
jest?: {
|
139
141
|
/**
|
140
|
-
*
|
142
|
+
* Environment setup timeout
|
141
143
|
*/
|
142
|
-
|
144
|
+
setupTimeout?: number | undefined;
|
145
|
+
/**
|
146
|
+
* Environment teardown timeout
|
147
|
+
*/
|
148
|
+
teardownTimeout?: number | undefined;
|
143
149
|
/**
|
144
150
|
* Insist on CLI-based retry mechanism even when the failed tests have been handled
|
145
151
|
* by jest.retryTimes(n) mechanism from Jest Circus.
|
@@ -152,6 +158,16 @@ declare global {
|
|
152
158
|
* Retries count. Zero means a single attempt to run tests.
|
153
159
|
*/
|
154
160
|
retries?: number;
|
161
|
+
/**
|
162
|
+
* When true, tells Detox CLI to cancel next retrying if it gets
|
163
|
+
* at least one report about a permanent test suite failure.
|
164
|
+
* Has no effect, if {@link DetoxTestRunnerConfig#retries} is
|
165
|
+
* undefined or set to zero.
|
166
|
+
*
|
167
|
+
* @default false
|
168
|
+
* @see {DetoxInternals.DetoxTestFileReport#isPermanentFailure}
|
169
|
+
*/
|
170
|
+
bail?: boolean;
|
155
171
|
/**
|
156
172
|
* Custom handler to process --inspect-brk CLI flag.
|
157
173
|
* Use it when you rely on another test runner than Jest.
|
package/internals.d.ts
CHANGED
@@ -54,14 +54,13 @@ declare global {
|
|
54
54
|
onRunFinish(event: unknown): Promise<void>;
|
55
55
|
|
56
56
|
/**
|
57
|
-
* Reports to Detox CLI about
|
57
|
+
* Reports to Detox CLI about passed and failed test files.
|
58
|
+
* The failed test files might be re-run again if
|
58
59
|
* {@link Detox.DetoxTestRunnerConfig#retries} is set to a non-zero.
|
59
60
|
*
|
60
|
-
* @param
|
61
|
-
* @param permanent whether the failure is permanent, and the tests
|
62
|
-
* should not be re-run.
|
61
|
+
* @param testResults - reports about test files
|
63
62
|
*/
|
64
|
-
|
63
|
+
reportTestResults(testResults: DetoxTestFileReport[]): Promise<void>;
|
65
64
|
// endregion
|
66
65
|
|
67
66
|
readonly config: RuntimeConfig;
|
@@ -92,7 +91,7 @@ declare global {
|
|
92
91
|
testRunnerArgv: Record<string, unknown>;
|
93
92
|
override: Partial<Detox.DetoxConfig>;
|
94
93
|
/** @inheritDoc */
|
95
|
-
global: NodeJS.Global;
|
94
|
+
global: NodeJS.Global | {};
|
96
95
|
/**
|
97
96
|
* Worker ID. Used to distinguish allocated workers in parallel test execution environment.
|
98
97
|
*
|
@@ -111,7 +110,7 @@ declare global {
|
|
111
110
|
* {@link DetoxInternals.Facade#setup} might override {@link Console} methods
|
112
111
|
* to integrate it with Detox loggeing subsystem.
|
113
112
|
*/
|
114
|
-
global: NodeJS.Global;
|
113
|
+
global: NodeJS.Global | {};
|
115
114
|
/**
|
116
115
|
* Worker ID. Used to distinguish allocated workers in parallel test execution environment.
|
117
116
|
*
|
@@ -120,25 +119,48 @@ declare global {
|
|
120
119
|
workerId: string;
|
121
120
|
};
|
122
121
|
|
122
|
+
type DetoxTestFileReport = {
|
123
|
+
/**
|
124
|
+
* Global or relative path to the failed test file.
|
125
|
+
*/
|
126
|
+
testFilePath: string;
|
127
|
+
/**
|
128
|
+
* Whether the test passed or not.
|
129
|
+
*/
|
130
|
+
success: boolean;
|
131
|
+
/**
|
132
|
+
* Top-level error if the entire test file failed.
|
133
|
+
*/
|
134
|
+
testExecError?: { name?: string; message: string; stack?: string; };
|
135
|
+
/**
|
136
|
+
* If the test failed, it should tell whether the failure is permanent.
|
137
|
+
* Permanent failure means that the test file should not be re-run.
|
138
|
+
*
|
139
|
+
* @default false
|
140
|
+
* @see {Detox.DetoxTestRunnerConfig#retries}
|
141
|
+
*/
|
142
|
+
isPermanentFailure?: boolean;
|
143
|
+
};
|
144
|
+
|
123
145
|
type SessionState = Readonly<{
|
124
146
|
/**
|
125
147
|
* Randomly generated ID for the entire Detox test session, including retries.
|
126
148
|
*/
|
127
149
|
id: string;
|
128
150
|
/**
|
129
|
-
*
|
151
|
+
* Results of test file executions. Primarily used for Detox CLI retry mechanism.
|
130
152
|
*/
|
131
|
-
|
132
|
-
/**
|
133
|
-
* Failed test file paths suggested to retry via Detox CLI mechanism.
|
134
|
-
*/
|
135
|
-
testFilesToRetry: string[];
|
153
|
+
testResults: DetoxTestFileReport[];
|
136
154
|
/**
|
137
155
|
* Retry index of the test session: 0..retriesCount.
|
138
156
|
*/
|
139
157
|
testSessionIndex: number;
|
140
158
|
/**
|
141
|
-
*
|
159
|
+
* Count of Detox contexts with a worker installed.
|
160
|
+
* Oversimplified, it reflects the count of allocated devices in the current test session.
|
161
|
+
*
|
162
|
+
* @see {Facade#init}
|
163
|
+
* @see {Facade#installWorker}
|
142
164
|
*/
|
143
165
|
workersCount: number;
|
144
166
|
}>;
|
package/local-cli/cli.js
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
+
const fs = require('fs');
|
3
|
+
|
4
|
+
const _ = require('lodash');
|
2
5
|
const yargs = require('yargs');
|
3
6
|
|
7
|
+
const logger = require('../internals').log.child({ cat: 'cli' });
|
4
8
|
const DetoxError = require('../src/errors/DetoxError');
|
5
|
-
const logger = require('../src/utils/logger').child({ cat: 'cli' });
|
6
9
|
|
7
10
|
yargs
|
8
11
|
.scriptName('detox')
|
@@ -25,12 +28,11 @@ yargs
|
|
25
28
|
.wrap(yargs.terminalWidth() * 0.9)
|
26
29
|
.fail(function(msg, err, program) {
|
27
30
|
if (err) {
|
28
|
-
|
29
|
-
for (const line of lines) {
|
30
|
-
logger.error(line);
|
31
|
-
}
|
31
|
+
logger.error(DetoxError.format(err));
|
32
32
|
// eslint-disable-next-line no-console
|
33
33
|
console.error('');
|
34
|
+
// @ts-ignore
|
35
|
+
_.attempt(() => fs.unlinkSync(logger.file));
|
34
36
|
// eslint-disable-next-line no-process-exit
|
35
37
|
process.exit(1);
|
36
38
|
}
|
package/local-cli/init.js
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
const { log } = require('../internals');
|
2
|
+
const DeviceRegistry = require('../src/devices/DeviceRegistry');
|
3
|
+
const { getDetoxLibraryRootPath } = require('../src/utils/environment');
|
4
|
+
|
5
|
+
|
6
|
+
module.exports.command = 'reset-lock-file';
|
7
|
+
module.exports.desc = 'Resets all Detox lock files. Useful when you need to run multiple `detox test` commands in parallel with --keepLockFile.';
|
8
|
+
|
9
|
+
module.exports.handler = async function resetLockFile() {
|
10
|
+
await Promise.all([
|
11
|
+
DeviceRegistry.forIOS().reset(),
|
12
|
+
DeviceRegistry.forAndroid().reset(),
|
13
|
+
]);
|
14
|
+
|
15
|
+
log.info(`Cleaned lock files from: ${getDetoxLibraryRootPath()}`);
|
16
|
+
};
|
package/local-cli/test.test.js
CHANGED
@@ -8,6 +8,8 @@ jest.mock('../src/devices/DeviceRegistry');
|
|
8
8
|
jest.mock('../src/devices/allocation/drivers/android/genycloud/GenyDeviceRegistryFactory');
|
9
9
|
jest.mock('./utils/jestInternals');
|
10
10
|
|
11
|
+
const cp = require('child_process');
|
12
|
+
const cpSpawn = cp.spawn;
|
11
13
|
const os = require('os');
|
12
14
|
const path = require('path');
|
13
15
|
|
@@ -28,6 +30,10 @@ describe('CLI', () => {
|
|
28
30
|
let GenyDeviceRegistryFactory;
|
29
31
|
let jestInternals;
|
30
32
|
|
33
|
+
afterEach(() => {
|
34
|
+
cp.spawn = cpSpawn;
|
35
|
+
});
|
36
|
+
|
31
37
|
beforeEach(() => {
|
32
38
|
_cliCallDump = undefined;
|
33
39
|
_env = process.env;
|
@@ -139,11 +145,28 @@ describe('CLI', () => {
|
|
139
145
|
});
|
140
146
|
|
141
147
|
test.each([['-R'], ['--retries']])('%s <value> should execute unsuccessful run N extra times', async (__retries) => {
|
148
|
+
function toTestResult(testFilePath) {
|
149
|
+
return {
|
150
|
+
testFilePath,
|
151
|
+
success: false,
|
152
|
+
isPermanentFailure: false,
|
153
|
+
};
|
154
|
+
}
|
155
|
+
|
142
156
|
const context = require('../internals');
|
143
|
-
|
144
|
-
|
145
|
-
.mockImplementationOnce(() =>
|
146
|
-
|
157
|
+
|
158
|
+
jest.spyOn(cp, 'spawn')
|
159
|
+
.mockImplementationOnce((...args) => {
|
160
|
+
context.session.testResults = ['e2e/failing1.test.js', 'e2e/failing2.test.js'].map(toTestResult);
|
161
|
+
return cpSpawn(...args);
|
162
|
+
})
|
163
|
+
.mockImplementationOnce((...args) => {
|
164
|
+
context.session.testResults = ['e2e/failing2.test.js'].map(toTestResult);
|
165
|
+
return cpSpawn(...args);
|
166
|
+
})
|
167
|
+
.mockImplementationOnce((...args) => {
|
168
|
+
return cpSpawn(...args);
|
169
|
+
});
|
147
170
|
|
148
171
|
mockExitCode(1);
|
149
172
|
|
@@ -154,18 +177,35 @@ describe('CLI', () => {
|
|
154
177
|
expect(cliCall(2).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json', 'e2e/failing2.test.js']);
|
155
178
|
});
|
156
179
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
180
|
+
describe('when there are permanently failed tests', () => {
|
181
|
+
beforeEach(() => {
|
182
|
+
const context = require('../internals');
|
183
|
+
context.session.testResults = ['e2e/failing1.test.js', 'e2e/failing2.test.js'].map((testFilePath, index) => ({
|
184
|
+
testFilePath,
|
185
|
+
success: false,
|
186
|
+
isPermanentFailure: index > 0,
|
187
|
+
}));
|
161
188
|
|
162
|
-
|
189
|
+
mockExitCode(1);
|
190
|
+
});
|
163
191
|
|
164
|
-
|
192
|
+
test.each([['-R'], ['--retries']])('%s <value> should not bail by default', async (__retries) => {
|
193
|
+
await run(__retries, 2).catch(_.noop);
|
165
194
|
|
166
|
-
|
167
|
-
|
168
|
-
|
195
|
+
expect(cliCall(0).env).not.toHaveProperty('DETOX_RERUN_INDEX');
|
196
|
+
expect(cliCall(0).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json']);
|
197
|
+
expect(cliCall(1).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json', 'e2e/failing1.test.js']);
|
198
|
+
// note that it does not take the permanently failed test
|
199
|
+
});
|
200
|
+
|
201
|
+
test.each([['-R'], ['--retries']])('%s <value> should bail if configured', async (__retries) => {
|
202
|
+
detoxConfig.testRunner.bail = true;
|
203
|
+
await run(__retries, 2).catch(_.noop);
|
204
|
+
|
205
|
+
expect(cliCall(0).env).not.toHaveProperty('DETOX_RERUN_INDEX');
|
206
|
+
expect(cliCall(0).argv).toEqual([expect.stringMatching(/executable$/), '--config', 'e2e/config.json']);
|
207
|
+
expect(cliCall(1)).toBe(null);
|
208
|
+
});
|
169
209
|
});
|
170
210
|
|
171
211
|
test.each([['-R'], ['--retries']])('%s <value> should not restart test runner if there are no failing tests paths', async (__retries) => {
|
@@ -178,7 +218,11 @@ describe('CLI', () => {
|
|
178
218
|
|
179
219
|
test.each([['-R'], ['--retries']])('%s <value> should retain -- <...explicitPassthroughArgs>', async (__retries) => {
|
180
220
|
const context = require('../internals');
|
181
|
-
context.session.
|
221
|
+
context.session.testResults = [{
|
222
|
+
testFilePath: 'tests/failing.test.js',
|
223
|
+
success: false,
|
224
|
+
isPermanentFailure: false,
|
225
|
+
}];
|
182
226
|
|
183
227
|
mockExitCode(1);
|
184
228
|
|
@@ -99,13 +99,20 @@ class TestRunnerCommand {
|
|
99
99
|
} catch (e) {
|
100
100
|
launchError = e;
|
101
101
|
|
102
|
-
const
|
103
|
-
|
102
|
+
const failedTestFiles = detox.session.testResults.filter(r => !r.success);
|
103
|
+
|
104
|
+
const { bail } = detox.config.testRunner;
|
105
|
+
if (bail && failedTestFiles.some(r => r.isPermanentFailure)) {
|
106
|
+
throw e;
|
107
|
+
}
|
108
|
+
|
109
|
+
const testFilesToRetry = failedTestFiles.filter(r => !r.isPermanentFailure).map(r => r.testFilePath);
|
110
|
+
if (_.isEmpty(testFilesToRetry)) {
|
104
111
|
throw e;
|
105
112
|
}
|
106
113
|
|
107
114
|
if (--runsLeft > 0) {
|
108
|
-
this._argv._ = testFilesToRetry
|
115
|
+
this._argv._ = testFilesToRetry;
|
109
116
|
// @ts-ignore
|
110
117
|
detox.session.testSessionIndex++; // it is always a primary context, so we can update it
|
111
118
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "detox",
|
3
3
|
"description": "E2E tests and automation for mobile",
|
4
|
-
"version": "20.0.
|
4
|
+
"version": "20.0.13-is-hittable-over-master.0",
|
5
5
|
"bin": {
|
6
6
|
"detox": "local-cli/cli.js"
|
7
7
|
},
|
@@ -184,5 +184,5 @@
|
|
184
184
|
}
|
185
185
|
}
|
186
186
|
},
|
187
|
-
"gitHead": "
|
187
|
+
"gitHead": "210fce372789081e9b91b217afd693519bf30c66"
|
188
188
|
}
|
@@ -1,5 +1,25 @@
|
|
1
|
-
const
|
1
|
+
const resolveFrom = require('resolve-from');
|
2
|
+
/** @type {typeof import('@jest/reporters').VerboseReporter} */
|
3
|
+
const JestVerboseReporter = require(resolveFrom(process.cwd(), '@jest/reporters')).VerboseReporter;
|
2
4
|
|
3
|
-
|
5
|
+
const { config, reportTestResults } = require('../../../internals');
|
6
|
+
|
7
|
+
class DetoxReporter extends JestVerboseReporter {
|
8
|
+
/**
|
9
|
+
* @param {import('@jest/test-result').TestResult} testResult
|
10
|
+
*/
|
11
|
+
async onTestResult(test, testResult, results) {
|
12
|
+
await super.onTestResult(test, testResult, results);
|
13
|
+
|
14
|
+
await reportTestResults([{
|
15
|
+
success: !testResult.failureMessage,
|
16
|
+
testFilePath: testResult.testFilePath,
|
17
|
+
testExecError: testResult.testExecError,
|
18
|
+
isPermanentFailure: config.testRunner.jest.retryAfterCircusRetries
|
19
|
+
? false
|
20
|
+
: testResult.testResults.some(r => r.invocations > 1)
|
21
|
+
}]);
|
22
|
+
}
|
23
|
+
}
|
4
24
|
|
5
25
|
module.exports = DetoxReporter;
|