Skip to content

Update WIT definitions, add tests & CI infra#7

Merged
posborne merged 13 commits into
mainfrom
posborne/update-wit-ci-and-tests
Sep 5, 2025
Merged

Update WIT definitions, add tests & CI infra#7
posborne merged 13 commits into
mainfrom
posborne/update-wit-ci-and-tests

Conversation

@posborne
Copy link
Copy Markdown
Member

@posborne posborne commented Sep 2, 2025

No description provided.

@posborne posborne requested a review from erikrose September 2, 2025 22:14
@posborne posborne force-pushed the posborne/update-wit-ci-and-tests branch 2 times, most recently from 30919ef to a279d39 Compare September 2, 2025 22:41
Copy link
Copy Markdown
Member

@erikrose erikrose left a comment

Choose a reason for hiding this comment

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

Hooray! Looking great! Just a few notes.

Comment thread .github/workflows/python-ci.yml Outdated
Comment thread .github/workflows/python-ci.yml
Comment thread app.py Outdated
Comment thread app.py
Comment thread pyproject.toml Outdated
Comment thread tests/test_integration.py Outdated
@posborne posborne force-pushed the posborne/update-wit-ci-and-tests branch from 29f294e to c239fcc Compare September 3, 2025 17:28
Find an available port and use that for a given test run to avoid
interference with other running viceroy instances or services
on the local machine.
We key off extra output included when running the server
in verbose mode to know when viceroy is ready.
A lot of the extra stuff we had for logging exceptions and
such aren't required any longer as the WASI bits are working
as they ought to, so we can gut all of that.

Also, fixed vcpu_time which does return an integer number
of milliseconds in the viceroy impl, so assert on that.
@posborne posborne force-pushed the posborne/update-wit-ci-and-tests branch from 8165059 to ef3406b Compare September 3, 2025 18:13
Copy link
Copy Markdown
Member

@erikrose erikrose left a comment

Choose a reason for hiding this comment

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

So nice to get rid of that 10s sleep. :-D

Comment thread tests/test_integration.py Outdated
Comment thread tests/test_integration.py Outdated
Comment thread tests/test_integration.py Outdated
Comment thread tests/test_integration.py Outdated
We are using these helpers internally and it probably makes sense
to have some sort of easier setup for end users.  This is the first
stab at making that available.  Along with those changes, I also
incorporated a few chanes to reduce the code for viceroy setup
using asyncio (still a bit verbose but is working) and a few
other small tweaks.

The plugin to get Viceroy output on failure is a hack and we may
scrap or have to revisit other approaches (e.g. just immediately
outputting to host stdout/stderr) but it is functional and may
be a reasonable approach (if ugly in implementation).
Comment thread fastly_compute/testing.py Outdated
@posborne posborne force-pushed the posborne/update-wit-ci-and-tests branch from 5c8041a to 2bc81e9 Compare September 4, 2025 19:04
We hide the viceroy_server by making it be an autouse
fixture on the class which lets us clean things up a fair bit.
It stands to reason that all viceroy based tests will want
a server.
Copy link
Copy Markdown
Member

@erikrose erikrose left a comment

Choose a reason for hiding this comment

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

Looking good. I just want to conclude the threads on mark.integration and the lock that I was curious about.

Comment thread fastly_compute/testing.py
Comment thread fastly_compute/testing.py
Returns:
requests.Response: The HTTP response
"""
timeout = kwargs.pop("timeout", self.REQUEST_TIMEOUT)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It'd be nice to lift timeout up into the function signature. Not a blocker. More a note to my future self.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Deferring this for now.

Comment thread tests/README.md Outdated
Comment thread tests/test_integration.py Outdated
Comment thread tests/README.md Outdated

```bash
make test # Build and run tests
pytest -m integration # Run integration tests only
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One more spot

Copy link
Copy Markdown
Member

@erikrose erikrose left a comment

Choose a reason for hiding this comment

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

Thanks again, Paul!

@posborne posborne merged commit 7f5856a into main Sep 5, 2025
3 checks passed
@posborne posborne deleted the posborne/update-wit-ci-and-tests branch September 5, 2025 19:45
@erikrose erikrose mentioned this pull request Sep 12, 2025
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