Skip to content

Commit

Permalink
test: fix retries
Browse files Browse the repository at this point in the history
  • Loading branch information
abdurrahman-ledger committed Jan 3, 2025
1 parent 04b15d8 commit 54d69b8
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"e2e:build": "pnpm detox build",
"e2e:ci": "zx ./scripts/e2e-ci.mjs",
"e2e:test": "export MOCK=1 && pnpm detox test",
"e2e:test:speculos": "export MOCK=0 && pnpm detox test --testMatch $(pwd)/e2e/specs/speculos/**/**/*.spec.ts --testTimeout=300000",
"e2e:test:speculos": "export MOCK=0 && pnpm detox test --testMatch \"$(pwd)/e2e/specs/speculos/**/*.spec.ts\" --testTimeout=300000",
"prebeta": "bundle install",
"debug:detox": "pnpm detox test -c ios.manual currencies.spec.ts",
"ios:staging": "ENVFILE=.env.ios.staging react-native run-ios --mode Staging",
Expand Down
42 changes: 40 additions & 2 deletions patches/[email protected]
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
diff --git a/local-cli/testCommand/TestRunnerCommand.js b/local-cli/testCommand/TestRunnerCommand.js
index afdc985d5a55396fbec0affd0927156348e656d0..1c71bce08e05768ec2f92245316154ecd0f3445f 100644
--- a/local-cli/testCommand/TestRunnerCommand.js
+++ b/local-cli/testCommand/TestRunnerCommand.js
@@ -35,6 +35,7 @@ class TestRunnerCommand {
this._startCommands = this._prepareStartCommands(commands, cliConfig);
this._envFwd = {};
this._terminating = false;
+ this._isRetry = false; // Track whether it's a retry

if (runnerConfig.forwardEnv) {
this._envFwd = this._buildEnvOverride(cliConfig, deviceConfig);
@@ -79,6 +80,7 @@ class TestRunnerCommand {
}

if (--runsLeft > 0) {
+ this._isRetry = true;
// @ts-ignore
detox.session.testSessionIndex++; // it is always the primary context, so we can update it

@@ -204,11 +206,16 @@ class TestRunnerCommand {
/* istanbul ignore next */
const { _: specs = [], '--': passthrough = [], $0, ...argv } = this._argv;
const { _: $0_, ...$0argv } = parser($0);
+
+ // Remove shard arguments for retries
+ const filteredArgv = this._isRetry
+ ? _.omit(argv, ['shard'])
+ : argv;

return [
...$0_,
...unparse($0argv),
- ...unparse(argv),
+ ...unparse(filteredArgv),
...unparse({ _: [...passthrough, ...specs] }),
].map(String);
}
diff --git a/src/devices/common/drivers/android/exec/ADB.js b/src/devices/common/drivers/android/exec/ADB.js
index 3600972facda80dd0b74d6aa6e425ecab1d205ba..0dd7a4b59cb0bc4d4189f32d819c244ea5f66ba1 100644
index 434b0d65c89f8086084c8714c98e446c9bf54c3a..3b83753d3a3bd5468b53c4b0555bd278e301dbab 100644
--- a/src/devices/common/drivers/android/exec/ADB.js
+++ b/src/devices/common/drivers/android/exec/ADB.js
@@ -8,7 +8,10 @@ const { escape } = require('../../../../../utils/pipeCommands');
Expand All @@ -14,7 +52,7 @@ index 3600972facda80dd0b74d6aa6e425ecab1d205ba..0dd7a4b59cb0bc4d4189f32d819c244e

class ADB {
constructor() {
@@ -109,7 +112,7 @@ class ADB {
@@ -113,7 +116,7 @@ class ADB {
const command = (apiLvl >= 23)
? `install -r -g -t ${apkPath}`
: `install -rg ${apkPath}`;
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 54d69b8

Please sign in to comment.