canonical / rockcraft

Tool to create OCI Images using the language from Snapcraft and Charmcraft.
GNU General Public License v3.0
37 stars 44 forks source link

Spread should run the doc tests with a nonroot user #651

Open cjdcordeiro opened 3 months ago

cjdcordeiro commented 3 months ago

What needs to get done

By default, Spread will run the test suites with sudo. To be more comprehensive, and specifically for the doc tests (which are public-facing code blocks that must be reproducible), Spread should also run the tests as a nonroot user.

Why it needs to get done

If we only run the tests with sudo, then we'll fail to identify documentation bits that ignore how permissions might be set in the user's working environment. For example - #649 . In this case, testing that code block with a nonroot user would've helped identify the documentation issue in advance.