1
0
Fork 0
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:
Jonas L 2023-09-26 09:41:19 +02:00 committed by GitHub
parent 94190ae6cb
commit 9a44bc260f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 125 additions and 62 deletions

View file

@ -0,0 +1,2 @@
python-dateutil
requests

View file

@ -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
View 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"}