canonical / matter-pi-gpio-commander

Matter Raspberry Pi GPIO Commander - Turn your Pi into a Matter lighting device!
Apache License 2.0
90 stars 3 forks source link

Add Automated testing workflow #45

Closed locnnil closed 4 months ago

locnnil commented 5 months ago
farshidtz commented 4 months ago

I did not close this. It got closed automatically, probably because the base branch has been deleted.

locnnil commented 4 months ago

The tests need some additional work. In particular, the GPIO mocking and mock-testing logic are split all over the place without much control over them. Ideally, there should be a configuration variable to do mocking (local and on CI). Moreover, the tests should be inclusive and drive the testing operations (incl. mocking via the external script, adding access to snap, finding GPIO number).

Right, an environment variable (USE_GPIO_MOCK) was added to control if the GPIO-mockup is going to be used or not.

As a user, I should be able to run the tests locally on a Pi, on another arm64 device, or via GH actions.

With the logic of activating the GPO mockup module direct from the Golang code, the tests can be run either locally or on the GH actions.