Skip to content

Commit

Permalink
chore: fix flaky making CI pass without 100% coverage (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrery authored Nov 22, 2024
1 parent 7d69721 commit ef2127d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -752,26 +752,26 @@ jobs:
)
&& steps.conformance.outcome == 'success'
&& !cancelled()
shell: bash +e {0}
run: |
if [[ "${{ env.IS_WEEKLY }}" == "true" ]]; then
PYTEST_OPTIONS="--weekly"
else
PYTEST_OPTIONS=""
fi
set +e # Disable exit on error to capture the exit code
make pytest_and_report PYTEST_OPTIONS=${PYTEST_OPTIONS}
pytest_exit_code=$?
set -e # Re-enable exit on error
# If regular tests failed, check for flaky tests
if [ $? -ne 0 ]; then
if [ $pytest_exit_code -ne 0 ]; then
# Convert pytest report to formatted report with only information about failed tests
poetry run python ./script/actions_utils/pytest_failed_test_report.py \
--pytest-input-report "pytest_report.json" \
--failed-tests-report "failed_tests_report.json" \
--failed-tests-comment "failed_tests_comment_${{ matrix.python_version }}.txt" \
--failed-tests-list "failed_tests_slack_list_${{ matrix.python_version }}.txt"
poetry run python ./script/actions_utils/pytest_failed_test_report.py \
--pytest-input-report "pytest_report.json" \
--failed-tests-report "failed_tests_report.json" \
--failed-tests-comment "failed_tests_comment_${{ matrix.python_version }}.txt" \
--failed-tests-list "failed_tests_slack_list_${{ matrix.python_version }}.txt"
# Check if all failed tests are known flaky tests
FAILED_TESTS_ARE_FLAKY=$(jq .all_failed_tests_are_flaky "failed_tests_report.json")
Expand Down

0 comments on commit ef2127d

Please sign in to comment.