From 9ed53d92a4db1519ad873939322f036116d22b4f Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Sat, 14 Sep 2024 21:36:28 +0200 Subject: [PATCH] ci: more testing CI --- .gitea/workflows/pull-request-open.yml | 25 ++++++++++++++----- .../modules/test_public_cloud_config_info.py | 2 +- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/pull-request-open.yml b/.gitea/workflows/pull-request-open.yml index a203c7f..794707e 100644 --- a/.gitea/workflows/pull-request-open.yml +++ b/.gitea/workflows/pull-request-open.yml @@ -46,9 +46,22 @@ jobs: with: python-version: "3.10" - - name: Run unit tests - uses: ansible-community/ansible-test-gh-action@release/v1 - with: - ansible-core-version: stable-2.14 - target-python-version: 3.10 - testing-type: units + - name: Install requirements + run: pip3 install -r tests/requirements.txt + shell: bash + working-directory: ${{ gitea.workspace }} + + - name: Setup testing environment + run: ansible-galaxy collection install ${{ gitea.workspace }} + shell: bash + working-directory: ${{ gitea.workspace }} + + - name: Run ansible unit tests + run: ansible-test units --coverage + shell: bash + working-directory: ${{ gitea.workspace }} + + - name: Print coverage informations + run: ansible-test coverage report + shell: bash + working-directory: ${{ gitea.workspace }} diff --git a/tests/unit/plugins/modules/test_public_cloud_config_info.py b/tests/unit/plugins/modules/test_public_cloud_config_info.py index abd6109..032d6da 100644 --- a/tests/unit/plugins/modules/test_public_cloud_config_info.py +++ b/tests/unit/plugins/modules/test_public_cloud_config_info.py @@ -207,7 +207,7 @@ class TestPublicCloudConfigInfoModule(unittest.TestCase): captured_output = json.loads(e.value.args[0]) assert "msg" in captured_output - assert not captured_output["msg"] == "Request timeout" + assert captured_output["msg"] == "Request timeout" mock_fail_json.assert_called_once() @patch(