Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record Legacy and Develop cassette in separate steps instead of pipelines #387

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions .github/workflows/record-vcr-cassettes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
workflow_dispatch: # run on request (no need for PR)

env:
GETI_USERNAME: ${{ secrets.GETI_USERNAME }}
GETI_PASSWORD: ${{ secrets.GETI_PASSWORD }}
# Python version
PYTHON_VERSION: 3.9

Expand All @@ -19,14 +21,6 @@ permissions:
jobs:
recording_integration_tests:

strategy:
matrix:
include:
- geti_platform_version: "LEGACY"
host-name: "GETI_HOST"
- geti_platform_version: "DEVELOP"
host-name: "GETI_DEVELOP_HOST"

runs-on: [self-hosted, sdk-runner]

steps:
Expand All @@ -48,34 +42,44 @@ jobs:
source $VIRTUALENV_DIRECTORY/bin/activate
pip install ".[dev]"

- name: Record integration test cassettes
- name: Record integration test cassettes [legacy platform]
# Proxy settings have to be configured and GETI_HOST set to full address before
# tests can run
#
# NOTE: This step executes all tests in the `tests` directory in `RECORD` mode
run: |
export no_proxy=$${{ matrix.host-name }},$no_proxy
export NO_PROXY=$${{ matrix.host-name }},$NO_PROXY
export GETI_HOST=https://$${{ matrix.host-name }}
export no_proxy=$GETI_HOST,$no_proxy
export NO_PROXY=$GETI_HOST,$NO_PROXY
export GETI_HOST=https://$GETI_HOST

pytest tests/pre-merge/integration --html=$REPORT_DIRECTORY/integration_test_report.html --self-contained-html
pytest tests/pre-merge/integration --html=$REPORT_DIRECTORY/integration_test_report_legacy.html --self-contained-html
env:
# Login details for the Geti instance to run the tests against
# Secrets are configured on the repository level (Settings > Secrets)
GETI_HOST: ${{ secrets.GETI_HOST }}
GETI_DEVELOP_HOST: ${{ secrets.GETI_DEVELOP_HOST }}
GETI_PLATFORM_VERSION: "LEGACY"

GETI_USERNAME: ${{ secrets.GETI_USERNAME }}
GETI_PASSWORD: ${{ secrets.GETI_PASSWORD }}
- name: Record integration test cassettes [develop platform]
# Proxy settings have to be configured and GETI_HOST set to full address before
# tests can run
# NOTE: This step executes all tests in the `tests` directory in `RECORD` mode
run: |
export no_proxy=$GETI_HOST,$no_proxy
export NO_PROXY=$GETI_HOST,$NO_PROXY
export GETI_HOST=https://$GETI_HOST

GETI_PLATFORM_VERSION: ${{ matrix.geti_platform_version }}
pytest tests/pre-merge/integration --html=$REPORT_DIRECTORY/integration_test_report_develop.html --self-contained-html
env:
# Login details for the Geti instance to run the tests against
# Secrets are configured on the repository level (Settings > Secrets)
GETI_HOST: ${{ secrets.GETI_DEVELOP_HOST }}
GETI_PLATFORM_VERSION: "DEVELOP"

- name: Commit files
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add tests/fixtures/cassettes
git commit -m "Update ${{ matrix.geti_platform_version }} VCR cassette"
git commit -m "Update VCR cassette"
git fetch

- name: Push changes
Expand Down
Loading