Skip to content

chore: stop building a RegExp from a raw filesystem path - #1964

Merged
aws-cdk-automation merged 1 commit into
aws:mainfrom
MohammedAlkindi:test/windows-path-regex
Sep 22, 2026
Merged

aws-cdk-automation merged 1 commit into
aws:mainfrom
MohammedAlkindi:test/windows-path-regex

Conversation

@MohammedAlkindi

Copy link
Copy Markdown
Contributor

One test in @aws-cdk/cloud-assembly-api builds a RegExp out of a joined temp path. On Windows the separator is a backslash, so the \U, \A, \L and \T in a path like C:\Users\...\AppData\Local\Temp are read as identity escapes and those backslashes are silently dropped. The pattern then matches nothing and the test fails on every Windows checkout, while jest still prints the intact-looking path, so the cause is not obvious from the output.

Raising it now because of #1772 and the opt-in Windows integ-test label added in #1957. Comparing the prefix as a plain string removes the class of bug rather than escaping around it.

Running this package's jest on Windows goes from 2 failed, 84 passed to 1 failed, 85 passed. The remaining failure, assembly with tree metadata having no file property specified, is there before and after and is unrelated to this change.

  • Unit tests added/updated
  • Integration tests added/updated (not applicable, test-only change)

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

…m path

On Windows the separator is a backslash, so interpolating the joined temp path into a RegExp turned sequences such as backslash-U and backslash-T into identity escapes and silently dropped the separators. The pattern then matched nothing and the test failed on every Windows checkout. Compare the prefix as a plain string instead.
@mrgrain mrgrain changed the title test(cloud-assembly-api): stop building a RegExp from a raw filesystem path chore: stop building a RegExp from a raw filesystem path Sep 22, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.32%. Comparing base (a73eebf) to head (8163a2c).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1964   +/-   ##
=======================================
  Coverage   91.32%   91.32%           
=======================================
  Files          79       79           
  Lines       12217    12217           
  Branches     1724     1724           
=======================================
  Hits        11157    11157           
  Misses       1025     1025           
  Partials       35       35           
Flag Coverage Δ
suite.unit 91.32% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@aws-cdk-automation
aws-cdk-automation added this pull request to the merge queue Sep 22, 2026
Merged via the queue into aws:main with commit 59a01f8 Sep 22, 2026
55 of 56 checks passed

This branch was successfully deployed

3 active deployments
integ-approval — 8163a2c3 Deployed Sep 14, 2026 by MohammedAlkindi via prepare #6896
automation — 8163a2c3 Deployed Sep 14, 2026 by MohammedAlkindi via Set AutoQueue on PR #1964 #3542
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants