-
Notifications
You must be signed in to change notification settings - Fork 1
feat(QA-200): Automated pythonindex package tests #2
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
base: main
Are you sure you want to change the base?
feat(QA-200): Automated pythonindex package tests #2
Conversation
503999d
to
26265fb
Compare
304df25
to
a943e0c
Compare
Also added stuff so that the pipeline is triggered without deploying, also on this branch so that I can debug the flow
de01f92
to
79b03a3
Compare
b987678
to
232ca57
Compare
A bit liberal in that commit summary, but it's not entirely wrong. We don't yet have support for pytest, which was the original plan. So instead I've re-engineered Lennart's solution, but in python (since I couldn't get his solution to work). What we get is a python script which runs all the tests found in ./tests (or as specified as TEST_DIR). It also tracks success/failures, so it does the same things as pytest, but bare minimum for our usecase.
232ca57
to
ecba365
Compare
This way we can call the checks whenever we want. And hopefully shipit can do whatever magic it does to make it #justwork when deployed to edge
Although the <api>/check endpoint worked just fine locally, it times out the workload on edge. So we need to be able to call each test one by one. So in addition to this, I added a <api>/list endpoint which lists all tests, then a /check/<test> endpoint which calls a singular test. This allows us to run just a specific test, if need be. Also added instructions on how this works to README.md
729addf
to
24467a3
Compare
def _has_network() -> bool: | ||
try: | ||
socket.getaddrinfo("httpbin.org", 443) | ||
return True | ||
except Exception: | ||
return False | ||
|
||
|
||
HAS_NET = _has_network() |
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.
good idea
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.
Hmm, I noticed that it only works with pytest, which we don't support (yet!). I wrote this when I had the intent of using pytest, instead of needing to write my own version
So it always fails on this, and requests aren't tested. But perhaps it's fine?
|
||
Run tests: | ||
|
||
- `uv pip compile pyproject.toml --python-version=3.13 --universal --extra-index-url https://pythonindex.wasix.org/simple --index-url=https://pypi.org/simple --emit-index-url --only-binary :all: -o wasmer-requirements.txt` |
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.
I think you may be able to convert the test script to a PEP 723 script with URL based specifiers. That way we should be able to just uv run
the tests.
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.
I don't really know what that means or how it would work. These preconditionals are just copy-pasted from what Syrus had in the fastapi template.
I vote for out of scope/future improvement!
Co-authored-by: Zebreus <zebreus@zebre.us>
3ec07f7
to
be1323e
Compare
be1323e
to
953ffe4
Compare
This PR will setup testing for all the python native packages which have a test defined.
Read the README section! TL;DR:
./testing/run-all-tests-via-api.py --host https://build-scripts.wasmer.<env> --port 443
to run all tests on edge