Skip to content

stdout comparison - #18

Merged
KRRT7 merged 13 commits into
mainfrom
stdout_comparison_
Mar 4, 2025
Merged

stdout comparison#18
KRRT7 merged 13 commits into
mainfrom
stdout_comparison_

Conversation

@KRRT7

Copy link
Copy Markdown
Contributor

Update test_results.py
Update parse_test_output.py
Update equivalence.py

@KRRT7
KRRT7 marked this pull request as ready for review February 18, 2025 11:32

@misrasaurabh1misrasaurabh1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs thorough unit testing

Comment threadtests/test_instrument_all_and_run.py Outdated
Comment threadtests/test_instrument_tests.py Outdated
Comment threadcode_to_optimize/bubble_sort_method.py
Comment threadcodeflash/cli_cmds/cmd_init.py Outdated
Comment threadpyproject.toml Outdated
Comment threadtests/test_instrument_all_and_run.py Outdated
Comment threadtests/test_instrument_all_and_run.py Outdated
Comment threadtests/test_instrumentation_run_results_aiservice.py Outdated
Comment threadtests/test_instrument_all_and_run.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this have \n whereas all others have proper newlines?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was debugging something, forgot to revert.

KRRT7 added 2 commits March 3, 2025 16:59
Update pyproject.toml
Update test_instrument_tests.py
Update test_instrument_all_and_run.py
missing test
@KRRT7
KRRT7force-pushed the stdout_comparison_ branch from 2fa1abc to dcf9384CompareMarch 4, 2025 00:59
@KRRT7
KRRT7 merged commit 832b2eb into mainMar 4, 2025
@KRRT7
KRRT7 deleted the stdout_comparison_ branch March 4, 2025 01:40
mohammedahmed18 added a commit that referenced this pull request Apr 6, 2026
## 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>
Sign up for freeto 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

@KRRT7@misrasaurabh1