-
Notifications
You must be signed in to change notification settings - Fork 174
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
Integration Testing #331
Comments
TODO:
|
@distributedstatemachine I think you mentioned you had started some of this somewhere? Any code that can be re-used or naw? |
@sam0x17 @orriin #332 . Although, this description is probably outdated since we wont be using https://github.com/opentensor/bittensor/blob/stao/tests/integration_tests/test_subtensor_integration.py and would have to write a integration test that doesnt use mocks i.e we will have to spin up the local node in the ci. |
yeah worth mentioning, as long as you specify you are using SubtensorCI like the other github workflows do it will be a very beefy node with 128 gigs of ram |
I've been exploring the 1. What to test?After speaking with @distributedstatemachine, it has become apparent that Therefore, an entirely new test suite will need to be written for these e2e tests. For basic tests, I could work through each file one-by-one in For multi-step tests, there was already a scenario described here: https://discord.com/channels/799672011265015819/1176889736636407808/1236057424134144152 . Are there any other complex e2e cases we should test? 2. How do I call into the CLI?I suggest directly call 3. How to clear state between each e2e test?Since from inside the bittensor script we have no way to restart the chain (necessary between e2e tests to prevent polluting state and potential weird race conditions) we will need a test harness which runs a new I'm thinking to create an orchestrator file, which will spin up a There may also be some voodoo possible with beforeeach and aftereach pytest hooks, but I'm not sure if it would be worth the extra effort to get those working. 4. How to structure the test files?I'm thinking of creating a new dir My proposed structure of the new testing dir is
|
I think we can use the call the cli the same way its currently done :
I like this , i think we can call |
@sam0x17 DM'd me about 1., saying that it's more important for this PR to get a nice process / structure / examples in place to write e2e tests than to get full test coverage. So I'll start with 2 examples
|
also some key requirements I would like to meet with this if possible:
|
I have a PoC using pytest fixures (https://docs.pytest.org/en/6.2.x/fixture.html) to spin up and spin down localnet nodes between tests. The initial adaptation will need to run in serial, but with some additional logic to find free ports it should be possible to upgrade in the future with the ability to run in parallel. |
awesome, this is a great first stab at this 💯 can you link the PR to this with a |
Description
To ensure continuous reliability between our Subtensor and the Bittensor package, we need to implement a comprehensive GitHub Actions workflow. This workflow will automate the entire testing process, from building the blockchain node using the
localnet.sh
script, to installing the Bittensor package from a configurable branch, and finally running thetest_subtensor_integration.py
integration test.The primary objective of this setup is to verify that any changes introduced to the subtensor codebase do not break or introduce regressions in the Bittensor Python code. By parameterizing the Bittensor repository branch, we can test against various development stages and release candidates, ensuring compatibility and robustness across different versions.
Acceptance Criteria
localnet.sh
script.test_subtensor_integration.py
integration test should be executed after successful installation of the Bittensor package.Tasks
.github/workflows
directory.localnet.sh
script into the workflow for building and starting the blockchain nodes.test_subtensor_integration.py
integration test.Additional Considerations
Related Links
The text was updated successfully, but these errors were encountered: