Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure while doing "git commit" #4518

Open
1 task done
spacemx09 opened this issue Jun 28, 2024 · 0 comments
Open
1 task done

Test failure while doing "git commit" #4518

spacemx09 opened this issue Jun 28, 2024 · 0 comments

Comments

@spacemx09
Copy link

What happened?

React version: 18.2.0
React Native version: 0.72.3
Detox version: 20.20.3
Jest version: 29.7.0

We have the app developed in React Native with current focus only on Android platform. Detox tests run successfully, however, causes an error while doing a "git commit".

What was the expected behaviour?

The expected behaviour would be to be able to commit the changes with "git commit" command.

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 20.20.3
React Native version: 0.72.3
Has Fabric (React Native's new rendering system) enabled: (yes/no) no
Node version: 20.4.0
Test-runner (select one): jest

Detox logs

Detox logs
DetoxRuntimeError: Detox worker instance has not been installed in this context (DetoxPrimaryContext).

    HINT: If you are using Detox with Jest according to the latest guide, please report this issue on our GitHub tracker:
    https://github.com/wix/Detox/issues
    Otherwise, make sure you call detox.installWorker() beforehand.

       5 |
       6 |   beforeAll(async () => {
    >  7 |     await device.launchApp({
         |                  ^
       8 |       launchArgs: { detoxURLBlacklistRegex: TestConstants.TEST_DATA.URL_BLACKLIST_REGEX },
       9 |     });
      10 |   });

      at DetoxPrimaryContext.get [worker] (node_modules/detox/src/realms/DetoxContext.js:119:13)
      at node_modules/detox/src/realms/DetoxContext.js:72:36
      at getter (node_modules/funpermaproxy/lib/permaproxy.js:10:24)
      at Object.get (node_modules/funpermaproxy/lib/permaproxy.js:21:22)
      at Object.launchApp (e2e/CartView.test.js:7:18)
      at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:17)
      at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:17:9)
      at node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:7
      at Object.<anonymous> (node_modules/@babel/runtime/helpers/asyncToGenerator.js:14:12)

Device logs

Device logs
paste logs here!

More data, please!

====================== Related config files ===========================
e2e/jest.config.js

/** @type {import('@jest/types').Config.InitialOptions} /
module.exports = {
rootDir: '..',
testMatch: ['/e2e/**/
.test.js'],
testTimeout: 120000,
maxWorkers: 1,
globalSetup: 'detox/runners/jest/globalSetup',
globalTeardown: 'detox/runners/jest/globalTeardown',
reporters: ['detox/runners/jest/reporter'],
testEnvironment: 'detox/runners/jest/testEnvironment',
verbose: true,
};

.detoxrc.js

/** @type {Detox.DetoxConfig} /
module.exports = {
testRunner: {
args: {
'$0': 'jest',
config: 'e2e/jest.config.js'
},
jest: {
setupTimeout: 120000
}
},
apps: {
'ios.debug': {
type: 'ios.app',
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/YOUR_APP.app',
build: 'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build'
},
'ios.release': {
type: 'ios.app',
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/YOUR_APP.app',
build: 'xcodebuild -workspace ios/YOUR_APP.xcworkspace -scheme YOUR_APP -configuration Release -sdk iphonesimulator -derivedDataPath ios/build'
},
'android.debug': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/debug/app-name-debug.apk',
build: 'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',
testBinaryPath: 'android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk',
reversePorts: [
8081
]
},
'android.release': {
type: 'android.apk',
binaryPath: 'android/app/build/outputs/apk/release/app-release.apk',
build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release'
}
},
devices: {
simulator: {
type: 'ios.simulator',
device: {
type: 'iPhone 15'
}
},
attached: {
type: 'android.attached',
device: {
adbName: '.
'
}
},
emulator: {
type: 'android.emulator',
device: {
avdName: 'TC53_Emulator'
}
}
},
configurations: {
'ios.sim.debug': {
device: 'simulator',
app: 'ios.debug'
},
'ios.sim.release': {
device: 'simulator',
app: 'ios.release'
},
'android.att.debug': {
device: 'attached',
app: 'android.debug'
},
'android.att.release': {
device: 'attached',
app: 'android.release'
},
'android.emu.debug': {
device: 'emulator',
app: 'android.debug'
},
'android.emu.release': {
device: 'emulator',
app: 'android.release'
}
}
};

jest.setup.js

import mockRNCNetInfo from '@react-native-community/netinfo/jest/netinfo-mock.js';
jest.mock('@react-native-community/netinfo', () => mockRNCNetInfo);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant