-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add cache, fetch, retry logic to tests #829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Notes:
|
ESLint... tomorrow! :) |
I don't know what's happening, but now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nitpicks here, but the problem with --headed
is a merge blocker IMHO (I use it a lot)
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
I don't think it's enough, because the server also needs to serve the pyscript/pyscriptjs/tests/integration/support.py Lines 69 to 70 in 510b811
Generally speaking, I am very happy to have faster and parallel, but I'm -1 to break So, probably a good solution is to use playwright routes (and maybe parallelization, see below) by default, but use the webserver when you pass Parallelization:
(and in general, in my experience |
ah, I see that you just readded |
@antocuni I will set --parallel to run in GHActions and optionally locally. I keep seeing we agree on the features but we disagree on the defaults. :) |
I believe this is ready for a deeper review. |
… that it's clearer that the browser is NOT hitting a real server, and use urllib to parse the url. Moreover, the special case for pyodide is no longer needed, it's automatically handled by the normal 'fakeserver' logic
… inner function. Move it to its own class, and add some logic to workaround a limitation of playwright which just hangs if a Python exception is raised inside it
… bit too over-engineered and most importantly failed silently in case of exceptions. This new approach is less powerful but since we want to retry only two times, simple is better than complex -- and in case of exception, the exception is actually raised
@tedpatrick as discussed privately, I refactored a bit the code. Highlights of my changes:
|
I love it. 🚢 it. |
🚢 it! |
When using this option, you use a real http server instead of using playwright's internal routing. There are cases in which it's useful, in particular: 1) if you want to test the page on different browser 2) if you want to use the chrome dev tools, because apparently when using the fake server chromium is unable to locate the sourcemaps This commit reintroduces some of the code which was killed by PR #829.
…e pyExec (#881) Yet another refactoring to untangle the old mess. Highlights: base.ts, pyscript.ts and pyrepl.ts were a tangled mess of code, in which each of them interacted with the others in non-obvious ways. Now PyScript is no longer a subclass of BaseEvalElement and it is much simpler. I removed code for handling the attributes std-out and std-err because they are no longer needed with the new display() logic. The logic for executing python code is now in pyexec.ts: so we are decoupling the process of "finding" the python code (handled by the py-script web component) and the logic to actually execute it. This has many advantages, including the fact that it will be more easily usable by other components (e.g. pyrepl). Also, note that it's called pyexec and not pyeval: in the vast majority of cases in Python you have statements to execute, and almost never expressions to evaluate. I killed the last remaining global store, scriptQueue tada. As a bonus effect, now we automatically do the correct thing when a <py-script> tag is dynamically added to the DOM (I added a test for it). I did not remove svelte from packages.json, because I don't fully understand the implications: there are various options which mention svelte in rollup.js and tsconfig.json, so it's probably better to kill it in its own PR. pyexec.ts is also responsible of handling the default target for display() and correct handling/visualization of exceptions. I fixed/improved/added display/output tests in the process. I also found a problem though, see issue #878, so I improved the test and marked it as xfail. I removed BaseEvalElement as the superclass of most components. Now the only class which inherits from it is PyRepl. In a follow-up PR, I plan to merge them into a single class and do more cleanup. During the refactoring, I killed guidGenerator: now instead of generating random py-* IDs which are very hard to read for humans, we generated py-internal-X IDs, where X is 0, 1, 2, 3, etc. This makes writing tests and debugging much easier. I improved a lot our test machinery: it turns out that PR #829 broke the ability to use/view sourcemaps inside the playwright browser (at least on my machine). For some reason chromium is unable to find sourcemaps if you use playwrights internal routing. So I reintroduced the http_server fixture which was removed by that PR, and added a pytest option --no-fake-server to use it instead, useful for debugging. By default we are still using the fakeserver though (which is faster and parallelizable). Similarly, I added --dev which implies --headed and also automatically open chrome dev tools.
Let's make the tests run faster.