Uploaded image for project: 'Insights Experiences'
  1. Insights Experiences
  2. HMS-5509

Rework `osbuild-depsolve-dnf` tests

    • Icon: Task Task
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • Image Builder
    • None

      The test matrix in `osbuild-depsolve-dnf` got out of hand. We were increasing the parametrization of `test_depsolve()` test case (and others) to test new features. However, for each test case instance, we also ran the same test case 8 times for each possible repo config combination and optional metadata requested in the request (2*2*2).

      This PR improves the situation by extracting the repo config combo testing to dedicated test cases, which test all combinations with a single test scenario containing multiple repositories.

      I've done some additional refactoring along the way to reduce code duplication and improve testing accuracy (e.g., don't set arguments in the request, which should not be used in the test scenario).

      From local testing of `python3 -m pytest -vv tools/test/test_depsolve.py`:

      • Before: 1083.64s - 00:18:03
      • After: 290.32s - 00:04:50

      *This means that tests run almost 4 times faster.*

      The effect on `Test / Unittest (normal, pyxx)` in GH action is ~20m before vs. ~8m after.

      /jira-epic COMPOSER-2405

              thozza@redhat.com Tomas Hozza
              imagebuilder-bot Image-Builder Bot
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: