Skip to content

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

Merged
merged 36 commits into from
Oct 7, 2022
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3b7a460
Add cache, fetch, retry logic to tests
tedpatrick Oct 4, 2022
c9d4039
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 4, 2022
7dddcd3
run in parallel
tedpatrick Oct 4, 2022
0981d37
add pytest-xdist
tedpatrick Oct 4, 2022
e669c20
undo parallelism. Need to remove http server to enable.
tedpatrick Oct 4, 2022
aa22295
woops a extra space
tedpatrick Oct 4, 2022
4ed5de3
Pass flake8
tedpatrick Oct 4, 2022
142e158
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 4, 2022
d9b440a
spell fulfill
tedpatrick Oct 4, 2022
9c5bc02
use decorator for fetch if not in cache
madhur-tandon Oct 5, 2022
b9281e9
Fix --headed and limit to PlaywrightRequestError
tedpatrick Oct 5, 2022
b4beafd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 5, 2022
f2c928f
docs on cache
tedpatrick Oct 5, 2022
a4a67c1
CICD caching of conda on unstable builds
tedpatrick Oct 5, 2022
e539533
fix config issues
tedpatrick Oct 5, 2022
6700899
empty commit to trigger gh-actions
tedpatrick Oct 5, 2022
ae08d60
restore build-unstable
tedpatrick Oct 5, 2022
43442cc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 5, 2022
7196ecb
Remove http server, add parallel
tedpatrick Oct 5, 2022
c7b1c2f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 5, 2022
e20fe88
temp: Bypass zip runtime test and point to v0.21.3 on CDN
tedpatrick Oct 5, 2022
f7c0433
suport for files in zip under /pyodide
tedpatrick Oct 5, 2022
b4c3e56
remove test-one
tedpatrick Oct 6, 2022
debdbad
self.http_server and remove content_type
tedpatrick Oct 6, 2022
2e4f45a
domcontentloaded w no timeout on base url + longer timeout on wait_fo…
tedpatrick Oct 6, 2022
d8fc0b5
Fixed #678
tedpatrick Oct 6, 2022
e91a919
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 6, 2022
3ec9276
set default timeout to 60000
tedpatrick Oct 6, 2022
510b811
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 6, 2022
66350ef
seamless --headed support
tedpatrick Oct 6, 2022
ee94f43
add test-integration-parallel and default for GHActions
tedpatrick Oct 6, 2022
3a742ed
simplify the code. Use http://fakeserver instead of localhost:8080 so…
antocuni Oct 7, 2022
50b9be2
The page-routing logic is becoming too much complicated to stay as an…
antocuni Oct 7, 2022
1b9774a
no need to use a hash, we can use the url as the key
antocuni Oct 7, 2022
5558bd6
re-implement the retry logic. The old @retry decorator was nice but a…
antocuni Oct 7, 2022
fff726e
improve logging
antocuni Oct 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
set default timeout to 60000
  • Loading branch information
tedpatrick committed Oct 6, 2022
commit 3ec92763b3b409650fd242ca98dcf238d6b584fc
10 changes: 7 additions & 3 deletions pyscriptjs/tests/integration/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def init(self, request, tmpdir, logger, page):
Fixture to automatically initialize all the tests in this class and its
subclasses.

The magic is done by the decorator @pyest.mark.usefixtures("init"),
The magic is done by the decorator @pytest.mark.usefixtures("init"),
which tells pytest to automatically use this fixture for all the test
method of this class.

Expand Down Expand Up @@ -95,6 +95,10 @@ def init(self, request, tmpdir, logger, page):

def init_page(self, page, headed):
self.page = page

# set default timout to 60000 millliseconds from 30000
page.set_default_timeout(60000)

# cache storing request objects by a key computed as the sha256 of the url
cache = {}

Expand Down Expand Up @@ -191,7 +195,7 @@ def goto(self, path):
self.logger.reset()
self.logger.log("page.goto", path, color="yellow")
url = f"{self.http_server}/{path}"
self.page.goto(url, wait_until="domcontentloaded", timeout=0)
self.page.goto(url,timeout=0)

def wait_for_console(self, text, *, timeout=None, check_errors=True):
"""
Expand Down Expand Up @@ -220,7 +224,7 @@ def wait_for_console(self, text, *, timeout=None, check_errors=True):
if check_errors:
self.check_errors()

def wait_for_pyscript(self, *, timeout=60000, check_errors=True):
def wait_for_pyscript(self, *, timeout=None, check_errors=True):
"""
Wait until pyscript has been fully loaded.

Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy