Skip to content
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

Declarative cross implementation test suite tools #140

Closed
pipermerriam opened this issue Jun 15, 2019 · 2 comments
Closed

Declarative cross implementation test suite tools #140

pipermerriam opened this issue Jun 15, 2019 · 2 comments

Comments

@pipermerriam
Copy link
Member

What was wrong?

  • lots of duplication between the trio and asyncio based test suites.
  • lots of things that behave differently when they occur across different processes.

How can it be fixed?

I've been imagining this concept that I'll call an "Endpoint Driver". It would be a declarative, implementation agnostic mechanism for defining a sequential set of actions that should be taken on an endpoint, with one of those actions being something like just running python code.

This tool should allow us to write implementation agnostic tests allowing us to define our test suite once and run it across any number of different combinations like:

  • both endpoints of the same implementation in the same process
  • different implementations in the same process
  • same/different implementations in different processes.

I suspect the tests will be much more readable too.

@pipermerriam
Copy link
Member Author

server_driver = compose_driver(
    connect_until_connected_to(client_config),
    wait_for(SomeEvent).add_handler(lambda ev: assert isinstance(ev, SomeEvent)),
)
client_driver = compose_driver(
    connect_to_endpoint(server_config),
    broadcast(SomeEvent()),
)

Then there's probably a backend type component for how to run each endpoint type as well as something to manage doing things in their own processes.

@pipermerriam
Copy link
Member Author

Done with #141 opening new issues to convert the rest of the test suite to use this...

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

No branches or pull requests

1 participant