1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

test: various fixes for integration tests (#193)

* test: update for new locations

* test(cert): fix issues with random name failing the test

The variable hcloud_dns_test_domain used the random function to generate
a number from 1-100. This number changed between every usage of the
variable, so the test that compared the domain name of the cert to the
variable kept failing, as different numbers were generated.

By generating the number once and saving it into a fact, this is fixed.

* test: fix issues with long resource names

Server and volume names have restricted length (63 and 64 respectivly).

This can cause issues when the `hcloud_prefix` is of certain length. By
applying truncate, we can be sure to not reach the limit.

This issue mainly happened in our internal ci, as the hcloud_prefix variable
contains the hostname where the tests were running, and our hostnames are
quite long.
This commit is contained in:
Julian Tölle 2023-02-13 10:48:26 +01:00 committed by GitHub
parent 292cdf2a05
commit e218306028
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 28 additions and 22 deletions

View file

@ -8,7 +8,7 @@
- name: verify test gather hcloud datacenter infos
assert:
that:
- hcloud_datacenters.hcloud_datacenter_info| list | count == 4
- hcloud_datacenters.hcloud_datacenter_info| list | count >= 5
- name: test gather hcloud datacenter infos in check mode
hcloud_datacenter_info:
@ -18,7 +18,7 @@
- name: verify test gather hcloud datacenter infos in check mode
assert:
that:
- hcloud_datacenters.hcloud_datacenter_info| list | count == 4
- hcloud_datacenters.hcloud_datacenter_info| list | count >= 5
- name: test gather hcloud datacenter infos with correct name
hcloud_datacenter_info: