Skip to content

Commit

Permalink
docs: some devel intro
Browse files Browse the repository at this point in the history
  • Loading branch information
amarao committed Jan 17, 2024
1 parent 3ba7266 commit 462c2e0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions devel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Getting started

1. Install/configure venv using requirements.txt.
2. Do not forget to update your python version in commands below.
3. All ansible-test invocations should happen in `ansible_collections/serverscom/sc_api`.
This is ansible-test requirement.
4. Installing test dependencies: add `--requirements` to ansible-test during normal calls.

Running sanity checks:

```
ansible-test sanity --requirements --python 3.11
```

unit tests:

```
ansible-test units --requirements --python 3.11
```
(if you get odd errors from pytest, don't forget --requirements)

Both unit and sanity checks can work without secrets.

# Integration tests

To run integration tests you need to generate your own config at
`ansible_collections/serverscom/sc_api/tests/integration/integration_config.yml`
(this location is odd, but it's the single place where ansible-test permits any side
causes into test playbooks)

See example in `integration_config.yml.template`.

Please, pay attention,
you need at least 3 baremetal servers to run tests for baremetal modules.

The main secret you get is SC_TOKEN, which is token to access servers.com API.

At the time of writing you could get one from here: https://portal.servers.com/profile/api-tokens

Please be careful, some tests will cause significant financial spendings. They also will reinstall baremetal servers, so you should dedicate servers for those testing exlusively.

0 comments on commit 462c2e0

Please sign in to comment.