mirror of
https://github.com/ansible-collections/hetzner.hcloud
synced 2024-11-10 06:34:13 +00:00
9adb8b3981
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [hcloud](https://togithub.com/hetznercloud/hcloud-python) ([changelog](https://togithub.com/hetznercloud/hcloud-python/blob/main/CHANGELOG.md)) | `1.35.0` -> `2.0.1` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/hcloud/2.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/hcloud/2.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/hcloud/1.35.0/2.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/hcloud/1.35.0/2.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>hetznercloud/hcloud-python (hcloud)</summary> ### [`v2.0.1`](https://togithub.com/hetznercloud/hcloud-python/blob/HEAD/CHANGELOG.md#201-2024-07-03) [Compare Source](https://togithub.com/hetznercloud/hcloud-python/compare/v2.0.0...v2.0.1) ##### Bug Fixes - `assignee_type` is required when creating a primary ip ([#​409](https://togithub.com/hetznercloud/hcloud-python/issues/409)) ([bce5e94]( |
||
---|---|---|
.. | ||
common | ||
targets | ||
cloud-config-hcloud.ini.in | ||
README.md | ||
requirements.txt |
Integration tests
This document provides information to work with the integration tests.
Guidelines
A set of guidelines to follow when writing integrations tests.
Prepare and cleanup
The integration tests use a small testing framework that helps to set up and teardown any resources needed or generated by the tests. This small testing framework is located in the tests/integration/common
directory. The files within the common
directory are then duplicated and kept in sync in all the integration tests targets (tests/integration/targets/hcloud_*
).
- Use a
tasks/prepare.yml
file to set up resources needed during the tests. - Use a
tasks/cleanup.yml
file to teardown resources from thetasts/prepare.yml
tasks and the resources generated by the tests. - Use a
tasks/test.yml
file to defines your tests. - You may explode the tests into multiple
tasks/test-*.yml
files and import them in thetasks/test.yml
file. - The
tasks/cleanup.yml
file cannot use variables present in thetasks/prepare.yml
file because cleanup should also run before the prepare tasks.
Naming convention
The integration tests handle a lot of different variables, names, identifier. To reduce this complexity, make sure to use the following naming conventions:
- Any test resources MUST be registered using the
test_<resource>
variable name (e.g.test_server
ortest_floating_ip
) and MUST be created and cleaned in thetasks/prepare.yml
andtasks/cleanup.yml
. The scope of this variable is the entire target. - In
tasks/prepare.yml
, tasks names MUST start with:Create test_<resource>
(e.g.Create test_server
orCreate test_floating_ip
) - In
tasks/cleanup.yml
, tasks names MUST start with:Cleanup test_<resource>
(e.g.Cleanup test_server
orCleanup test_floating_ip
) - Any fact starting with
_
is scoped to the current file and MUST NOT be used outside of it. - Any test result MUST be registered using the
result
variable name unless it is required in a future test, in that case it MUST use the<resource>
variable name as prefix.