Uh oh!
There was an error while loading. Please reload this page.
stdout comparison - #18
Conversation
ace7938 to
b265fa2Compare
misrasaurabh1
left a comment
There was a problem hiding this comment.
This needs thorough unit testing
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1935a67 to
2fa1abcCompareThere was a problem hiding this comment.
why does this have \n whereas all others have proper newlines?
There was a problem hiding this comment.
was debugging something, forgot to revert.
Update test_results.py Update parse_test_output.py Update equivalence.py
Update test_results.py Update parse_test_output.py Update equivalence.py
Update pyproject.toml Update test_instrument_tests.py Update test_instrument_all_and_run.py missing test
## Problem
When test files were inside the project root (common case), Codeflash did NOT
create the runtime config that disables globalSetup/globalTeardown. This caused
Jest to use the project's original config WITH globalSetup, leading to failures
when globalSetup required unavailable infrastructure (Docker, databases, etc.):
Error: Jest: Got error running globalSetup - /workspace/target/globalSetup.ts,
reason: Command failed: docker context ls --format json
/bin/sh: 1: docker: not found
## Root Cause
Runtime config was only created when tests were OUTSIDE project root:
if any(not Path(d).is_relative_to(resolved_root) for d in test_dirs):
jest_config = _create_runtime_jest_config(...)
But globalSetup should be disabled for ALL Codeflash test runs.
## Solution
Always create runtime config when `jest_config` and `test_files` exist:
if test_files and jest_config:
test_dirs = {str(Path(f).resolve().parent) for f in test_files}
jest_config = _create_runtime_jest_config(jest_config, effective_cwd, test_dirs)
## Impact
- Affected: ALL projects with globalSetup/globalTeardown in Jest config
- Reproducibility: 100% systematic
- Example trace: 04dc4dcf-ca9f-449e-aed5-7a82f28c5e23
## Changes
- test_runner.py: Updated 3 functions (behavioral, benchmarking, line profiling)
- New test file: test_globalsetup_invocation_bug.py (3 test cases)
- All existing tests still pass
Fixes#18
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update test_results.py
Update parse_test_output.py
Update equivalence.py