Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added test framework #6

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ files
.vagrant*
ansible_collections/community*
tdp_vars
tests/__pycache__
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,22 @@ disable 'tdp_user_table'
drop 'tdp_user_table'
```

## Automatic python tests with pytest and testinfra

Run the tests sequentially:

```sh
py.tests tests
```

Run the tests in parallel:

```sh
py.test -n 2 tests
```

**Note:** Running the tests in parallel requires more resources and tests might fail if resources are not sufficient.

## Web UI links

To access the components web UI links on your host , you will have to setup the IP adresses with their respective FQDN in `etc/hosts`, introduce the SSL certificate into your browser and install and configure Kerberos client. Luckely a container image has been created where verything is alraedy setup. However, the SSl certificate which is created with the `ansible_collections/tosit/tdp_prerequisites/playbooks/certificates.yml` playbook must already present in `files/tdp_getting_started_certs` otherwise the build will fail.
Expand Down
124 changes: 123 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ tdp-lib = { path = "tdp-lib", develop = true, extras=["visualization", "mysql",
passlib = "1.7.4"
jmespath = "1.0.1"
ansible-lint = {version = "6.17.2", markers = "platform_system != 'Windows'"}
pytest-xdist = "^3.6.1"
pytest-testinfra = "^10.1.1"

[build-system]
requires = ["poetry-core"]
Expand Down
Empty file added tests/__init__.py
Empty file.
Loading