forked from RedHatInsights/insights-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: basic integration testing with tmt
Introduce a minimal setup for integration tests of insights-client. The tests are written using pytest and an helper plugin for insights-client and other Red Hat client tools [1]. The tests are wrapped as single "integration" test for tmt [2], which makes it possible to run them automatically e.g. in testing-farm. There is a simple test added to show how the setup for the tests works. [1] https://github.com/ptoscano/pytest-client-tools/ [2] https://github.com/teemtee/tmt/ Signed-off-by: Pino Toscano <[email protected]>
- Loading branch information
Showing
6 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
git+https://github.com/ptoscano/pytest-client-tools@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
def test_version(insights_client): | ||
proc = insights_client.run("--version") | ||
assert b"Client: " in proc.stdout | ||
assert b"Core: " in proc.stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
summary: rhc test suite | ||
discover: | ||
how: fmf | ||
|
||
execute: | ||
how: tmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
summary: Runs tmt tests | ||
test: ./test.sh | ||
duration: 10m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -eu | ||
set -x | ||
|
||
# get to project root | ||
cd ../../../ | ||
|
||
dnf --setopt install_weak_deps=False install -y \ | ||
podman git-core python3-pip python3-pytest | ||
|
||
python3 -m venv venv | ||
# shellcheck disable=SC1091 | ||
. venv/bin/activate | ||
|
||
pip install -r integration-tests/requirements.txt | ||
|
||
pytest -v integration-tests |