charmed-kubernetes / pytest-operator

Apache License 2.0
6 stars 13 forks source link

Add verbosity flag to build_charm #106

Closed sed-i closed 1 year ago

sed-i commented 1 year ago

When charms fail to build in CI, all we see is

 RuntimeError: Failed to build charm .:
Packing the charm.
Launching environment to pack for base name='ubuntu' channel='20.04' architectures=['amd64'] (may take a while the first time but it's reusable)
Packing the charm
Packing the charm.
Building charm in '/root'
Running step PULL for part 'charm'
Running step OVERLAY for part 'charm'
Running step BUILD for part 'charm'
Parts processing error: Failed to run the build script for part 'charm'.
Failed to build charm for bases index '0'.
Full execution log: '/home/runner/.local/state/charmcraft/log/charmcraft-20230319-020431.474806.log'

It could be handy to temporarily (or permanently) enable verbosity so debugging is more immediate.

sed-i commented 1 year ago

@addyess if this change makes sense, could you please approve the workflow?

addyess commented 1 year ago

@sed-i i'm okay with this the extra output here.

it might also on those jobs a good idea to use the upload-artifact action to upload:

/home/runner/.local/state/charmcraft/log/*.log
sed-i commented 1 year ago

That's a good point @addyess, and usually should be sufficient. I posted your suggestion on https://github.com/canonical/observability/issues/45.

In some itests it may take some extra time to figure out which log belongs to a given failure:

$ ls ~/.local/state/charmcraft/log                              
charmcraft-20230320-091916.759315.log  charmcraft-20230320-091925.989856.log  charmcraft-20230320-092158.932450.log
charmcraft-20230320-091919.414896.log  charmcraft-20230320-091952.689041.log
addyess commented 1 year ago

published 0.26.0