-
Notifications
You must be signed in to change notification settings - Fork 213
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
Suggestion: ASGI compliance tests #248
Comments
So three questions:
|
I think there's a lot to be said for implementation-independent test suites like http://acid3.acidtests.org/ |
It strikes me that the first version of this doesn't need to be 100% comprehensive to be useful - just covering things like the default scope keys and making sure they are bytes or strings would be a big win for people trying to spin up new ASGI implementations. I'd love to build asgi-to-wsgi (see #109) and this would make it a lot easier! |
There isn't one of these, and I do agree there should be - I've usually called these "acceptance" or "compliance" test suites, and it would help a lot in enforcing that the spec is actually adhered to. It'd be a little tricky to test both directions given the async nature of both ASGI and its servers - making it robust in the face of all the different event loop implementations is tricky - but it's probably possible. |
I like the term "compliance" for this. Getting it to work for all aspects of async ASGI does sound tricky, but I think just the basics of the HTTP spec (which is the bit that I'm seeing the most activity around) should be achievable without too much trouble. |
Are you still interested in this @simonw? I'm willing to help here. |
I'm always excited to see new ASGI hosting implementations emerge - today I've been trying out this wrapper for Azure Functions for example: Azure/azure-functions-python-library#75
It would be great if there was a really robust way to put these new implementations through their paces.
asgiref
seems like it might be the right place for that to exist.My initial idea is a solution with two parts:
I have a ASGI function that returns the repr of the scope which I use to test out new implementations by eyeballing them - eg here: https://azure-functions-datasette.azurewebsites.net/-/asgi-scope - I'm imagining something a bit like that which pairs up with a
asgi-test https://azure-functions-datasette.azurewebsites.net/-/asgi-scope
command-line script (which calls a Python function).The text was updated successfully, but these errors were encountered: