From 9663d0662da6307ab2c8a798fc95e1eaf2abfb72 Mon Sep 17 00:00:00 2001 From: zpetrace Date: Wed, 14 Aug 2024 16:30:51 +0200 Subject: [PATCH] feat(workflow): Adding a GitHub workflow for test docstrings validation --- .github/workflows/docstring_validation.yml | 49 +++++++++++++++++++ integration-tests/custom_betelgeuse_config.py | 15 ++++++ integration-tests/testimony.yaml | 49 +++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 .github/workflows/docstring_validation.yml create mode 100644 integration-tests/custom_betelgeuse_config.py create mode 100644 integration-tests/testimony.yaml diff --git a/.github/workflows/docstring_validation.yml b/.github/workflows/docstring_validation.yml new file mode 100644 index 00000000..02000983 --- /dev/null +++ b/.github/workflows/docstring_validation.yml @@ -0,0 +1,49 @@ +--- +name: Test Docstrings Validation + +on: + pull_request: + paths: + - "integration-tests/**" + +jobs: + betelgeuse: + name: "betelgeuse dry-run" + runs-on: ubuntu-latest + container: + image: fedora:latest + + steps: + - uses: actions/checkout@v4 + + - name: Base setup for Betelgeuse + run: | + dnf --setopt install_weak_deps=False install -y \ + python3-pip + python3 -m pip install betelgeuse + + - name: Run Betelgeuse + run: | + PYTHONPATH=integration-tests/ betelgeuse --config-module \ + custom_betelgeuse_config test-case --dry-run \ + integration-tests/ dryrun_project ./test_case.xml + + 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.yaml integration-tests/ diff --git a/integration-tests/custom_betelgeuse_config.py b/integration-tests/custom_betelgeuse_config.py new file mode 100644 index 00000000..19735d56 --- /dev/null +++ b/integration-tests/custom_betelgeuse_config.py @@ -0,0 +1,15 @@ +from betelgeuse import default_config + +TESTCASE_CUSTOM_FIELDS = default_config.TESTCASE_CUSTOM_FIELDS + ( + "casecomponent", + "requirement", + "subsystemteam", + "tier", + "reference", +) + +DEFAULT_CASECOMPONENT_VALUE = "" +DEFAULT_REQUIREMENT_VALUE = "" +DEFAULT_SUBSYSTEMTEAM_VALUE = "" +DEFAULT_TIER_VALUE = "" +DEFAULT_REFERENCE_VALUE = "" diff --git a/integration-tests/testimony.yaml b/integration-tests/testimony.yaml new file mode 100644 index 00000000..96eb5148 --- /dev/null +++ b/integration-tests/testimony.yaml @@ -0,0 +1,49 @@ +--- +Id: + casesensitive: false + required: true + 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 +Tier: + casesensitive: false + required: true + type: choice + choices: + - Tier 1 + - Tier 2 + - Tier 3 +Steps: {} +ExpectedResults: {} +Reference: + casesensitive: false + required: true + type: string