Repository navigation
fix(playwright): report given caller paths with spaces - #124
Open
Pranav-Bobde wants to merge 1 commit into
Open
Pranav-Bobde wants to merge 1 commit into
Pranav-Bobde wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
given()sends its caller as a project-relative file and line in the/agent/scope/givenrequest, and the Keploy agent keeps it as the given value'sSource(pkg/service/agent/given_proven.goin keploy/keploy). With spaces in the spec path,sourceOf()can skip the caller and use a lower Playwright frame. In the regression row onmain, the request's source isnode_modules/playwright/lib/worker/workerProcessEntry.js:1644instead oftest/fixtures/given caller with spaces.spec.ts:4.The cause is the location regex, which stops at whitespace, and
new URL(...).pathname, which leaves%20infile://paths.Change
atorat asyncprefix on frames with no function name.file://URLs withfileURLToPath(). A label it can't decode, such as an eval frame'sfile:///proj/a%2Fb.spec.ts, is skipped sogiven()doesn't throw.Checked
playwright/test/rows.test.mjs: it runs a real spec with spaces in its filename against the local fake agent and checks the/agent/scope/givenrequest. It fails onmainwith the Playwright path above and passes with this change.sourceOfassertions cover encodedfile://paths, unnamed paths with spaces,at asyncpaths with and without spaces, and an undecodable eval label. The Playwright row covers the spec filename with spaces.playwright/src/index.tsfrommain, 2 Playwright tests fail: the new row and thesourceOfunit test.jest/e2e/lane.sh, the lane against a live Keploy agent, which needs a newer enterprise Keploy binary than I have.