Project

General

Profile

Actions

action #34303

closed

Fix test for undocumented backend variables

Added by okurz about 6 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Regressions/Crashes
Target version:
-
Start date:
2018-04-05
Due date:
% Done:

0%

Estimated time:

Description

Observation

In os-autoinst we have a test t/04-check_vars_docu.t which should check that all backend variables are properly documented however the test seems to not catch cases like https://github.com/os-autoinst/os-autoinst/pull/940#issuecomment-378567024 . The corresponding travis check states that everything is ok but when executing the test manually I get quite some errors but the exit code is 0:

$ perl t/04-check_vars_docu.t
still missing explanation for backend IKVM variable IPMI_HOSTNAME
still missing explanation for backend IKVM variable IPMI_HW
still missing explanation for backend IKVM variable IPMI_PASSWORD
still missing explanation for backend IKVM variable IPMI_USER
still missing explanation for backend IPMI variable IPMI_HOSTNAME
still missing explanation for backend IPMI variable IPMI_HW
still missing explanation for backend IPMI variable IPMI_PASSWORD
still missing explanation for backend IPMI variable IPMI_USER
still missing explanation for backend PVM variable ARCH
still missing explanation for backend PVM variable HDD_$hdd_num
still missing explanation for backend PVM variable HDD_$i
still missing explanation for backend PVM variable ISO
still missing explanation for backend PVM variable LPARID
still missing explanation for backend PVM variable NIC
still missing explanation for backend PVM variable VIOISO
still missing explanation for backend PVM variable VNC
still missing explanation for backend PVM variable WORKER_ID
still missing explanation for backend QEMU variable AUTO_INST
still missing explanation for backend QEMU variable BIOS
still missing explanation for backend QEMU variable HDDFORMAT
still missing explanation for backend QEMU variable HDDSIZEGB_$i
still missing explanation for backend QEMU variable OFW
still missing explanation for backend QEMU variable OVS_DEBUG
still missing explanation for backend QEMU variable QEMU_COMPRESS_LEVEL
still missing explanation for backend QEMU variable QEMU_COMPRESS_METHOD
still missing explanation for backend QEMU variable QEMU_MAX_BANDWIDTH
still missing explanation for backend QEMU variable RAIDLEVEL
still missing explanation for backend QEMU variable SCSICONTROLLER
still missing explanation for backend QEMU variable TAPDOWNSCRIPT
still missing explanation for backend QEMU variable TAPSCRIPT
still missing explanation for backend QEMU variable UEFI
still missing explanation for backend QEMU variable UEFI_BIOS
still missing explanation for backend QEMU variable VIRTIO_CONSOLE
still missing explanation for backend QEMU variable VNCKB
still missing explanation for backend QEMU variable WORKER_HOSTNAME
still missing explanation for backend SVIRT variable NUMDISKS
still missing explanation for backend SVIRT variable RAIDLEVEL
still missing explanation for backend VIRT variable QEMUCPUS
still missing explanation for backend VIRT variable QEMURAM

Suggestion

  • t/04-check_vars_docu.t has some logic to provide a proper exit code based on if it found a mismatch. This should be checked
  • It's annoying that doc/backend_vars.asciidoc is always updated when the "test" is executed locally. It should be made sure that tests do not modify files. Maybe add a command line switch to make that an option to update the documentation automatically

Related issues 1 (0 open1 closed)

Copied to openQA Project - action #71146: [os-autoinst][backends] Prevent undocumented test variables in backends / prevent use of external testapi methodsResolvedokurz

Actions
Actions #1

Updated by dheidler almost 5 years ago

  • Status changed from New to In Progress
  • Assignee set to dheidler
Actions #2

Updated by dheidler almost 5 years ago

  • Status changed from In Progress to Feedback
Actions #3

Updated by dheidler almost 5 years ago

  • Status changed from Feedback to Resolved
Actions #4

Updated by okurz over 4 years ago

  • Status changed from Resolved to Workable

As https://github.com/os-autoinst/os-autoinst/pull/1152 showed it looks like we still haven't reached the goal. The test isn't really "fixed" and finding the diff is even harder now that we have a separate file. We should really make it a working test, i.e. if a PR introduces a new undocumented backend variable then the test fails and also travis CI checks fail pointing to the necessary change, similar to tidy diffs.

Actions #5

Updated by dheidler over 4 years ago

  • Assignee deleted (dheidler)
Actions #6

Updated by ilausuch almost 4 years ago

  • Status changed from Workable to In Progress
  • Assignee set to ilausuch
Actions #8

Updated by livdywan almost 4 years ago

  • Status changed from In Progress to Feedback

PR got merged, addressing both the tests (by making them fatal) as well as gaps in documentation.

Actions #9

Updated by livdywan almost 4 years ago

  • Status changed from Feedback to Resolved

Suggestion

  • t/04-check_vars_docu.t has some logic to provide a proper exit code based on if it found a mismatch. This should be checked

This part is covered.

  • It's annoying that doc/backend_vars.asciidoc is always updated when the "test" is executed locally. It should be made sure that tests do not modify files. Maybe add a command line switch to make that an option to update the documentation automatically

A file doc/backend_vars.asciidoc.newvars is left behind, which unfortunately is neither temporary nor in .gitignore.

That said, this can probably be considered done.

Actions #10

Updated by okurz over 3 years ago

  • Copied to action #71146: [os-autoinst][backends] Prevent undocumented test variables in backends / prevent use of external testapi methods added
Actions #11

Updated by okurz over 3 years ago

funny thing is that t/04-check_vars_docu.t only checks for variables like $bmwqemu::vars and not uses of get_var or get_required_var in our backends. Covered in #71146

Actions

Also available in: Atom PDF