This patch set adds support for a new Github-based workflow so it's
easier to run the tests as early and as often as possible. Hopefully as
a result, the bugs can be prevented or fixed early.
Four kinds of tests are triggered when there is a pull request created
in a Github kexec-tools repo [1],
- format check using shfmt
- static analysis using shellcheck
- ShellSpec unit tests (test cases in spec/)
- integration tests ( tests cases in tests/)
Before enabling Github Action, I've gone through all the test failures
most of which are shellcheck warnings to make all tests have green
status [2]. Because there are so many test warnings from shellcheck, it
makes it difficult to find new test failures. Despite a few false
positives, most warnings are valuable and make the code more robust.
This patch set is also available for review on [1].
Why Github over Gilab?
======================
The biggest reason is Gitlab doesn't doesn't allow merge request from
forked project to use a specific runner i.e. our own testing machine to
run the tests [3] (I have to use a specific runner because Gitlab's
shared runners are very slow. For example, it takes ~3 hours to finish
current integration tests while it can be finished in ~8min using our
own testing machine). A second reason if out of security concern.
Currently for Gitlab specific runner, we need to run the Docker as root
which makes the testing machine quite vulnerable.
[1]
https://github.com/coiby/kexec-tools/pull/1
[2]
https://github.com/coiby/kexec-tools/runs/7987323055?check_suite_focus=true
[3]
https://www.google.com/url?q=https://pagure.io/fedora-infrastructure/issu...
Coiby Xu (24):
format code using shfmt
fix shellcheck warnings for dracut-early-kdump-module-setup.sh
fix shellcheck warnings for dracut-early-kdump.sh
fix shellcheck errors of dracut-fadump-init-fadump.sh
Disable shellcheck rule SC2154 for variables defined by dracut
Eliminate shellcheck SC2129 warnings
Eliminate shellcheck SC2086 warnings
Eliminate shellcheck SC2029 warnings
Eliminate shellcheck SC2034 warnings
Eliminate shellcheck SC2181 warnings
Eliminate shellcheck SC2154 warning
Eliminate shellcheck SC2005 warning
Eliminate shellcheck SC2046 warning
Eliminate shellcheck SC1004 warning
Eliminate shellcheck SC2295 warnings
Eliminate shellcheck SC2295 warnings
Eliminate shellcheck SC2013 warning
Eliminate shellcheck SC2030 and SC2031 warnings
Make kdump-logger.sh fully POSIX-compatible
Eliminate shellcheck warnings in kdump-lib.sh
Eliminate shellcheck warning in spec/kdumpctl_general_spec.sh
tests: use guestmount to mount a qemu image when USE_GUESTMOUNT=1
tests: make QEMU instance timeout configurable
tests: enable Github action
.github/workflows/main.yml | 53 ++++
dracut-early-kdump-module-setup.sh | 4 +-
dracut-early-kdump.sh | 87 ++++---
dracut-fadump-init-fadump.sh | 6 +-
dracut-fadump-module-setup.sh | 2 +
dracut-kdump.sh | 27 +-
dracut-module-setup.sh | 42 ++--
kdump-dep-generator.sh | 6 +-
kdump-lib-initramfs.sh | 8 +-
kdump-lib.sh | 34 +--
kdump-logger.sh | 388 ++++++++++++++++-------------
kdump-migrate-action.sh | 5 +-
kdump-restart.sh | 2 +-
kdumpctl | 66 ++---
mkdumprd | 1 +
mkfadumprd | 2 +
spec/kdumpctl_general_spec.sh | 2 +
tests/scripts/build-image.sh | 6 +
tests/scripts/image-init-lib.sh | 94 +++++--
tests/scripts/test-lib.sh | 10 +-
tools/run-integration-tests.sh | 29 +++
21 files changed, 540 insertions(+), 334 deletions(-)
create mode 100644 .github/workflows/main.yml
create mode 100755 tools/run-integration-tests.sh
--
2.37.1