From 89b5e4e3ac12f5ea985508ccff70ef6e4f38ebef Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Wed, 28 Aug 2024 15:52:56 +0200 Subject: [PATCH 01/19] feat(tests): setup qase integration --- qase.config.json | 32 ++++++++ setup.cfg | 1 + tests/test_quase_integration.py | 130 ++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+) create mode 100644 qase.config.json create mode 100644 tests/test_quase_integration.py diff --git a/qase.config.json b/qase.config.json new file mode 100644 index 0000000..fb400dd --- /dev/null +++ b/qase.config.json @@ -0,0 +1,32 @@ +{ + "mode": "testops", + "fallback": "report", + "report": { + "driver": "local", + "connection": { + "local": { + "path": "./build/qase-report", + "format": "json" + } + } + }, + "testops": { + "project": "NRPP", + "run": { + "title": "Automated PyTest run", + "complete": true + }, + "defect": true, + "bulk": true, + "chunk": 200 + }, + "framework": { + "pytest": { + "capture": { + "logs": true, + "http": true + } + } + }, + "environment": "local" +} diff --git a/setup.cfg b/setup.cfg index 51c51c8..9202d6a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,6 +34,7 @@ dev = autoflake oarepo-tools tests = + qase-pytest pytest>=7.1.2 psutil diff --git a/tests/test_quase_integration.py b/tests/test_quase_integration.py new file mode 100644 index 0000000..494b9e2 --- /dev/null +++ b/tests/test_quase_integration.py @@ -0,0 +1,130 @@ +from qase.pytest import qase + + +@qase.step("Step 01") +def step01(): + step02() + pass + + +@qase.step("Step 02") +def step02(): + pass + + +def test_with_steps_success(): + step01() + with qase.step("Step 03"): + pass + assert 1 == 1 + + +def test_with_steps_failed(): + step01() + with qase.step("Step 03"): + pass + assert 1 == 2 + +@qase.id(1) +def test_with_qase_id_success(): + assert 1 == 1 + + +@qase.id(2) +def test_with_qase_id_failed(): + assert 1 == 2 + + +@qase.title("Simple test success") +def test_with_title_success(): + assert 1 == 1 + + +@qase.title("Simple test failed") +def test_with_title_failed(): + assert 1 == 2 + + +@qase.description("Try to login to Qase TestOps using login and password 1") +def test_with_description_success(): + assert 1 == 1 + + +@qase.description("Try to login to Qase TestOps using login and password") +def test_with_description_failed(): + assert 1 == 2 + + +@qase.preconditions("*Precondition 1*. Markdown is supported.") +def test_with_preconditions_success(): + assert 1 == 1 + + +@qase.preconditions("*Precondition 1*. Markdown is supported.") +def test_with_preconditions_failed(): + assert 1 == 2 + + +@qase.postconditions("*Postcondition 1*. Markdown is supported.") +def test_with_postconditions_success(): + assert 1 == 1 + + +@qase.postconditions("*Postcondition 1*. Markdown is supported.1") +def test_with_postconditions_failed(): + assert 1 == 2 + + +@qase.severity("normal") +def test_with_severity_success(): + assert 1 == 1 + + +@qase.severity("normal") +def test_with_severity_failed(): + assert 1 == 2 + + +@qase.priority("high") +def test_with_priority_success(): + assert 1 == 1 + + +@qase.priority("high") +def test_with_priority_failed(): + assert 1 == 2 + + +@qase.layer("unit") +def test_with_layer_success(): + assert 1 == 1 + + +@qase.layer("unit") +def test_with_layer_failed(): + assert 1 == 2 + + +@qase.fields( + ("severity", "normal"), + ("custom_field", "value"), + ("priority", "high"), + ("layer", "unit"), + ("description", "Try to login to Qase TestOps using login and password"), + ("preconditions", "*Precondition 1*. Markdown is supported."), + ("postconditions", "*Postcondition 1*. Markdown is supported."), +) +def test_with_fields_success(): + assert 1 == 1 + + +@qase.fields( + ("severity", "normal"), + ("priority", "high"), + ("layer", "unit"), + ("description", "Try to login to Qase TestOps using login and password"), + ("preconditions", "*Precondition 1*. Markdown is supported."), + ("postconditions", "*Postcondition 1*. Markdown is supported."), +) +def test_with_fields_failed(): + assert 1 == 2 \ No newline at end of file From 1b501f4b3ad8272709cc0ffa697c96d5690df7aa Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Wed, 28 Aug 2024 15:57:56 +0200 Subject: [PATCH 02/19] feat(tests): setup qase gh actions env --- .github/workflows/build.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c604a05..1ee2797 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -66,6 +66,9 @@ jobs: redis-version: ${{ matrix.redis-version }} - name: Run tests + env: + QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} + QASE_TESTOPS_PROJECT: ${{ secrets.QASE_TESTOPS_PROJECT }} run: | ./run-tests.sh From 840b1e48ed526d2d61d1bde244dd8ef85159d941 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Wed, 28 Aug 2024 16:08:34 +0200 Subject: [PATCH 03/19] feat(tests): set secrets inherit --- .github/workflows/push.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 5c48a37..9cb1a47 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -9,6 +9,7 @@ permissions: jobs: build12: uses: ./.github/workflows/build.yaml + secrets: inherit with: oarepo: "12" From ce9e2ccdde1c4ac25065b4f0784859fab0fcb171 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Wed, 28 Aug 2024 16:22:19 +0200 Subject: [PATCH 04/19] Update build.yaml - set qase environment --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1ee2797..025f2e9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -69,6 +69,7 @@ jobs: env: QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} QASE_TESTOPS_PROJECT: ${{ secrets.QASE_TESTOPS_PROJECT }} + QASE_ENVIRONMENT: gh-ci run: | ./run-tests.sh From d88e7f0eaed3c1083868c8e0d49ad34d2439d472 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Thu, 29 Aug 2024 09:15:19 +0200 Subject: [PATCH 05/19] feat(tests): remove conflicting qase id --- tests/test_quase_integration.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_quase_integration.py b/tests/test_quase_integration.py index 494b9e2..504e5d2 100644 --- a/tests/test_quase_integration.py +++ b/tests/test_quase_integration.py @@ -25,12 +25,10 @@ def test_with_steps_failed(): pass assert 1 == 2 -@qase.id(1) def test_with_qase_id_success(): assert 1 == 1 -@qase.id(2) def test_with_qase_id_failed(): assert 1 == 2 From b090227f973177e9588f3a5b2a38c5975bee2686 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Thu, 29 Aug 2024 10:31:48 +0200 Subject: [PATCH 06/19] feat(tests): add failing http request --- tests/test_quase_integration.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_quase_integration.py b/tests/test_quase_integration.py index 504e5d2..90c38ca 100644 --- a/tests/test_quase_integration.py +++ b/tests/test_quase_integration.py @@ -1,4 +1,5 @@ from qase.pytest import qase +import requests @qase.step("Step 01") @@ -102,6 +103,12 @@ def test_with_layer_success(): def test_with_layer_failed(): assert 1 == 2 +@qase.layer("unit") +def test_request_with_failed(): + url = f"http://localhost/api/health" + response = requests.get(url) + assert response.status_code == 200 + @qase.fields( ("severity", "normal"), From fc378badb4776211b4dbbda08a036ec01dfaeb54 Mon Sep 17 00:00:00 2001 From: brablcp <85112304+brablcp@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:00:49 +0200 Subject: [PATCH 07/19] Update build.yaml small change... add env to the first place in steps section. --- .github/workflows/build.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 025f2e9..384060d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,6 +29,12 @@ jobs: - 5432:5432 steps: + # First Step - Ensure Environment Variables and Initial Setup + - name: Set up environment and initial configuration + env: + OAREPO_VERSION: ${{ inputs.oarepo }} + run: | + echo "Setting up environment..." - name: Show oarepo version run: | echo "OAREPO_VERSION: >>>$OAREPO_VERSION<<< >>>${{ inputs.oarepo }}<<<" From a2e0f62e6fcbcf17ad4284c4de53fd2b7cac9f93 Mon Sep 17 00:00:00 2001 From: brablcp <85112304+brablcp@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:41:20 +0200 Subject: [PATCH 08/19] Update build.yaml hokus pokus o kus -update parameters --- .github/workflows/build.yaml | 39 ++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 384060d..e2f45cb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,19 +3,46 @@ name: Build and test on: workflow_call: inputs: - oarepo: - description: OARepo version (11, 12, ...) + qase_api_base_url: + description: 'Qase API URL' required: true - default: "12" - type: string + qase_report: + description: 'Enabled/disabled reporting to Qase' + required: true + qase_project_code: + description: 'Qase project code' + required: true + qase_run_id: + description: 'Qase Run ID' + required: true + qase_run_complete: + description: 'Qase Run autocomplete' + required: true + oarepo: + description: OARepo version (11, 12, ...) + required: true + default: "12" + type: string env: OAREPO_VERSION: ${{ inputs.oarepo }} - + QASE_API_BASE_URL: ${{ inputs.qase_api_base_url }} + QASE_TESTOPS_PROJECT: ${{ inputs.qase_project_code }} + QASE_TESTOPS_RUN_ID: ${{ inputs.qase_run_id }} + QASE_TESTOPS_RUN_COMPLETE: true + QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} + jobs: build: runs-on: ubuntu-latest - services: + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - uses: cskmnrpt/qase-link-run@v2 + env: + QASE_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} + - run: npm install + - run: npm test services: postgres: image: postgres env: From d56d356db00f28a7a62ec08a75bff61449afa862 Mon Sep 17 00:00:00 2001 From: brablcp <85112304+brablcp@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:00:25 +0200 Subject: [PATCH 09/19] Update build.yaml --- .github/workflows/build.yaml | 93 ++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e2f45cb..3dc0f8b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -3,79 +3,58 @@ name: Build and test on: workflow_call: inputs: - qase_api_base_url: + qase_api_base_url: description: 'Qase API URL' required: true - qase_report: + qase_report: description: 'Enabled/disabled reporting to Qase' required: true - qase_project_code: + qase_project_code: description: 'Qase project code' required: true - qase_run_id: + qase_run_id: description: 'Qase Run ID' required: true - qase_run_complete: + qase_run_complete: description: 'Qase Run autocomplete' required: true - oarepo: - description: OARepo version (11, 12, ...) - required: true - default: "12" - type: string + oarepo: + description: 'OARepo version (11, 12, ...)' + required: true + default: "12" + type: string env: OAREPO_VERSION: ${{ inputs.oarepo }} QASE_API_BASE_URL: ${{ inputs.qase_api_base_url }} QASE_TESTOPS_PROJECT: ${{ inputs.qase_project_code }} QASE_TESTOPS_RUN_ID: ${{ inputs.qase_run_id }} - QASE_TESTOPS_RUN_COMPLETE: true + QASE_TESTOPS_RUN_COMPLETE: ${{ inputs.qase_run_complete }} QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} - + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - uses: cskmnrpt/qase-link-run@v2 - env: - QASE_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} - - run: npm install - - run: npm test services: - postgres: - image: postgres - env: - POSTGRES_PASSWORD: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - 5432:5432 - - steps: - # First Step - Ensure Environment Variables and Initial Setup + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - name: Set up environment and initial configuration - env: - OAREPO_VERSION: ${{ inputs.oarepo }} run: | echo "Setting up environment..." - - name: Show oarepo version - run: | echo "OAREPO_VERSION: >>>$OAREPO_VERSION<<< >>>${{ inputs.oarepo }}<<<" - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 + + - run: npm install + - run: npm test + + - uses: actions/setup-python@v3 with: python-version: "3.10" + - name: Cache pip uses: actions/cache@v3 with: - # This path is specific to Ubuntu path: ~/.cache/pip - # Look to see if there is a cache hit for the corresponding requirements file key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} restore-keys: | ${{ runner.os }}-pip- @@ -88,7 +67,7 @@ jobs: sudo sysctl -w fs.file-max=262144 sudo sysctl -w vm.max_map_count=262144 - - name: Runs Opensearch + - name: Run Opensearch uses: ankane/setup-opensearch@v1 with: plugins: analysis-icu @@ -96,16 +75,15 @@ jobs: - name: Start Redis uses: supercharge/redis-github-action@1.7.0 with: - redis-version: ${{ matrix.redis-version }} + redis-version: latest + + - name: Link Qase Run + uses: cskmnrpt/qase-link-run@v2 - name: Run tests env: - QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} - QASE_TESTOPS_PROJECT: ${{ secrets.QASE_TESTOPS_PROJECT }} QASE_ENVIRONMENT: gh-ci - run: | - ./run-tests.sh - + run: ./run-tests.sh - name: Build package to publish run: | @@ -115,14 +93,27 @@ jobs: run: | .venv/bin/pip freeze > requirements.txt - - name: Archive production artifacts + - name: Archive production artifacts (dist) uses: actions/upload-artifact@v3 with: name: dist path: dist - - name: Archive production artifacts + - name: Archive production artifacts (requirements) uses: actions/upload-artifact@v3 with: name: requirements.txt path: requirements.txt + + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - "5432:5432" From efdbc76db9a6e73b2ff00aeb4406be6c89f9ab48 Mon Sep 17 00:00:00 2001 From: brablcp <85112304+brablcp@users.noreply.github.com> Date: Thu, 5 Sep 2024 09:38:25 +0200 Subject: [PATCH 10/19] Update build.yaml --- .github/workflows/build.yaml | 64 ++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3dc0f8b..7c133b7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -35,22 +35,47 @@ env: jobs: build: runs-on: ubuntu-latest + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - "5432:5432" + steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - - name: Set up environment and initial configuration - run: | + # Checkout code + - uses: actions/checkout@v4 + + # Set up Node.js + - uses: actions/setup-node@v4 + + # Link with Qase + - uses: cskmnrpt/qase-link-run@v2 + env: + QASE_API_TOKEN: ${{ env.QASE_API_TOKEN }} + + # Install npm dependencies and run tests + - run: npm install + - run: npm test + + # Ensure environment variables and initial setup + - name: Set up environment and initial configuration + run: | echo "Setting up environment..." echo "OAREPO_VERSION: >>>$OAREPO_VERSION<<< >>>${{ inputs.oarepo }}<<<" - - run: npm install - - run: npm test - + # Set up Python - uses: actions/setup-python@v3 with: python-version: "3.10" + # Cache pip dependencies - name: Cache pip uses: actions/cache@v3 with: @@ -60,6 +85,7 @@ jobs: ${{ runner.os }}-pip- ${{ runner.os }}- + # Configure sysctl limits - name: Configure sysctl limits run: | sudo swapoff -a @@ -67,32 +93,41 @@ jobs: sudo sysctl -w fs.file-max=262144 sudo sysctl -w vm.max_map_count=262144 + # Run Opensearch - name: Run Opensearch uses: ankane/setup-opensearch@v1 with: plugins: analysis-icu + # Start Redis - name: Start Redis uses: supercharge/redis-github-action@1.7.0 with: redis-version: latest + # Link Qase Run - name: Link Qase Run uses: cskmnrpt/qase-link-run@v2 + env: + QASE_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} + # Run tests - name: Run tests env: QASE_ENVIRONMENT: gh-ci run: ./run-tests.sh + # Build Python package - name: Build package to publish run: | .venv/bin/python setup.py sdist bdist_wheel + # Freeze Python packages - name: Freeze packages run: | .venv/bin/pip freeze > requirements.txt + # Archive production artifacts - name: Archive production artifacts (dist) uses: actions/upload-artifact@v3 with: @@ -104,16 +139,3 @@ jobs: with: name: requirements.txt path: requirements.txt - - services: - postgres: - image: postgres - env: - POSTGRES_PASSWORD: postgres - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - "5432:5432" From 9b7ba98a873d5b742f8a8505823a26eeaf307513 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Thu, 5 Sep 2024 11:28:15 +0200 Subject: [PATCH 11/19] fix(qase): link wrkflow run with qase --- .github/workflows/build.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c604a05..f9c60de 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,6 +29,10 @@ jobs: - 5432:5432 steps: + - name: Link workflow run with Qase + uses: qase-tms/qase-link-run@main + env: + QASE_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} - name: Show oarepo version run: | echo "OAREPO_VERSION: >>>$OAREPO_VERSION<<< >>>${{ inputs.oarepo }}<<<" @@ -64,7 +68,6 @@ jobs: uses: supercharge/redis-github-action@1.7.0 with: redis-version: ${{ matrix.redis-version }} - - name: Run tests run: | ./run-tests.sh From fd23f8ad89179310edba3ebcae9942bfa40241df Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Thu, 5 Sep 2024 11:33:24 +0200 Subject: [PATCH 12/19] fix(qase): pass full env --- .github/workflows/build.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f9c60de..c7c3a4d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -32,7 +32,10 @@ jobs: - name: Link workflow run with Qase uses: qase-tms/qase-link-run@main env: + QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} QASE_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} + QASE_TESTOPS_PROJECT: ${{ secrets.QASE_TESTOPS_PROJECT }} + QASE_ENVIRONMENT: gh-ci - name: Show oarepo version run: | echo "OAREPO_VERSION: >>>$OAREPO_VERSION<<< >>>${{ inputs.oarepo }}<<<" @@ -69,6 +72,10 @@ jobs: with: redis-version: ${{ matrix.redis-version }} - name: Run tests + env: + QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} + QASE_TESTOPS_PROJECT: ${{ secrets.QASE_TESTOPS_PROJECT }} + QASE_ENVIRONMENT: gh-ci run: | ./run-tests.sh From 624a95480d2975c4957c24cd321d9923f0415a62 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Thu, 5 Sep 2024 11:37:21 +0200 Subject: [PATCH 13/19] fix(qase): add back missing secrets inherit --- .github/workflows/push.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 5c48a37..9cb1a47 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -9,6 +9,7 @@ permissions: jobs: build12: uses: ./.github/workflows/build.yaml + secrets: inherit with: oarepo: "12" From e300da174b42681fa12bce7164da72f74463b85b Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Thu, 5 Sep 2024 11:40:59 +0200 Subject: [PATCH 14/19] fix(qase): use different linking gh action --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c7c3a4d..8e23cee 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -30,7 +30,7 @@ jobs: steps: - name: Link workflow run with Qase - uses: qase-tms/qase-link-run@main + uses: cskmnrpt/qase-link-run@v2 env: QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} QASE_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} From 9e507e65035399f4c48459c7cd49b740272430b4 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Thu, 5 Sep 2024 11:50:45 +0200 Subject: [PATCH 15/19] fix(qase): set required qase api url --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8e23cee..5ab9924 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,6 +11,7 @@ on: env: OAREPO_VERSION: ${{ inputs.oarepo }} + QASE_API_BASE_URL: 'https://app.qase.io/api/v1' jobs: build: From 810e760c1280bb5ed448af45073cab6c9b19c53b Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Mon, 9 Sep 2024 09:04:18 +0200 Subject: [PATCH 16/19] feat(qase): add manual qase workflow dispatch --- .github/workflows/build.yaml | 1 - .github/workflows/manual-qase.yaml | 38 ++++++++++++++++++++++++++++++ .github/workflows/manual.yaml | 1 + 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/manual-qase.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5ab9924..8e23cee 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,7 +11,6 @@ on: env: OAREPO_VERSION: ${{ inputs.oarepo }} - QASE_API_BASE_URL: 'https://app.qase.io/api/v1' jobs: build: diff --git a/.github/workflows/manual-qase.yaml b/.github/workflows/manual-qase.yaml new file mode 100644 index 0000000..6d4fc4a --- /dev/null +++ b/.github/workflows/manual-qase.yaml @@ -0,0 +1,38 @@ +name: Build and test from Qase +on: + workflow_dispatch: + inputs: + qase_api_base_url: + description: 'Qase API URL' + required: true + qase_report: + description: 'Enabled/disabled reporting to Qase' + required: true + qase_project_code: + description: 'Qase project code' + required: true + qase_run_id: + description: 'Qase Run ID' + required: true + qase_run_complete: + description: 'Qase Run autocomplete' + required: true + oarepo: + description: OARepo version (11, 12, ...) + required: true + default: "12" + type: string +env: + QASE_API_BASE_URL: ${{ inputs.qase_api_base_url }} + QASE_TESTOPS_PROJECT: ${{ inputs.qase_project_code }} + QASE_TESTOPS_RUN_ID: ${{ inputs.qase_run_id }} + QASE_TESTOPS_RUN_COMPLETE: true + QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} + QASE_ENVIRONMENT: gh-ci + +jobs: + build: + uses: ./.github/workflows/build.yaml + secrets: inherit + with: + oarepo: ${{ github.event.inputs.oarepo }} \ No newline at end of file diff --git a/.github/workflows/manual.yaml b/.github/workflows/manual.yaml index 841c158..d28d13b 100644 --- a/.github/workflows/manual.yaml +++ b/.github/workflows/manual.yaml @@ -11,5 +11,6 @@ on: jobs: build: uses: ./.github/workflows/build.yaml + secrets: inherit with: oarepo: ${{ github.event.inputs.oarepo }} From 311e07878666baf9ae28510ce73d77a58b4e6f95 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Mon, 9 Sep 2024 09:08:01 +0200 Subject: [PATCH 17/19] feat(qase): extract link job from buildsx --- .github/workflows/build.yaml | 7 ------- .github/workflows/manual-qase.yaml | 11 +++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8e23cee..ddb0a97 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,13 +29,6 @@ jobs: - 5432:5432 steps: - - name: Link workflow run with Qase - uses: cskmnrpt/qase-link-run@v2 - env: - QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} - QASE_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} - QASE_TESTOPS_PROJECT: ${{ secrets.QASE_TESTOPS_PROJECT }} - QASE_ENVIRONMENT: gh-ci - name: Show oarepo version run: | echo "OAREPO_VERSION: >>>$OAREPO_VERSION<<< >>>${{ inputs.oarepo }}<<<" diff --git a/.github/workflows/manual-qase.yaml b/.github/workflows/manual-qase.yaml index 6d4fc4a..dea1e01 100644 --- a/.github/workflows/manual-qase.yaml +++ b/.github/workflows/manual-qase.yaml @@ -31,6 +31,17 @@ env: QASE_ENVIRONMENT: gh-ci jobs: + link: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: cskmnrpt/qase-link-run@v2 + name: Link workflow run with Qase + env: + QASE_TESTOPS_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} + QASE_API_TOKEN: ${{ secrets.QASE_TESTOPS_API_TOKEN }} + QASE_TESTOPS_PROJECT: ${{ secrets.QASE_TESTOPS_PROJECT }} + QASE_ENVIRONMENT: gh-ci build: uses: ./.github/workflows/build.yaml secrets: inherit From fc70fee6ab323dabad01967a9a801c7856957ea4 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Mon, 9 Sep 2024 09:23:15 +0200 Subject: [PATCH 18/19] feat(qase): hotfix for gh to recognize new workflow --- .github/workflows/manual-qase.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/manual-qase.yaml b/.github/workflows/manual-qase.yaml index dea1e01..f3127ee 100644 --- a/.github/workflows/manual-qase.yaml +++ b/.github/workflows/manual-qase.yaml @@ -1,5 +1,6 @@ name: Build and test from Qase on: + push: workflow_dispatch: inputs: qase_api_base_url: From cabc4bc99462bad2303ff173de7fc8adec340392 Mon Sep 17 00:00:00 2001 From: Miroslav Bauer Date: Mon, 9 Sep 2024 09:23:48 +0200 Subject: [PATCH 19/19] feat(qase): hotfix roll back --- .github/workflows/manual-qase.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/manual-qase.yaml b/.github/workflows/manual-qase.yaml index f3127ee..dea1e01 100644 --- a/.github/workflows/manual-qase.yaml +++ b/.github/workflows/manual-qase.yaml @@ -1,6 +1,5 @@ name: Build and test from Qase on: - push: workflow_dispatch: inputs: qase_api_base_url: