Skip to content

Serve route-snapper file locally for tests#653

Open
Sparrow0hawk wants to merge 5 commits into
mainfrom
local-tests
Open

Serve route-snapper file locally for tests#653
Sparrow0hawk wants to merge 5 commits into
mainfrom
local-tests

Conversation

@Sparrow0hawk

Copy link
Copy Markdown
Contributor

This PR attempts to allow the test suite to run without fetching route-snapper files from a remote host.

It includes:

  • Clarifying our playwright dev dependency
  • Upgrading playwright to 1.60.x
  • Adding express as a dev dependency and using express to serve the single route-snapper file used for tests
  • Configure playwright to use this test server during tests
  • Explicitly disable playwright parallelism to reduce test flakiness

@Sparrow0hawk Sparrow0hawk requested a review from Pete-Y-CS June 11, 2026 15:41
@Pete-Y-CS

Copy link
Copy Markdown
Collaborator

Without the parallelism - these tests seem to be fine for me, but that said it might still be worth pulling this just to be sure in case something slows down - this is a fix that fixed flakiness on main for me

@Sparrow0hawk

Copy link
Copy Markdown
Contributor Author

I'd prefer to avoid applying specific timeouts to individual tests, that for me feels like a smell that something isn't working as we'd like if particular parts of the page are taking too long to load.

Did you find this branch was flaky? If so let me know so I can test it some more.

@Pete-Y-CS

Copy link
Copy Markdown
Collaborator

Well, they fail with timeouts for me if I reintroduce parallelisation, so it may be 6 of one, half a dozen of the other for us to switch off paralellisation to make the timeouts not happen, vs having paralellisation and a longer timeout

@Pete-Y-CS

Pete-Y-CS commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

I guess the answer may be - do some meta-tests of what takes longer?

The route snapper loads plenty fast on PYATS itself, so I think these tests aren't testing how long the page takes to load, they're testing other features. With that in mind whatever gives us fastest running test suite is the best option, no?

@Sparrow0hawk

Copy link
Copy Markdown
Contributor Author

I am keen to avoid parallelism as it potentially hides slower running tests which is something we want to identify and address.

In CI tests runs as quickly with this branch as they do on previous PRs on main (around 2mins) so I don't think we actually gain much from parallelism. If we think the test suite is too slow we probably need to get under the hood of which tests are really slowing us down and why.

@Pete-Y-CS Pete-Y-CS left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Added a comment - looks like there's a test hello world we might wanna remove but otherwise looks good!

express.static(path.join(import.meta.dirname, "route-snappers")),
);

app.get("/", async (req, resp, next) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks like it's just here for testing purposes - do we need/want it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We need this so that playwright knows the server is up during tests.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Alright, then ship it!

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.

2 participants