Project

General

Profile

Actions

action #77074

closed

[qe-core] load_extra_tests_desktop is unused

Added by dancermak over 3 years ago. Updated about 3 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
Category:
Enhancement to existing tests
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
easy

Description

The function load_extra_tests_desktop from lib/main_common.pm line 1484 onward, appears to be unused. Can it be dropped?

Actions #1

Updated by tjyrinki_suse over 3 years ago

  • Subject changed from load_extra_tests_desktop is unused to [qe-core] load_extra_tests_desktop is unused
  • Category set to Enhancement to existing tests
  • Status changed from New to Workable
  • Priority changed from Normal to High
  • Start date deleted (2020-11-06)

Sounds like a job for QE Core. I'd love cleaning up main_common.pm when deemed safe enough.

Actions #2

Updated by tjyrinki_suse over 3 years ago

  • Status changed from Workable to New
Actions #3

Updated by szarate about 3 years ago

  • Status changed from New to Workable
  • Priority changed from High to Normal
  • Difficulty set to easy
Actions #4

Updated by mgrifalconi about 3 years ago

  • Status changed from Workable to In Progress
  • Assignee set to mgrifalconi
Actions #5

Updated by mgrifalconi about 3 years ago

TL;DR at the bottom.

PR for removal of function in title: https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/11936

I had a look around main_common.pl and found some other candidates for removal..

cat main_common.pm  | grep "sub " | cut -d' ' -f2  > myList
while read s; do CALLS=$(cat main_common.pm | grep $s|wc -l); if [[ "$CALLS" -eq 1 ]]; then echo $s; fi done <myList  >output

What this ugly script does is to list all 'sub' and check how many times they are referenced in the same file. If it happens only once, it is logged.
Result:

load_extra_tests_texlive
load_extra_tests_openqa_bootstrap
load_extra_tests_zypper
load_extra_tests_dracut
load_extra_tests_perl_bootloader
load_extra_tests_kdump
load_extra_tests_opensuse
load_extra_tests_qemu
load_extra_tests_geo_console
load_extra_tests_geo_desktop
load_extra_tests_sdk
load_extra_tests_toolkits
load_extra_tests_filesystem
load_extra_tests_wicked
load_extra_tests_udev
load_security_tests_crypt_core
load_security_tests_crypt_web
load_security_tests_crypt_kernel
load_security_tests_crypt_x11
load_security_tests_crypt_firefox
load_security_tests_crypt_tool
load_security_tests_crypt_libtool
load_security_tests_crypt_krb5kdc
load_security_tests_crypt_krb5server
load_security_tests_crypt_krb5client
load_security_tests_fips_setup
load_security_tests_ipsec
load_security_tests_mmtest
load_security_tests_apparmor_profile
load_security_tests_yast2_apparmor
load_security_tests_yast2_users
load_security_tests_lynis
load_security_tests_openscap
load_security_tests_selinux
load_security_tests_mok_enroll
load_security_tests_ima_measurement
load_security_tests_ima_appraisal
load_security_tests_evm_protection
load_security_tests_system_check
load_security_tests_check_kernel_config
load_security_tests_pam
load_security_tests_create_swtpm_hdd
load_security_tests_swtpm
load_security_tests_grub_auth
load_security_tests_tpm2
load_extra_tests_syscontainer

Now I am confused. For example load_extra_tests_dracut is not referenced anywhere as well but there is a test.

Never mind, I understand what is happening. Look here https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/728095c5ce9a6e2b48bb2516ed6de0769966dc58/lib/main_common.pm#L1735-L1757

TL;DR
There is a magic function that calls other functions with the name load_tests_<<NAME>> so there is no easy way to make sure a function is unused, since a variable is set on openQA side. There must have been good reasons for it, but I must say that I am not that comfortable with such style.

I propose to reject this issue. I would not spend time on main_common since the long term goal is to get rid of it anyway (AFAIK).

Actions #6

Updated by mgrifalconi about 3 years ago

  • Status changed from In Progress to Rejected
Actions

Also available in: Atom PDF