ansible-collections / hetzner.hcloud

A collection to manage resources on Hetzner Cloud
https://galaxy.ansible.com/ui/repo/published/hetzner/hcloud
GNU General Public License v3.0
108 stars 38 forks source link

Integration tests cannot succeed on local setup #245

Closed jooola closed 11 months ago

jooola commented 1 year ago
SUMMARY

The hcloud_image_info integration test attempt to list a snapshot named always-there-snapshot, this snapshot is present in the Hetzner Cloud project used by the CI, but is not setup when running tests locally.

The hcloud_placement_group, hcloud_rdns and hcloud_server integration test attempt to attach an ssh key that is only present in the Hetzner Cloud project used by the CI.

Maybe a setup/teardown could be automated, or at least a setup.

ISSUE TYPE
COMPONENT NAME

hcloud_image_info hcloud_placement_group hcloud_rdns

STEPS TO REPRODUCE
ansible-test integration -vv hcloud_image_info
ansible-test integration -vv hcloud_placement_group
ansible-test integration -vv hcloud_rdns
ansible-test integration -vv hcloud_server
EXPECTED RESULTS

The tests should pass locally as well as in the CI.

ACTUAL RESULTS

The tests fail because of the missing snapshot.

github-actions[bot] commented 1 year ago

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

apricote commented 11 months ago

I think this was fixed in https://github.com/ansible-collections/hetzner.hcloud/pull/316 by explicitly creating a new snapshot before running the test: https://github.com/ansible-collections/hetzner.hcloud/blob/main/tests/integration/targets/image_info/tasks/prepare.yml