-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add unit and integration tests for pebble run
#351
Comments
Just for the record, @hpidcock and I talked briefly about this, and I'm quite keen to try using |
`$PEBBLE_COPY_ONCE` environment variable allows `pebble run` to copy layers and state from another directory when seeding a new `$PEBBLE` directory. The rationale for this change is to allow OCI images to specify existing layers in the default `$PEBBLE` location. Then at runtime, be able to run `pebble` with a different `$PEBBLE` directory. This allows `pebble` to be run as a non-root user or run on a read-only root filesystem. Issue #351 outlines that `pebble run` has no unit or integration tests. A test should be performed manually for now. Manual QA is as follows: - Create a directory, with a layers subdirectory and valid testing layers (e.g. ~/dir/with-existing-state) - Create another empty directory. (e.g. ~/dir/with-no-state) - `PEBBLE_COPY_ONCE=~/dir/with-existing-state PEBBLE=~/dir/with-no-state pebble run` - Check all the layers are loaded. - Check all the layers are copied. - Modify a layer in `~/dir/with-no-state/layers`. - Restart `pebble run` and check that it doesn't crash. - Check that the modifications are preserved after the restart (PEBBLE_COPY_ONCE is only for an empty directory). - Check `PEBBLE_COPY_ONCE` can be set to a non-existing directory with `pebble run` passed `--create-dirs` [JU090](https://docs.google.com/document/d/1NWV4QsYq1NldS_V_YlafpJQyNAV-WS46VsIKGBrin_s/edit) [JUJU-5435](https://warthogs.atlassian.net/browse/JUJU-5435) [JUJU-5435]: https://warthogs.atlassian.net/browse/JUJU-5435?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
pebble run
has no unit tests or integration testspebble run
Relatedly, we should figure out a better way to mark and run "root tests" -- or maybe these just become integration tests instead. pebble/.github/workflows/tests.yml Lines 35 to 52 in 18c93cb
|
I have finished researching the possible solutions mentioned above, and here are some of my thoughts:
So, after investigation, I think No.2 probably is the best choice here. A few more words on the build flags (also known as the build constraints) PoC:
|
This is done now in #497. |
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:
spread
to define the integration tests.The integration tests should cover all the expected use cases of pebble at the moment.
The text was updated successfully, but these errors were encountered: