Run Tests #175
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
name: Run Tests | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 7 * * *' # Scheduled every day at 01:00 UTC | |
workflow_dispatch: # Allows manual run | |
inputs: | |
Functional: | |
type: boolean | |
description: Run functional tests | |
required: false | |
default: true | |
BDD: | |
type: boolean | |
description: Run BDD tests | |
required: false | |
default: true | |
UX: | |
type: boolean | |
description: Run UX tests | |
required: false | |
default: true | |
Performance: | |
type: boolean | |
description: Run Performance tests | |
required: false | |
default: true | |
Contract: | |
type: boolean | |
description: Run Contract tests | |
required: false | |
default: true | |
jobs: | |
Functional_Tests: | |
runs-on: ubuntu-latest | |
name: Functional | |
if: always() && (github.event.inputs.Functional == 'true' || !github.event.inputs.Functional) | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | |
- name: Setup Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r functional-tests/requirements.txt | |
pip install -e . | |
- name: Load secrets | |
if: always() | |
continue-on-error: true | |
run: echo "$SECRETS" >> ./config/.secrets.yaml | |
env: | |
SECRETS: ${{ secrets.INTEGRATION_TESTS_SECRETS }} | |
id: load_secrets | |
- name: Run functional tests | |
if: always() | |
continue-on-error: true | |
run: | | |
pytest functional-tests/tests/ --alluredir allure-results | |
- name: Save functional test results | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
id: upload_functional_test_results | |
with: | |
name: allure-results-functional | |
path: allure-results | |
- name: Load test report history | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | |
if: always() | |
continue-on-error: true | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Build test report | |
uses: simple-elf/allure-report-action@91e6ff976a8b2303f2551ca36c39ba5256952c08 | |
if: always() | |
continue-on-error: true | |
with: | |
gh_pages: gh-pages | |
allure_results: allure-results | |
allure_report: allure-report | |
allure_history: allure-history | |
subfolder: functional | |
keep_reports: 30 | |
- name: Publish test report | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e | |
if: always() | |
continue-on-error: true | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: allure-history | |
keep_files: true | |
BDD_Tests: | |
runs-on: ubuntu-latest | |
needs: Functional_Tests | |
if: always() && (github.event.inputs.BDD == 'true' || !github.event.inputs.BDD) | |
name: BDD | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | |
- name: Setup Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r bdd-tests/requirements.txt | |
pip install -e . | |
- name: Load secrets | |
if: always() | |
continue-on-error: true | |
run: echo "$SECRETS" >> ./config/.secrets.yaml | |
env: | |
SECRETS: ${{ secrets.INTEGRATION_TESTS_SECRETS }} | |
id: load_secrets | |
- name: Run BDD tests | |
if: always() | |
continue-on-error: true | |
run: | | |
behave bdd-tests/ --format allure_behave.formatter:AllureFormatter -o allure-results | |
- name: Save BDD test results | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
id: upload_bdd_test_results | |
with: | |
name: allure-results-bdd | |
path: allure-results | |
- name: Load test report history | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | |
if: always() | |
continue-on-error: true | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Build test report | |
uses: simple-elf/allure-report-action@91e6ff976a8b2303f2551ca36c39ba5256952c08 | |
if: always() | |
continue-on-error: true | |
with: | |
gh_pages: gh-pages | |
allure_results: allure-results | |
allure_report: allure-report | |
allure_history: allure-history | |
subfolder: bdd | |
keep_reports: 30 | |
- name: Publish test report | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e | |
if: always() | |
continue-on-error: true | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: allure-history | |
keep_files: true | |
UX_Tests: | |
runs-on: ubuntu-latest | |
needs: BDD_Tests | |
if: always() && (github.event.inputs.UX == 'true' || !github.event.inputs.UX) | |
name: UX | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | |
- name: Setup Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install playwright | |
pip install pytest-playwright | |
playwright install-deps | |
playwright install | |
pip install -e . | |
- name: Load secrets | |
if: always() | |
continue-on-error: true | |
run: echo "$SECRETS" >> ./config/.secrets.yaml | |
env: | |
SECRETS: ${{ secrets.INTEGRATION_TESTS_SECRETS }} | |
id: load_secrets | |
- name: Run UX tests | |
if: always() | |
continue-on-error: true | |
run: | | |
pytest ux-tests/tests/ --alluredir allure-results | |
- name: Save UX test results | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
id: upload_ux_test_results | |
with: | |
name: allure-results-ux | |
path: allure-results | |
- name: Load test report history | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | |
if: always() | |
continue-on-error: true | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Build test report | |
uses: simple-elf/allure-report-action@91e6ff976a8b2303f2551ca36c39ba5256952c08 | |
if: always() | |
continue-on-error: true | |
with: | |
gh_pages: gh-pages | |
allure_results: allure-results | |
allure_report: allure-report | |
allure_history: allure-history | |
subfolder: ux | |
keep_reports: 30 | |
- name: Publish test report | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e | |
if: always() | |
continue-on-error: true | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: allure-history | |
keep_files: true | |
Performance_Tests: | |
runs-on: ubuntu-latest | |
needs: UX_Tests | |
if: always() && (github.event.inputs.Performance == 'true' || !github.event.inputs.Performance) | |
name: Performance | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | |
- name: Setup Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r performance-tests/requirements.txt | |
pip install -e . | |
- name: Load secrets | |
if: always() | |
continue-on-error: true | |
run: echo "$SECRETS" >> ./config/.secrets.yaml | |
env: | |
SECRETS: ${{ secrets.INTEGRATION_TESTS_SECRETS }} | |
id: load_secrets | |
- name: Run Performance tests | |
if: always() | |
continue-on-error: true | |
run: | | |
locust -f performance-tests/locustfile.py --headless --users 5 --spawn-rate 1 --run-time 10 --host=http://example.com --html .report/report.html | |
Contract_Tests: | |
runs-on: ubuntu-latest | |
needs: Performance_Tests | |
if: always() && (github.event.inputs.Contract == 'true' || !github.event.inputs.Contract) | |
name: Contract | |
steps: | |
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | |
- name: Setup Python | |
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 #v5.2.0 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r contract-tests/requirements.txt | |
pip install -e . | |
- name: Load secrets | |
if: always() | |
continue-on-error: true | |
run: echo "$SECRETS" >> ./config/.secrets.yaml | |
env: | |
SECRETS: ${{ secrets.INTEGRATION_TESTS_SECRETS }} | |
id: load_secrets | |
- name: Run contract tests | |
if: always() | |
continue-on-error: true | |
run: | | |
pytest contract-tests/ --disable-warnings --alluredir allure-results | |
- name: Save contract test results | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | |
id: upload_contract_test_results | |
with: | |
name: allure-results-contract | |
path: allure-results | |
- name: Load test report history | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | |
if: always() | |
continue-on-error: true | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Build test report | |
uses: simple-elf/allure-report-action@91e6ff976a8b2303f2551ca36c39ba5256952c08 | |
if: always() | |
continue-on-error: true | |
with: | |
gh_pages: gh-pages | |
allure_results: allure-results | |
allure_report: allure-report | |
allure_history: allure-history | |
subfolder: contract | |
keep_reports: 30 | |
- name: Publish test report | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e | |
if: always() | |
continue-on-error: true | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: allure-history | |
keep_files: true | |
Aggregate_Results: | |
runs-on: ubuntu-latest | |
needs: Contract_Tests | |
if: always() | |
steps: | |
- name: Copy functional results | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
path: allure-results | |
merge-multiple: true | |
run-id: upload_functional_test_results | |
- name: Copy BDD results | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
path: allure-results | |
merge-multiple: true | |
run-id: upload_bdd_test_results | |
- name: Copy UX results | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
path: allure-results | |
merge-multiple: true | |
run-id: upload_ux_test_results | |
- name: Copy contract results | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
path: allure-results | |
merge-multiple: true | |
run-id: upload_contract_test_results | |
- name: Load test report history | |
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 #v4.2.0 | |
if: always() | |
continue-on-error: true | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Build test report | |
uses: simple-elf/allure-report-action@91e6ff976a8b2303f2551ca36c39ba5256952c08 | |
if: always() | |
continue-on-error: true | |
with: | |
gh_pages: gh-pages | |
allure_results: allure-results | |
allure_report: allure-report | |
allure_history: allure-history | |
keep_reports: 30 | |
- name: Publish test report | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e | |
if: always() | |
continue-on-error: true | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: allure-history | |
keep_files: true | |
Extract_Fail_Rate_And_Notify: | |
needs: Aggregate_Results | |
if: always() | |
uses: ./.github/workflows/extract_allure_fail_rate.yml | |
with: | |
THRESHOLD: 20 | |
secrets: inherit |