Not all scripts are covered by tox bashate lint

Bug #1968776 reported by Jim Gauld
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
New
Low
Unassigned

Bug Description

Brief Description
-----------------
Tooling enhancement request:
* improve tox coverage automatically for scripts without .sh suffix
* run "shellcheck" in addition to bashate

New scripts without .sh suffix are not picked up by existing zuul tox bashate lint.
Ideally do this for most repos, but minimally for repo integ.

Severity
--------
Minor: Code likely will runs, missing future bugs. Linters should prevent obvious errors.

Steps to Reproduce
------------------
Create a new bash script in repo integ without .sh suffix.
Git review, zuul job will run and not find the new file.

Expected Behavior
------------------
tox coverage of new code.

Actual Behavior
----------------
zuuk tox bashate and lint run, but does not run tests on the new files with wrong suffix.

Reproducibility
---------------
100%

System Configuration
--------------------
Build system.

Branch/Pull Time/Commit
-----------------------
NA

Last Pass
---------
this is day one defect.

Timestamp/Logs
--------------
NA

Test Activity
-------------
Developer code submission.

Workaround
----------
Manually run "bashate" and "shellcheck" on new scripts.

e.g., Possible workaround for new scripts under integ/kubernetes:

./stx/integ/tox.ini in the bashate section, add the following:

  bash -c "find {toxinidir}/kubernetes \
         -not \( -type d -name .?\* -prune \) \
         -type f \
         -not -name \*~ \
         -not -name \*.md \
         \( -exec bash -c 'file \{\} | grep -q :.*shell' \; \
         -a ! -name '*.sh' \) \
         -print0 | xargs -r -n 1 -0 bashate -v -e E* \
         -i E006,E041,E042,E043,E044 -e E*"

NOTE: this workaround is gross because it invokes complex pipeline and processes file contents, so it is a bit slow, cpu intensive, even just trolling the kubernetes directory.

Tags: stx.zuul
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.zuul
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.