mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
ci: add unit tests to azure pipelines (#325)
##### SUMMARY Enable unit testing in the CI. We started to write some unit tests for the inventory, but they were not enforced in the CI.
This commit is contained in:
parent
94190ae6cb
commit
9a44bc260f
6 changed files with 125 additions and 62 deletions
2
tests/unit/requirements.txt
Normal file
2
tests/unit/requirements.txt
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
python-dateutil
|
||||
requests
|
||||
|
|
@ -74,7 +74,7 @@ else
|
|||
fi
|
||||
|
||||
# STAR: HACK install dependencies
|
||||
retry pip install -r tests/integration/requirements.txt -c tests/integration/constraints.txt
|
||||
retry pip install -r tests/integration/requirements.txt -c tests/constraints.txt
|
||||
retry ansible-galaxy -vvv collection install -r tests/requirements.yml
|
||||
|
||||
retry pip install rstcheck
|
||||
|
|
|
|||
17
tests/utils/shippable/units.sh
Executable file
17
tests/utils/shippable/units.sh
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -o pipefail -eux
|
||||
|
||||
declare -a args
|
||||
IFS='/:' read -ra args <<< "$1"
|
||||
|
||||
python_version="${args[1]}"
|
||||
|
||||
ansible-test env --timeout 30 --color -v
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
ansible-test units --color -v \
|
||||
--docker default \
|
||||
--python "$python_version" \
|
||||
${COVERAGE:+"$COVERAGE"} \
|
||||
${CHANGED:+"$CHANGED"}
|
||||
Loading…
Add table
Add a link
Reference in a new issue