Skip to content

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Jul 16, 2025

Fixes an issue with the CWD being inconsistent and unexpected during execution of the test app. Previously we had two different behaviors: For regular execution we would execute the app from the directory of the test file, but for watch we would run it in the actual user's CWD. This is inconsistent behavior making it difficult to write integ test cases than can be executed across all modes. Additionally as reported in #638, languages likes python may rely on CWD to import modules. The CWD changing compared to library code and modes, makes it very difficult to use integ-runner in these languages.

The change aligns the CWD for test app execution to be the current CWD. Given the two existing choices, this is the less arbitrary one and aligns more with running a test app directly (node integ.app-under-test.test.js) would work.

Related to the above change, git operations are now using the -C flag to specify the correct git repository directory instead of the CWD. This ensures integ-runner works correctly even when executed from outside the repository under test. Previously this worked because we change the working directory to the directory containing the test file. However in the error case this printed an incorrect reproduction command that assumed the repro would be run that directory.

Fixes #638


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team July 16, 2025 11:46
@github-actions github-actions bot added p2 bug effort/medium 1-3 days of effort p1 and removed p2 labels Jul 16, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.47%. Comparing base (d71960e) to head (d83463b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #720      +/-   ##
==========================================
- Coverage   79.52%   79.47%   -0.05%     
==========================================
  Files          50       51       +1     
  Lines        7291     7294       +3     
  Branches      826      824       -2     
==========================================
- Hits         5798     5797       -1     
- Misses       1474     1478       +4     
  Partials       19       19              
Flag Coverage Δ
suite.unit 79.47% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mrgrain mrgrain marked this pull request as draft July 16, 2025 12:27
auto-merge was automatically disabled July 16, 2025 12:27

Pull request was converted to draft

…ions

Fixes issues with git operations by using the -C flag to specify the correct git repository directory. This ensures integ-runner works correctly when executed from outside the repository under test. Also standardizes the directory used for running CDK apps to always be the current working directory.
@mrgrain mrgrain force-pushed the kornherm/fix/integ-runner/git-directory-handling branch from 10a4550 to d83463b Compare July 16, 2025 13:57
@mrgrain mrgrain temporarily deployed to integ-approval July 16, 2025 13:57 — with GitHub Actions Inactive
@mrgrain mrgrain changed the title fix(integ-runner): improve git directory handling for snapshot operations fix(integ-runner): inconsistent and unexpected CWD in test app exectution Jul 16, 2025
@mrgrain mrgrain marked this pull request as ready for review July 16, 2025 14:13
@mrgrain mrgrain marked this pull request as draft July 16, 2025 16:58
@mrgrain mrgrain changed the title fix(integ-runner): inconsistent and unexpected CWD in test app exectution fix(integ-runner): inconsistent and unexpected CWD in test app execution Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug effort/medium 1-3 days of effort p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integ-runner: Breaks the CWD and path when using Python language
2 participants