Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Davidyuk <[email protected]>
  • Loading branch information
igor-davidyuk committed Apr 30, 2024
1 parent 3aa0701 commit 3c09187
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ HTTP-Session:
- 'geti_sdk/http_session/*'
- 'tests/pre-merge/integration/http_session/*'

Geti-Core:
SDK-Core:
- changed-files:
- any-glob-to-any-file:
- 'geti_sdk/geti.py'
Expand Down
33 changes: 9 additions & 24 deletions .github/workflows/record-vcr-cassettes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
PYTHON_VERSION: 3.10

# Other environment variables used in the tests
TESTS_TARGET: "tests/pre-merge/integration"
TEST_TARGET: "tests/pre-merge/integration"
TEST_MODE: "RECORD"
REPORT_DIRECTORY: reports
VIRTUALENV_DIRECTORY: .venv
Expand All @@ -35,35 +35,20 @@ jobs:
- name: Smart CI
if: github.event_name == 'pull_request'
run: |
export TESTS_TARGET=""
if [[ ${{ contains(steps.label-the-PR.outputs.all-labels, 'geti-core') }} ]]; then
export TESTS_TARGET=$TESTS_TARGET:"tests/pre-merge/integration/test_geti.py "
export TEST_TARGET=""
if [[ ${{ contains(steps.label-the-PR.outputs.all-labels, 'SDK-Core') }} ]]; then
export TEST_TARGET="tests/pre-merge/integration/test_geti.py $TEST_TARGET"
fi
if [[ ${{ contains(steps.label-the-PR.outputs.all-labels, 'Rest-Clients') }} ]]; then
export TESTS_TARGET=$TESTS_TARGET:"tests/pre-merge/integration/rest_clients/ "
export TEST_TARGET="tests/pre-merge/integration/rest_clients/ $TEST_TARGET"
fi
if [[ ${{ contains(steps.label-the-PR.outputs.all-labels, 'HTTP-Session') }} ]]; then
export TESTS_TARGET=$TESTS_TARGET:"tests/pre-merge/integration/http_session/ "
export TEST_TARGET="tests/pre-merge/integration/http_session/ $TEST_TARGET"
fi
if [[ ${{ contains(steps.label-the-PR.outputs.all-labels, 'Geti-Utils') }} ]]; then
export TESTS_TARGET=$TESTS_TARGET:"tests/pre-merge/integration/utils/ "
export TEST_TARGET="tests/pre-merge/integration/utils/ $TEST_TARGET"
fi
# # An approach to test:
# export TESTS_TARGET=""
# declare -A labels_to_tests=(
# ["geti-core"]="tests/pre-merge/integration/test_geti.py "
# ["Rest-Clients"]="tests/pre-merge/integration/rest_clients/ "
# ["HTTP-Session"]="tests/pre-merge/integration/http_session/ "
# ["Geti-Utils"]="tests/pre-merge/integration/utils/ "
# )
# for label in "${!labels_to_tests[@]}"; do
# if [[ ${{ contains(steps.label-the-PR.outputs.all-labels, label) }} ]]; then
# export TESTS_TARGET=$TESTS_TARGET:"${labels_to_tests[$label]}"
# fi
# done
- name: Checkout repository
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -91,7 +76,7 @@ jobs:
export NO_PROXY=$GETI_HOST,$NO_PROXY
export GETI_HOST=https://$GETI_HOST
pytest $TESTS_TARGET --html=$REPORT_DIRECTORY/integration_test_report_legacy.html --self-contained-html
pytest $TEST_TARGET --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)
Expand All @@ -107,7 +92,7 @@ jobs:
export NO_PROXY=$GETI_HOST,$NO_PROXY
export GETI_HOST=https://$GETI_HOST
pytest $TESTS_TARGET --html=$REPORT_DIRECTORY/integration_test_report_develop.html --self-contained-html
pytest $TEST_TARGET --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)
Expand Down

0 comments on commit 3c09187

Please sign in to comment.