Skip to content

Fix downstream unit tests

Ani Sinha requested to merge anisinha/cloud-init:test_fixes-v2 into c9s

BZ: 2217865

Patches 1 and 2 adds the equivalent config settings to the tests that were introduced by downstream only patches. Patch 3 reverts a downstream only commit that looks like its useless. In theory, there should be no breakage from reverting this change. Patch 4 adds some RHEL specific config changes to tests. These tests fail when run on RHEL platform. Patches 5 and 6 are direct cherry-picks (without conflicts) of couple of upstream commits that fix existing test related issues.

After these changes, running tox gives:

  py3: OK (67.75=setup[6.23]+cmd[61.52] seconds)
  black: OK (2.33=setup[2.11]+cmd[0.22] seconds)
  flake8: OK (6.09=setup[2.09]+cmd[4.00] seconds)
  isort: OK (2.76=setup[2.07]+cmd[0.69] seconds)
  mypy: OK (3.36=setup[2.13]+cmd[1.23] seconds)
  pylint: FAIL code 2 (15.23=setup[2.34]+cmd[12.89] seconds)
  evaluation failed :( (97.55 seconds)

When I run tox on the latest upstream cloud-init, I see similar results.

pylint code rating for upstream 23.1.1 is 8.73 which is same as downstream:

.pkg: _exit> python /home/anisinha/.local/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
  py3: OK (67.41=setup[10.24]+cmd[57.17] seconds)
  black: OK (3.99=setup[2.09]+cmd[1.90] seconds)
  flake8: OK (6.12=setup[2.09]+cmd[4.03] seconds)
  isort: OK (2.99=setup[2.12]+cmd[0.87] seconds)
  mypy: OK (11.44=setup[2.14]+cmd[9.30] seconds)
  pylint: FAIL code 2 (90.78=setup[76.61]+cmd[14.16] seconds)
  evaluation failed :( (182.76 seconds)
Edited by Ani Sinha

Merge request reports