mirror of
https://github.com/linux-system-roles/network.git
synced 2026-08-02 07:42:13 +00:00
fix ensure_provider_tests.py; fix generated tests; add check to CI
Fix ensure_provider_tests.py so that the tests are correctly generated. Because the generated tests have not been checked in a while, there was some drift between the actual tests and what should have been generated, so the new generated tests have also been included. When `ensure_provider_tests.py` detects differences, it will now show the diffs using a unified diff format. Added a new tox testenv `ensure_provider_tests` - use `tox -e ensure_provider_tests` to run - to pass arguments, use `tox -e ensure_provider_tests -- generate` Added `ensure_provider_tests` as one of the tox testenvs to run for github tox CI. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
parent
1112bc2664
commit
f813fb33b7
29 changed files with 79 additions and 21 deletions
22
tests/git-post-commit.sh
Executable file
22
tests/git-post-commit.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Run script ensure_provider_tests.py and append test files generated by it to the commit.
|
||||
|
||||
# This script is intended to be used as git post-commit hook.
|
||||
# Make sure file is executable and copy it to <your repo>/.git/hooks/post-commit
|
||||
# This script has to be used together with pre-commit to work properly.
|
||||
|
||||
GITPATH=$(git rev-parse --show-toplevel)
|
||||
|
||||
if [ -e "$GITPATH/.commit" ]; then
|
||||
rm "$GITPATH/.commit"
|
||||
|
||||
cd "$GITPATH/tests"
|
||||
python ./ensure_provider_tests.py generate
|
||||
cd "$GITPATH"
|
||||
git add tests/tests_*_nm.yml tests/tests_*_initscripts.yml
|
||||
git commit --amend -C HEAD --no-verify
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue