charmed-kubernetes / pytest-operator

Apache License 2.0
7 stars 13 forks source link

`charmcraft clean` in cleanup_model #58

Open rgildein opened 2 years ago

rgildein commented 2 years ago

I'm not sure if this is a problem on the side of the charmcraft, but many times I've found myself in a situation where the integration test doesn't work and it's because of a broken container that charmcraft uses to build a charm.

The error in such a situation is often not obvious and setting log-level to debug do not provide much information, as charmcraft is not running without --verbose flag.

The solution could be to add the charmcraft clean run in the _clean_model function.

Manually running charmcraft clean is not always noticeable, as in many projects pytest-operator is used to build test charms whose source code is either in the sub-directory of integration tests 1 or clone from git repository.


rgildein commented 2 years ago

Example bash and after running charmcraft clean it works again.