os-autoinst-distri-opensuse icon indicating copy to clipboard operation
os-autoinst-distri-opensuse copied to clipboard

Optimize installation/add_update_test_repo

Open mdoucha opened this issue 2 years ago • 6 comments

Handle optional screens and pop-ups while adding custom repository URLs based on needle matches instead of needlessly waiting for optional screens which will not show up.

  • Related ticket: https://progress.opensuse.org/issues/112343
  • Needles: N/A
  • Verification run: https://openqa.suse.de/tests/9708069 (saved 4 minutes of add_update_test_repo run time compared to original job https://openqa.suse.de/tests/9704628)

mdoucha avatar Jun 17 '22 14:06 mdoucha

Great PR! Please pay attention to the following items before merging:

Files matching lib/**.pm:

  • [ ] Consider adding or extending unit tests in t/

This is an automatically generated QA checklist based on modified files

github-actions[bot] avatar Jun 17 '22 14:06 github-actions[bot]

Looks pretty complicated, isn't check_screen with match_has_tag doing the same ? e.g. https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/tests/installation/await_install.pm#L115

dzedro avatar Jun 23 '22 08:06 dzedro

handle_screen() has a few benefits over using match_has_tag() directly:

  • You don't have to make a long if/else code noodle to pick the right handler. If you have predefined handler functions elsewhere, handle_screen() needs just one line per handler.
  • You don't have to wrap the whole thing in a loop if you need to handle multiple optional screens.
  • You can pass a partially constructed handler hash to another function that'll add more handlers and finish the task. For example this'll be useful for handling GPG key popups which need to be handled in multiple places during installation with different follow-up screens.

mdoucha avatar Jun 23 '22 08:06 mdoucha

Please also document the return / exit behavior I think it's important part of the handler_map.

dzedro avatar Jun 23 '22 10:06 dzedro

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If it's still needed, you can add labels WIP or notready to it

stale[bot] avatar Sep 24 '22 23:09 stale[bot]

Rebased on current master and updated verification run. This PR is ready for merge.

mdoucha avatar Oct 11 '22 10:10 mdoucha

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If it's still needed, you can add labels WIP or notready to it

stale[bot] avatar Jan 16 '23 05:01 stale[bot]

Great PR! Please pay attention to the following items before merging:

Files matching lib/**.pm:

  • [ ] Consider adding or extending unit tests in t/

This is an automatically generated QA checklist based on modified files.

github-actions[bot] avatar Jan 16 '23 09:01 github-actions[bot]

Rebased again. Verification runs updated. This PR has been ready for merge for 6 months already.

mdoucha avatar Jan 16 '23 09:01 mdoucha