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

Robustness: Improve Test Coverage of Repo #185

Open
carlaKC opened this issue Apr 26, 2024 · 2 comments
Open

Robustness: Improve Test Coverage of Repo #185

carlaKC opened this issue Apr 26, 2024 · 2 comments
Labels
Code Health Refactors and improvements to the structure of the code help wanted Extra attention is needed High Priority Robustness Changes that improve the robustness of running the simulator
Milestone

Comments

@carlaKC
Copy link
Contributor

carlaKC commented Apr 26, 2024

SimLN started as a hackathon project, so it doesn't have much by way of unit tests. This is very, very bad.

We should aim to dramatically improve the coverage of the codebase to ensure that everything is working as expected, and there are no future regressions.

A great first starting point would be to add test coverage for Simulator with mock out LightningNode implementations. See sim node mocking as an example of how to go about this.

Low hanging fruit:

  • validate_activity
  • validate_node_network

Middle tier:
Test individual functions for their expected behavior, eg:

  • Spin up consume_events
  • Test various exit conditions - send_payment failure, listener shutdown etc
  • Test successful send_payment for both SimulationOutput::SendPaymentSuccess/SimulationOutput::SendPaymentFailure etc

A few considerations here:

  • Will need to spin up blocking functions like consume_events in a separate task so the test can run
  • Consider buffering channels to make life a bit easier

The rest of the elephant:

  • Test the high level Simulation::run function with mocked nodes
  • Refactors that make life easier here are welcome!

@carlaKC carlaKC added help wanted Extra attention is needed Code Health Refactors and improvements to the structure of the code Robustness Changes that improve the robustness of running the simulator High Priority labels Apr 26, 2024
@carlaKC carlaKC added this to the V3 milestone Apr 26, 2024
@joseguru
Copy link

Hey @carlaKC. Following you recommendation #180 to write tests on validate_activity (currently working on it), Can I pick this up an work on the low hanging fruits

@carlaKC
Copy link
Contributor Author

carlaKC commented May 15, 2024

Can I pick this up an work on the low hanging fruits

Let's get #180 in first and then move on to this? Thanks for volunteering though, looking forward to getting going on this next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Health Refactors and improvements to the structure of the code help wanted Extra attention is needed High Priority Robustness Changes that improve the robustness of running the simulator
Projects
None yet
Development

No branches or pull requests

2 participants