charm-helpers icon indicating copy to clipboard operation
charm-helpers copied to clipboard

Unit tests failing for python3.10

Open gabrielcocenza opened this issue 3 years ago • 3 comments

Unit tests are failing for the python3.10 as it is possible to see here and in this pastebin.

Apparently, the sequence of the tests that run has changed from one python version to another and this might break some tests.

gabrielcocenza avatar May 27 '22 18:05 gabrielcocenza

Apparently, the sequence of the tests that run has changed from one python version to another and this might break some tests.

So, this probably means that the tests are not properly isolated. All three errors look like either a mock failure of some kind.

ajkavanagh avatar May 30 '22 11:05 ajkavanagh

So, this probably means that the tests are not properly isolated. All three errors look like either a mock failure of some kind.

That is right. I just looked at the test_ceph_context_ec_pool_no_rbd_pool and the problem there is that is missing the env var for JUJU_UNIT_NAME that was happening on test test_save_scriptrc. Now that the sequence of tests changed, setting this env var on the test that is failing is necessary.

gabrielcocenza avatar May 30 '22 12:05 gabrielcocenza

That is right. I just looked at the test_ceph_context_ec_pool_no_rbd_pool and the problem there is that is missing the env var for JUJU_UNIT_NAME that was happening on test test_save_scriptrc. Now that the sequence of tests changed, setting this env var on the test that is failing is necessary.

Indeed, the correct thing to do is to ensure that all of the tests are isolated so that run order does not affect the tests. Some tests may be leaking which means that mocking is not done in those (currently) not failing tests.

ajkavanagh avatar May 30 '22 13:05 ajkavanagh