From eeb159c42c211d3d8381a3fbd2afdf9a58b3152b Mon Sep 17 00:00:00 2001 From: zpetrace Date: Fri, 30 Aug 2024 12:25:09 +0200 Subject: [PATCH] Adding a Github workflow fo testimony validation --- .github/workflows/testimony.yml | 27 ++++++++++++++++++ integration-tests/test_status.py | 4 +-- integration-tests/test_tags.py | 22 ++++++-------- integration-tests/testimony.yml | 49 ++++++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/testimony.yml create mode 100644 integration-tests/testimony.yml diff --git a/.github/workflows/testimony.yml b/.github/workflows/testimony.yml new file mode 100644 index 00000000..9d4ea2f1 --- /dev/null +++ b/.github/workflows/testimony.yml @@ -0,0 +1,27 @@ +--- +name: Testimony Validation + +on: + pull_request: + paths: + - "integration-tests/**" + +jobs: + testimony: + name: testimony validate + runs-on: ubuntu-latest + container: + image: fedora:latest + + steps: + - name: Setup for Testimony + run: | + dnf --setopt install_weak_deps=False install -y \ + python3-pip + python3 -m pip install testimony + - uses: actions/checkout@v4 + + - name: Run Testimony + run: | + testimony validate --config \ + integration-tests/testimony.yml integration-tests/test* diff --git a/integration-tests/test_status.py b/integration-tests/test_status.py index 6f9c14b7..ab2063cd 100644 --- a/integration-tests/test_status.py +++ b/integration-tests/test_status.py @@ -32,7 +32,7 @@ def test_status_registered(external_candlepin, insights_client): 2. Wait time completes without issues 3. If 'legacy_upload' is True, output contains "Insights API confirms registration." If 'legacy_upload' is False, output is "This host - is registered.\n" + is registered." """ insights_client.register() assert conftest.loop_until(lambda: insights_client.is_registered) @@ -63,7 +63,7 @@ def test_status_unregistered(external_candlepin, insights_client): 2. If 'legacy_upload' is True return code is 1 and output contains "Insights API says this machine is NOT registered." If 'legacy_upload' is False return code is 0 and output contains - "This host is unregistered.\n" + "This host is unregistered." """ # running unregistration to ensure system is unregistered with contextlib.suppress(Exception): diff --git a/integration-tests/test_tags.py b/integration-tests/test_tags.py index 5af48536..bdc36962 100644 --- a/integration-tests/test_tags.py +++ b/integration-tests/test_tags.py @@ -23,23 +23,19 @@ def test_tags(insights_client, external_inventory, test_config): :description: Test how the tags generated, and check the tags on inventory :reference: - :tier: Tier 1 - steps: - 1. Register insights-client, and check satellite related - tags on the inventory if the test env is satellte. - + :tags: Tier 1 + :steps: + 1. Register insights-client, and check satellite related tags + on the inventory if the test env is satellte. 2. Run insights-client with the --group - 3. Add a new tag in tags.yaml, and run insights-client, - then check the inventory + then check the inventory :expectedresults: - 1. system is registered to insights, and there will be - satellite related tags supported by branch_info with - satellite env. - + 1. System is registered to insights, and there will be + satellite related tags supported by branch_info with + satellite env. 2. tags.yaml will be created with group option, and new tag - generated by tags.yaml - + generated by tags.yaml 3. The new tag shows on inventory by modifying tags.yaml """ # Remove the tags.yaml if it exists diff --git a/integration-tests/testimony.yml b/integration-tests/testimony.yml new file mode 100644 index 00000000..b4792e45 --- /dev/null +++ b/integration-tests/testimony.yml @@ -0,0 +1,49 @@ +--- +Id: + casesensitive: false + required: true + type: string +Reference: + casesensitive: false + required: false + type: string +CaseComponent: + casesensitive: false + required: true + type: string +Requirement: + casesensitive: false + required: true + type: choice + choices: + - RHSS-291297 +SubSystemTeam: + casesensitive: false + required: true + type: choice + choices: + - sst_csi_client_tools +CaseAutomation: + casesensitive: false + required: true + type: string +Upstream: + casesensitive: false + type: string +Title: + casesensitive: false + type: string +Description: + casesensitive: false + required: true + type: string +Tags: + casesensitive: true + required: true + type: choice + choices: + - Tier 1 + - Tier 2 + - Tier 3 +Steps: {} +ExpectedResults: {}