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.
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.