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

Default reporter doesn't work when no tests are run #4521

Open
1 of 2 tasks
pneraasen opened this issue Jul 3, 2024 · 0 comments
Open
1 of 2 tasks

Default reporter doesn't work when no tests are run #4521

pneraasen opened this issue Jul 3, 2024 · 0 comments

Comments

@pneraasen
Copy link

pneraasen commented Jul 3, 2024

What happened?

When the passWithNoTests flag is true, and I'm using the default detox reporter, the process exits with code 0 but the reporter throws an error. When I remove the default reporter, the process works fine but I'm obviously missing report data.

What was the expected behaviour?

Both the jest process and the detox reporter should exit successfully

Was it tested on latest Detox?

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

Did your test throw out a timeout?

Help us reproduce this issue!

  1. in your config, add the passWithNoTests: true property
  2. run tests, providing a path to tests that won't exist: detox test -c ios e2e/asdf
  3. notice the jest process successfully exits with code 0, no tests found, but the detox reporter throws an error
  4. remove 'detox/runners/jest/reporter' from reporters in the config, run the same command
  5. notice the jest process successfully exits with code 0, no tests found

In what environment did this happen?

Detox version: 20.23.0
React Native version: 0.71.17
Has Fabric (React Native's new rendering system) enabled: no
Node version: 18.20.2
Device model: iphone 15 pro
iOS version: 17.4
macOS version: sonoma 14.5
Xcode version: 15.4
Test-runner (select one): jest

Detox logs

Detox logs
No tests found, exiting with code 0
10:53:18.807 detox[47507] i DetoxInternalError: Detected an attempt to report failed tests using a non-initialized context.
Please report this issue on our GitHub tracker:
https://github.com/wix/Detox/issues
    at [reportTestResults] (/Users/path/to/my/repo/node_modules/detox/src/realms/DetoxSecondaryContext.js:32:13)
    at DetoxIPCReporter.onRunComplete (/Users/path/to/my/repo/node_modules/detox/runners/jest/reporters/DetoxIPCReporter.js:14:11)
    at DetoxReporter._dispatch (/Users/path/to/my/repo/node_modules/detox/runners/jest/reporters/DetoxReporterDispatcher.js:134:50)
    at DetoxReporter._doRunComplete (/Users/path/to/my/repo/node_modules/detox/runners/jest/reporters/DetoxReporterDispatcher.js:115:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ReporterDispatcher.onRunComplete (/Users/path/to/my/repo/node_modules/@jest/core/build/ReporterDispatcher.js:71:9)
    at async TestScheduler.scheduleTests (/Users/path/to/my/repo/node_modules/@jest/core/build/TestScheduler.js:306:5)
    at async runJest (/Users/path/to/my/repo/node_modules/@jest/core/build/runJest.js:367:19)
    at async _run10000 (/Users/path/to/my/repo/node_modules/@jest/core/build/cli/index.js:343:7)
    at async runCLI (/Users/path/to/my/repo/node_modules/@jest/core/build/cli/index.js:198:3)
10:53:18.811 detox[47506] E Command failed with exit code = 1:
jest --config e2e/config.js e2e/asdf

Device logs

Device logs
paste your device.log here!

More data, please!

my config, with paths changed to path/to/my/repo:

{
“configs”: [
{
“automock”: false,
“cache”: true,
“cacheDirectory”: “/private/var/folders/gq/bc8p6g415rnbq0sngf_lhfhm0000gp/T/jest_dy”,
“clearMocks”: false,
“collectCoverageFrom”: [],
“coverageDirectory”: “/Users/path/to/my/repo/e2e/coverage”,
“coveragePathIgnorePatterns”: [
“/node_modules/”
],
“cwd”: “/Users/path/to/my/repo”,
“detectLeaks”: false,
“detectOpenHandles”: false,
“errorOnDeprecated”: false,
“extensionsToTreatAsEsm”: [],
“fakeTimers”: {
“enableGlobally”: false
},
“forceCoverageMatch”: [],
“globalSetup”: “/Users/path/to/my/repo/node_modules/detox/runners/jest/globalSetup.js”,
“globalTeardown”: “/Users/path/to/my/repo/node_modules/detox/runners/jest/globalTeardown.js”,
“globals”: {},
“haste”: {
“computeSha1”: false,
“enableSymlinks”: false,
“forceNodeFilesystemAPI”: true,
“throwOnModuleCollision”: false
},
“id”: “92ab00f4a955118e074b398838088098",
“injectGlobals”: true,
“moduleDirectories”: [
“node_modules”
],
“moduleFileExtensions”: [
“js”,
“mjs”,
“cjs”,
“jsx”,
“ts”,
“tsx”,
“json”,
“node”
],
“moduleNameMapper”: [],
“modulePathIgnorePatterns”: [],
“openHandlesTimeout”: 1000,
“prettierPath”: “prettier”,
“resetMocks”: false,
“resetModules”: false,
“restoreMocks”: false,
“rootDir”: “/Users/path/to/my/repo/e2e”,
“roots”: [
“/Users/path/to/my/repo/e2e”
],
“runner”: “/Users/path/to/my/repo/node_modules/jest-runner-groups/index.js”,
“sandboxInjectedGlobals”: [],
“setupFiles”: [],
“setupFilesAfterEnv”: [
“/Users/path/to/my/repo/e2e/utils/setup.ts”
],
“skipFilter”: false,
“slowTestThreshold”: 5,
“snapshotFormat”: {
“escapeString”: false,
“printBasicPrototype”: false
},
“snapshotSerializers”: [],
“testEnvironment”: “/Users/path/to/my/repo/e2e/utils/circusEnvironments/functional_local.ts”,
“testEnvironmentOptions”: {},
“testLocationInResults”: false,
“testMatch”: [],
“testPathIgnorePatterns”: [
“/node_modules/”
],
“testRegex”: [
“\.e2e\.ts$”
],
“testRunner”: “/Users/path/to/my/repo/node_modules/jest-circus/runner.js”,
“transform”: [
[
“^. \.[jt]sx?$“,
“/Users/path/to/my/repo/node_modules/@jest/core/node_modules/babel-jest/build/index.js”,
{
“configFile”: “./babel.config.js”
}
]
],
“transformIgnorePatterns”: [
“/node_modules/“,
“\.pnp\.[^\\/] $”
],
“watchPathIgnorePatterns”: []
}
],
“globalConfig”: {
“bail”: 0,
“changedFilesWithAncestor”: false,
“ci”: false,
“collectCoverage”: false,
“collectCoverageFrom”: [],
“coverageDirectory”: “/Users/path/to/my/repo/e2e/coverage”,
“coverageProvider”: “babel”,
“coverageReporters”: [
“json”,
“text”,
“lcov”,
“clover”
],
“detectLeaks”: false,
“detectOpenHandles”: false,
“errorOnDeprecated”: false,
“expand”: false,
“findRelatedTests”: false,
“forceExit”: false,
“globalSetup”: “/Users/path/to/my/repo/node_modules/detox/runners/jest/globalSetup.js”,
“globalTeardown”: “/Users/path/to/my/repo/node_modules/detox/runners/jest/globalTeardown.js”,
“json”: false,
“lastCommit”: false,
“listTests”: false,
“logHeapUsage”: false,
“maxConcurrency”: 5,
“maxWorkers”: 1,
“noStackTrace”: false,
“nonFlagArgs”: [
“e2e/asdf”
],
“notify”: false,
“notifyMode”: “failure-change”,
“onlyChanged”: false,
“onlyFailures”: false,
“openHandlesTimeout”: 1000,
“passWithNoTests”: true,
“projects”: [],
“reporters”: [
[
“/Users/path/to/my/repo/node_modules/detox/runners/jest/reporter.js”,
{}
],
[
“/Users/path/to/my/repo/node_modules/jest-summary-reporter/index.js”,
{}
]
],
“rootDir”: “/Users/path/to/my/repo/e2e”,
“runTestsByPath”: false,
“seed”: 2055530429,
“skipFilter”: false,
“snapshotFormat”: {
“escapeString”: false,
“printBasicPrototype”: false
},
“testFailureExitCode”: 1,
“testPathPattern”: “e2e/asdf”,
“testSequencer”: “/Users/path/to/my/repo/node_modules/@jest/test-sequencer/build/index.js”,
“testTimeout”: 300000,
“updateSnapshot”: “new”,
“useStderr”: false,
“verbose”: true,
“watch”: false,
“watchAll”: false,
“watchman”: true,
“workerThreads”: false
},
“version”: “29.7.0”
}

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