canonical / pebble

Take control of your internal daemons!
GNU General Public License v3.0
137 stars 52 forks source link

Add unit and integration tests for `pebble run` #351

Open hpidcock opened 5 months ago

hpidcock commented 5 months ago

Currently pebble run has no unit tests or integration tests. Considering this is the main entry point, it would be valuable to add integration testing here.

There is a few possible ways we could achieve this:

The integration tests should cover all the expected use cases of pebble at the moment.

benhoyt commented 5 months ago

Just for the record, @hpidcock and I talked briefly about this, and I'm quite keen to try using go test with a build tag for this, for example go test -tags integration ./internals/testintegration. This will mean we can run some nice high-level tests of pebble run without installing any additional tooling.

benhoyt commented 3 months ago

Relatedly, we should figure out a better way to mark and run "root tests" -- or maybe these just become integration tests instead. https://github.com/canonical/pebble/blob/18c93cbc280de20c9e21d323fe3a8bbb340777a2/.github/workflows/tests.yml#L35-L52