Update dependency pytest-subtests to v0.14.2 - autoclosed #220
Cirrus CI / Test Python 3.11
failed
Jun 13, 2025 in 21s
Task Summary
Instruction qa failed in 00:01
Details
✅ 00:00 clone
✅ 00:01 poetry
✅ 00:01 poetry_install
✅ 00:08 jfrog_config
❌ 00:01 qa
self = <tests.unit.test_jre.TestJREProvisioner testMethod=test_successfully_downloading_jre>
get_os_mock = <MagicMock name='get_arch' id='139925872241424'>
get_arch_mock = <MagicMock name='get_os' id='139925871284944'>
def test_successfully_downloading_jre(self, get_os_mock, get_arch_mock):
class JRETestCase(TypedDict):
jre: JRE
bytes: bytes
checksum: str
unzip_dir: str
jres_to_test: list[JRETestCase] = [
{"jre": self.zip_jre, "bytes": self.zip_bytes, "checksum": self.zip_checksum, "unzip_dir": "jre.zip_unzip"},
{
"jre": self.tar_gz_jre,
"bytes": self.tar_gz_bytes,
"checksum": self.tar_gz_checksum,
"unzip_dir": "jre17.0.13.tar.gz_unzip",
},
{"jre": self.tgz_jre, "bytes": self.tgz_bytes, "checksum": self.tgz_checksum, "unzip_dir": "jre.tgz_unzip"},
]
for testcase in jres_to_test:
testcase_jre = testcase["jre"]
jres = [testcase_jre, self.other_jre]
with self.subTest(jre=testcase), sq_api_utils.sq_api_mocker() as mocker:
mocker.mock_analysis_jres(body=[sq_api_utils.jre_to_dict(jre) for jre in jres])
mocker.mock_analysis_jre_download(id=testcase_jre.id, body=testcase["bytes"], status=200)
provisioner = JREProvisioner(self.api, self.cache, utils.get_os().value, utils.get_arch().value)
> jre_path = provisioner.provision()
tests/unit/test_jre.py:161:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/pysonar_scanner/jre.py:67: in provision
jre, resolved_path = self.__attempt_provisioning_jre_with_retry()
src/pysonar_scanner/jre.py:71: in __attempt_provisioning_jre_with_retry
jre_and_resolved_path = self.__attempt_provisioning_jre()
src/pysonar_scanner/jre.py:87: in __attempt_provisioning_jre
jre_path = self.__download_jre(jre)
src/pysonar_scanner/jre.py:106: in __download_jre
with cache_file.open(mode="wb") as f:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = CacheFile(filepath=PosixPath('/usr/sbin/.sonar/cache/jre.tgz'), checksum='a355b9a79d4a655c014d2d0c79e603d17b4aaf2bdb66b243375a33fdcc959379')
mode = 'wb'
def open(self, mode: OpenBinaryMode) -> typing.BinaryIO:
> return open(self.filepath, mode=mode)
E FileNotFoundError: [Errno 2] No such file or directory: '/usr/sbin/.sonar/cache/jre.tgz'
src/pysonar_scanner/cache.py:49: FileNotFoundError
=========================== short test summary info ============================
(jre={'jre': JRE(id='tar_gz_jre', filename='jre17.0.13.tar.gz', sha256='a355b9a79d4a655c014d2d0c79e603d17b4aaf2bdb66b243375a33fdcc959379', java_path='java', os='linux', arch='aarch64', download_url=None), 'bytes': b'\x1f\x8b\x08\x00\x84\x18Lh\x02\xff\xed\xcdA\n\xc20\x14\x04\xd0\x7f\x94\x9e@R\xac\xf5<\x85\x04\\\xa4\x14\xa2\xe2\xf5\r\xdd\x08\xee\x15\xc4\xf763\xccfZY\xf2Z\x0ek\x8e\xcfI\xdd<M{v\xef\x99\xd2x|\xf5}?\x9f\xc69\x86\x14_p\xbf\xde\x96\xd6/\xe3?]J\xad\xdb\xf0\xd8Z\xcd\x01\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xefx\x02\xccq\x9cS\x00(\x00\x00', 'checksum': 'a355b9a79d4a655c014d2d0c79e603d17b4aaf2bdb66b243375a33fdcc959379', 'unzip_dir': 'jre17.0.13.tar.gz_unzip'}) SUBFAIL tests/unit/test_jre.py::TestJREProvisioner::test_successfully_downloading_jre
(jre={'jre': JRE(id='tgz_jre', filename='jre.tgz', sha256='a355b9a79d4a655c014d2d0c79e603d17b4aaf2bdb66b243375a33fdcc959379', java_path='java', os='linux', arch='aarch64', download_url=None), 'bytes': b'\x1f\x8b\x08\x00\x84\x18Lh\x02\xff\xed\xcdA\n\xc20\x14\x04\xd0\x7f\x94\x9e@R\xac\xf5<\x85\x04\\\xa4\x14\xa2\xe2\xf5\r\xdd\x08\xee\x15\xc4\xf763\xccfZY\xf2Z\x0ek\x8e\xcfI\xdd<M{v\xef\x99\xd2x|\xf5}?\x9f\xc69\x86\x14_p\xbf\xde\x96\xd6/\xe3?]J\xad\xdb\xf0\xd8Z\xcd\x01\x00\x00\x00\x00\x00\x00\x00\x00\xc0\xefx\x02\xccq\x9cS\x00(\x00\x00', 'checksum': 'a355b9a79d4a655c014d2d0c79e603d17b4aaf2bdb66b243375a33fdcc959379', 'unzip_dir': 'jre.tgz_unzip'}) SUBFAIL tests/unit/test_jre.py::TestJREProvisioner::test_successfully_downloading_jre
======= 2 failed, 122 passed, 3 deselected, 67 subtests passed in 0.62s ========
Loading