pros icon indicating copy to clipboard operation
pros copied to clipboard

✨ Add More Unit Tests

Open pingbird opened this issue 8 years ago • 7 comments

Unit tests are great for finding bugs and regressions, but these may be hard to automate

I propose linking all the unit tests together into a single binary, have a script automatically download this to a cortex, select the unit test using debug stream, reboot the cortex using the bootloader if it gets stuck, and repeat this for every unit test until they all pass or one fails

pingbird avatar Jul 24 '17 06:07 pingbird

I think it's time to revisit this again. However, instead of actually uploading to a uC, it would be more feasible to mock the vexOS SDK and run the tests as part of CI, similar to the way OkapiLib mocks the PROS API.

HotelCalifornia avatar Sep 19 '19 21:09 HotelCalifornia

I think that system tests (i.e. with the real hardware in the loop) are a vital component of a comprehensive test suite. PIO has an interesting approach to unit testing on hardware which might serve as some inspiration: https://docs.platformio.org/en/latest/plus/unit-testing.html

Octogonapus avatar Sep 19 '19 23:09 Octogonapus

Sure we could add a manually run (presumably still automated) verification step that runs on a local V5, but I still think our first step should be something that can run in our already present azure pipeline

HotelCalifornia avatar Sep 20 '19 12:09 HotelCalifornia

I agree. You might have missed my implication, though, that with PIO's approach, system tests that run on a local V5 can also be run through Azure.

Octogonapus avatar Sep 20 '19 13:09 Octogonapus

I know about local agents, but I'm not sure how we can add one to our workflow easily.

HotelCalifornia avatar Sep 20 '19 13:09 HotelCalifornia

For future generations/devs who work on this, here is the place you need to add new unit tests:

https://github.com/purduesigbots/pros/tree/develop/src/tests

The reason I say this is because we've added a lot more sensors, but haven't been adding tests for them. Please do this when you add new sensors from now on.

Furthermore, we need somebody to go in and add those new sensors so this is def a task that needs to be done.

As for getting a CI hooked up to a brain or v5 sim... this is another project if we have somebody who wants to do that.

WillXuCodes avatar Jan 12 '23 22:01 WillXuCodes

🥺 👉 👈

pingbird avatar Jan 26 '23 03:01 pingbird