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

[codecov] make npm test --coverage always succeed even if some test fails #670

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

realkosty
Copy link
Collaborator

@realkosty realkosty commented Jan 29, 2025

Alternatively we could put something like

cat jest-junit.xml | grep FAIL -A 10

after that ||
but I don't see value in actually maintaining those tests. Lmk if I'm missing something


Testing

result is that check will succeed and Codecov will post a Tests Failed: comment:
example #671 (comment)

Copy link

vercel bot commented Jan 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
empower ⬜️ Ignored (Inspect) Visit Preview Jan 29, 2025 10:22pm

Copy link

codecov bot commented Jan 29, 2025

Bundle Report

Bundle size has no change ✅

Copy link

codecov bot commented Jan 29, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
75 1 74 0
View the top 1 failed tests by shortest run time
Products Component captures exception when fetching fails
Stack Traces | 0.056s run time
TypeError: Sentry.startSpan is not a function
    at getProducts (.../src/components/Products.jsx:99:12)
    at .../src/components/Products.jsx:121:7
    at invokePassiveEffectCreate (.../react-dom/cjs/react-dom.development.js:23487:20)
    at HTMLUnknownElement.callCallback (.../react-dom/cjs/react-dom.development.js:3945:14)
    at HTMLUnknownElement.callTheUserObjectsOperation (.../living/generated/EventListener.js:26:30)
    at innerInvokeEventListeners (.../living/events/EventTarget-impl.js:338:25)
    at invokeEventListeners (.../living/events/EventTarget-impl.js:274:3)
    at HTMLUnknownElementImpl._dispatch (.../living/events/EventTarget-impl.js:221:9)
    at HTMLUnknownElementImpl.dispatchEvent (.../living/events/EventTarget-impl.js:94:17)
    at HTMLUnknownElement.dispatchEvent (.../living/generated/EventTarget.js:231:34)
    at Object.invokeGuardedCallbackDev (.../react-dom/cjs/react-dom.development.js:3994:16)
    at invokeGuardedCallback (.../react-dom/cjs/react-dom.development.js:4056:31)
    at flushPassiveEffectsImpl (.../react-dom/cjs/react-dom.development.js:23574:9)
    at unstable_runWithPriority (.../scheduler/cjs/scheduler.development.js:468:12)
    at runWithPriority$1 (.../react-dom/cjs/react-dom.development.js:11276:10)
    at flushPassiveEffects (.../react-dom/cjs/react-dom.development.js:23447:14)
    at Object.<anonymous>.flushWork (.../react-dom/cjs/react-dom-test-utils.development.js:992:10)
    at act (.../react-dom/cjs/react-dom-test-utils.development.js:1107:9)
    at render (.../empower/react/node_modules/@.../react/dist/pure.js:95:26)
    at Object.<anonymous> (.../src/tests/Products.test.js:104:11)
    at Promise.then.completed (.../empower/react/node_modules/jest-circus/build/utils.js:391:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../empower/react/node_modules/jest-circus/build/utils.js:316:10)
    at _callCircusTest (.../empower/react/node_modules/jest-circus/build/run.js:218:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (.../empower/react/node_modules/jest-circus/build/run.js:155:3)
    at _runTestsForDescribeBlock (.../empower/react/node_modules/jest-circus/build/run.js:66:9)
    at _runTestsForDescribeBlock (.../empower/react/node_modules/jest-circus/build/run.js:60:9)
    at run (.../empower/react/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (.../empower/react/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:170:21)
    at jestAdapter (.../empower/react/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19)
    at runTestInternal (.../empower/react/node_modules/jest-runner/build/runTest.js:389:16)
    at runTest (.../empower/react/node_modules/jest-runner/build/runTest.js:475:34)
    at Object.worker (.../empower/react/node_modules/jest-runner/build/testWorker.js:133:12)

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@realkosty realkosty changed the base branch from react-fix-tests2 to master January 29, 2025 22:11
@realkosty realkosty merged commit 8c2ec77 into master Jan 29, 2025
11 checks passed
@realkosty realkosty deleted the codecov-never-fail branch January 29, 2025 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants