Skip to content

E2E Tests for Query#585

Open
wmccrthy wants to merge 59 commits intoluau-lang:primaryfrom
wmccrthy:e2e-query-tests
Open

E2E Tests for Query#585
wmccrthy wants to merge 59 commits intoluau-lang:primaryfrom
wmccrthy:e2e-query-tests

Conversation

@wmccrthy
Copy link
Contributor

No description provided.

Comment on lines 268 to 270
- upwards navigation is rly useful; in this codemod, it'd be a lot easier / more performant to query for each function call (generally), update all those that are migrated accordingly (if we have upwards nav
we can get the statement by walking up tree from the call node). unfortunately, bc some of the migrations require the whole call statement (i.e local var = call),
we cannot do this and have to query for statements for those transforms that require the whole statement context, and separately query for calls for those transforms that only need the call node
Copy link
Contributor

Choose a reason for hiding this comment

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

Just cut #593: I agree.

Comment on lines 272 to 275
- I'm not sure of a good way around this one, just a general performance concern, it's tricky to vary operations between node world / string world.
When operating on a node, it is not uncommon to want to re-use parts of that node in your transformed output; currently, this will require:
- for string transform: parsing the node into a string, and interpolating into your returned replacement
- for node transform: cloning node so it's mutable, updating accordingly (even more impractical, would never do this, just pointing out you CAN)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should be biasing towards string transforms. Most codemods are going to be one-and-done, not multi-pass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, writing the string transforms was much nicer for this. I guess my point here is that i'm curious if there's a better way to keep parts of existing nodes than using printer

@wmccrthy wmccrthy requested a review from hgoldstein December 9, 2025 01:11
end
end)
end
end)
Copy link
Contributor

Choose a reason for hiding this comment

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

Bumping this: I think you want fs.walk here.

This definitely looks like this can be abstracted as well.

@wmccrthy wmccrthy marked this pull request as ready for review December 10, 2025 19:35
@wmccrthy wmccrthy requested a review from hgoldstein December 10, 2025 19:35
Copy link
Contributor

@hgoldstein hgoldstein left a comment

Choose a reason for hiding this comment

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

See comments, and I believe we should be using all lower case for the path names, so e2ecases and apisurfacechange instead of e2eCases and apiSurfaceChange respectively (yes I see there's a folder that's currently violating that).

end)
end

local transformsDir = "./tests/std/syntax/e2eCases"
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels a bit manual: is there any way for us to get this programmatically?

Copy link
Contributor Author

@wmccrthy wmccrthy Jan 5, 2026

Choose a reason for hiding this comment

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

Easiest way I know of is with the debug API but not sure if that's the best way. Do you know of any other solutions?

@wmccrthy wmccrthy requested a review from hgoldstein January 5, 2026 23:21
@hgoldstein hgoldstein dismissed their stale review January 20, 2026 23:51

This is me

@wmccrthy wmccrthy requested a review from Vighnesh-V January 23, 2026 19:15
Sign up for free to 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.

3 participants