diff --git a/.github/workflows/test-integrations-aws-lambda.yml b/.github/workflows/test-integrations-aws.yml similarity index 94% rename from .github/workflows/test-integrations-aws-lambda.yml rename to .github/workflows/test-integrations-aws.yml index d85d1d4a8e..67c0ec31c7 100644 --- a/.github/workflows/test-integrations-aws-lambda.yml +++ b/.github/workflows/test-integrations-aws.yml @@ -1,6 +1,6 @@ # Do not edit this file. This file is generated automatically by executing # python scripts/split-tox-gh-actions/split-tox-gh-actions.py -name: Test AWS Lambda +name: Test AWS on: push: branches: @@ -52,8 +52,8 @@ jobs: - name: Check permissions on repo branch if: github.event_name == 'push' run: true - test-aws_lambda-pinned: - name: AWS Lambda (pinned) + test-aws-pinned: + name: AWS (pinned) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -112,13 +112,13 @@ jobs: files: .junitxml verbose: true check_required_tests: - name: All pinned AWS Lambda tests passed - needs: test-aws_lambda-pinned + name: All pinned AWS tests passed + needs: test-aws-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test-aws_lambda-pinned.result, 'failure') || contains(needs.test-aws_lambda-pinned.result, 'skipped') + if: contains(needs.test-aws-pinned.result, 'failure') || contains(needs.test-aws-pinned.result, 'skipped') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integrations-cloud-computing.yml b/.github/workflows/test-integrations-cloud.yml similarity index 93% rename from .github/workflows/test-integrations-cloud-computing.yml rename to .github/workflows/test-integrations-cloud.yml index 9013a02af3..62d67200a5 100644 --- a/.github/workflows/test-integrations-cloud-computing.yml +++ b/.github/workflows/test-integrations-cloud.yml @@ -1,6 +1,6 @@ # Do not edit this file. This file is generated automatically by executing # python scripts/split-tox-gh-actions/split-tox-gh-actions.py -name: Test Cloud Computing +name: Test Cloud on: push: branches: @@ -20,8 +20,8 @@ env: CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless jobs: - test-cloud_computing-latest: - name: Cloud Computing (latest) + test-cloud-latest: + name: Cloud (latest) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -88,8 +88,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: .junitxml verbose: true - test-cloud_computing-pinned: - name: Cloud Computing (pinned) + test-cloud-pinned: + name: Cloud (pinned) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -157,13 +157,13 @@ jobs: files: .junitxml verbose: true check_required_tests: - name: All pinned Cloud Computing tests passed - needs: test-cloud_computing-pinned + name: All pinned Cloud tests passed + needs: test-cloud-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test-cloud_computing-pinned.result, 'failure') || contains(needs.test-cloud_computing-pinned.result, 'skipped') + if: contains(needs.test-cloud-pinned.result, 'failure') || contains(needs.test-cloud-pinned.result, 'skipped') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integrations-databases.yml b/.github/workflows/test-integrations-dbs.yml similarity index 96% rename from .github/workflows/test-integrations-databases.yml rename to .github/workflows/test-integrations-dbs.yml index 045f942b9c..1612dfb432 100644 --- a/.github/workflows/test-integrations-databases.yml +++ b/.github/workflows/test-integrations-dbs.yml @@ -1,6 +1,6 @@ # Do not edit this file. This file is generated automatically by executing # python scripts/split-tox-gh-actions/split-tox-gh-actions.py -name: Test Databases +name: Test DBs on: push: branches: @@ -20,8 +20,8 @@ env: CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless jobs: - test-databases-latest: - name: Databases (latest) + test-dbs-latest: + name: DBs (latest) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -115,8 +115,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: .junitxml verbose: true - test-databases-pinned: - name: Databases (pinned) + test-dbs-pinned: + name: DBs (pinned) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -211,13 +211,13 @@ jobs: files: .junitxml verbose: true check_required_tests: - name: All pinned Databases tests passed - needs: test-databases-pinned + name: All pinned DBs tests passed + needs: test-dbs-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test-databases-pinned.result, 'failure') || contains(needs.test-databases-pinned.result, 'skipped') + if: contains(needs.test-dbs-pinned.result, 'failure') || contains(needs.test-dbs-pinned.result, 'skipped') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integrations-miscellaneous.yml b/.github/workflows/test-integrations-misc.yml similarity index 95% rename from .github/workflows/test-integrations-miscellaneous.yml rename to .github/workflows/test-integrations-misc.yml index ebb486b6b6..5f2baa5759 100644 --- a/.github/workflows/test-integrations-miscellaneous.yml +++ b/.github/workflows/test-integrations-misc.yml @@ -1,6 +1,6 @@ # Do not edit this file. This file is generated automatically by executing # python scripts/split-tox-gh-actions/split-tox-gh-actions.py -name: Test Miscellaneous +name: Test Misc on: push: branches: @@ -20,8 +20,8 @@ env: CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless jobs: - test-miscellaneous-latest: - name: Miscellaneous (latest) + test-misc-latest: + name: Misc (latest) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -100,8 +100,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: .junitxml verbose: true - test-miscellaneous-pinned: - name: Miscellaneous (pinned) + test-misc-pinned: + name: Misc (pinned) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -181,13 +181,13 @@ jobs: files: .junitxml verbose: true check_required_tests: - name: All pinned Miscellaneous tests passed - needs: test-miscellaneous-pinned + name: All pinned Misc tests passed + needs: test-misc-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test-miscellaneous-pinned.result, 'failure') || contains(needs.test-miscellaneous-pinned.result, 'skipped') + if: contains(needs.test-misc-pinned.result, 'failure') || contains(needs.test-misc-pinned.result, 'skipped') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integrations-networking.yml b/.github/workflows/test-integrations-network.yml similarity index 94% rename from .github/workflows/test-integrations-networking.yml rename to .github/workflows/test-integrations-network.yml index 2c9a788954..7c1c343aac 100644 --- a/.github/workflows/test-integrations-networking.yml +++ b/.github/workflows/test-integrations-network.yml @@ -1,6 +1,6 @@ # Do not edit this file. This file is generated automatically by executing # python scripts/split-tox-gh-actions/split-tox-gh-actions.py -name: Test Networking +name: Test Network on: push: branches: @@ -20,8 +20,8 @@ env: CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless jobs: - test-networking-latest: - name: Networking (latest) + test-network-latest: + name: Network (latest) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -88,8 +88,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: .junitxml verbose: true - test-networking-pinned: - name: Networking (pinned) + test-network-pinned: + name: Network (pinned) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -157,13 +157,13 @@ jobs: files: .junitxml verbose: true check_required_tests: - name: All pinned Networking tests passed - needs: test-networking-pinned + name: All pinned Network tests passed + needs: test-network-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test-networking-pinned.result, 'failure') || contains(needs.test-networking-pinned.result, 'skipped') + if: contains(needs.test-network-pinned.result, 'failure') || contains(needs.test-network-pinned.result, 'skipped') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integrations-data-processing.yml b/.github/workflows/test-integrations-tasks.yml similarity index 95% rename from .github/workflows/test-integrations-data-processing.yml rename to .github/workflows/test-integrations-tasks.yml index 6ad3d707fe..1c4259ac05 100644 --- a/.github/workflows/test-integrations-data-processing.yml +++ b/.github/workflows/test-integrations-tasks.yml @@ -1,6 +1,6 @@ # Do not edit this file. This file is generated automatically by executing # python scripts/split-tox-gh-actions/split-tox-gh-actions.py -name: Test Data Processing +name: Test Tasks on: push: branches: @@ -20,8 +20,8 @@ env: CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless jobs: - test-data_processing-latest: - name: Data Processing (latest) + test-tasks-latest: + name: Tasks (latest) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -106,8 +106,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: .junitxml verbose: true - test-data_processing-pinned: - name: Data Processing (pinned) + test-tasks-pinned: + name: Tasks (pinned) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -193,13 +193,13 @@ jobs: files: .junitxml verbose: true check_required_tests: - name: All pinned Data Processing tests passed - needs: test-data_processing-pinned + name: All pinned Tasks tests passed + needs: test-tasks-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test-data_processing-pinned.result, 'failure') || contains(needs.test-data_processing-pinned.result, 'skipped') + if: contains(needs.test-tasks-pinned.result, 'failure') || contains(needs.test-tasks-pinned.result, 'skipped') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integrations-web-frameworks-1.yml b/.github/workflows/test-integrations-web-1.yml similarity index 94% rename from .github/workflows/test-integrations-web-frameworks-1.yml rename to .github/workflows/test-integrations-web-1.yml index d4a9aff6f1..6a6a01e8ff 100644 --- a/.github/workflows/test-integrations-web-frameworks-1.yml +++ b/.github/workflows/test-integrations-web-1.yml @@ -1,6 +1,6 @@ # Do not edit this file. This file is generated automatically by executing # python scripts/split-tox-gh-actions/split-tox-gh-actions.py -name: Test Web Frameworks 1 +name: Test Web 1 on: push: branches: @@ -20,8 +20,8 @@ env: CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless jobs: - test-web_frameworks_1-latest: - name: Web Frameworks 1 (latest) + test-web_1-latest: + name: Web 1 (latest) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -106,8 +106,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: .junitxml verbose: true - test-web_frameworks_1-pinned: - name: Web Frameworks 1 (pinned) + test-web_1-pinned: + name: Web 1 (pinned) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -193,13 +193,13 @@ jobs: files: .junitxml verbose: true check_required_tests: - name: All pinned Web Frameworks 1 tests passed - needs: test-web_frameworks_1-pinned + name: All pinned Web 1 tests passed + needs: test-web_1-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test-web_frameworks_1-pinned.result, 'failure') || contains(needs.test-web_frameworks_1-pinned.result, 'skipped') + if: contains(needs.test-web_1-pinned.result, 'failure') || contains(needs.test-web_1-pinned.result, 'skipped') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integrations-web-frameworks-2.yml b/.github/workflows/test-integrations-web-2.yml similarity index 95% rename from .github/workflows/test-integrations-web-frameworks-2.yml rename to .github/workflows/test-integrations-web-2.yml index f0cdcc4510..11cfc20612 100644 --- a/.github/workflows/test-integrations-web-frameworks-2.yml +++ b/.github/workflows/test-integrations-web-2.yml @@ -1,6 +1,6 @@ # Do not edit this file. This file is generated automatically by executing # python scripts/split-tox-gh-actions/split-tox-gh-actions.py -name: Test Web Frameworks 2 +name: Test Web 2 on: push: branches: @@ -20,8 +20,8 @@ env: CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless jobs: - test-web_frameworks_2-latest: - name: Web Frameworks 2 (latest) + test-web_2-latest: + name: Web 2 (latest) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -112,8 +112,8 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: .junitxml verbose: true - test-web_frameworks_2-pinned: - name: Web Frameworks 2 (pinned) + test-web_2-pinned: + name: Web 2 (pinned) timeout-minutes: 30 runs-on: ${{ matrix.os }} strategy: @@ -205,13 +205,13 @@ jobs: files: .junitxml verbose: true check_required_tests: - name: All pinned Web Frameworks 2 tests passed - needs: test-web_frameworks_2-pinned + name: All pinned Web 2 tests passed + needs: test-web_2-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test-web_frameworks_2-pinned.result, 'failure') || contains(needs.test-web_frameworks_2-pinned.result, 'skipped') + if: contains(needs.test-web_2-pinned.result, 'failure') || contains(needs.test-web_2-pinned.result, 'skipped') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/scripts/split-tox-gh-actions/split-tox-gh-actions.py b/scripts/split-tox-gh-actions/split-tox-gh-actions.py index c0bf2a7a09..c4b8f3e5e5 100755 --- a/scripts/split-tox-gh-actions/split-tox-gh-actions.py +++ b/scripts/split-tox-gh-actions/split-tox-gh-actions.py @@ -65,18 +65,18 @@ "openai", "huggingface_hub", ], - "AWS Lambda": [ + "AWS": [ # this is separate from Cloud Computing because only this one test suite # needs to run with access to GitHub secrets "aws_lambda", ], - "Cloud Computing": [ + "Cloud": [ "boto3", "chalice", "cloud_resource_context", "gcp", ], - "Data Processing": [ + "Tasks": [ "arq", "beam", "celery", @@ -86,7 +86,7 @@ "rq", "spark", ], - "Databases": [ + "DBs": [ "asyncpg", "clickhouse_driver", "pymongo", @@ -100,19 +100,19 @@ "graphene", "strawberry", ], - "Networking": [ + "Network": [ "gevent", "grpc", "httpx", "requests", ], - "Web Frameworks 1": [ + "Web 1": [ "django", "flask", "starlette", "fastapi", ], - "Web Frameworks 2": [ + "Web 2": [ "aiohttp", "asgi", "bottle", @@ -124,7 +124,7 @@ "starlite", "tornado", ], - "Miscellaneous": [ + "Misc": [ "launchdarkly", "loguru", "openfeature", diff --git a/sentry_sdk/integrations/openai.py b/sentry_sdk/integrations/openai.py index e6ac36f3cb..61d335b170 100644 --- a/sentry_sdk/integrations/openai.py +++ b/sentry_sdk/integrations/openai.py @@ -137,7 +137,7 @@ def _new_chat_completion_common(f, *args, **kwargs): span = sentry_sdk.start_span( op=consts.OP.OPENAI_CHAT_COMPLETIONS_CREATE, - description="Chat Completion", + name="Chat Completion", origin=OpenAIIntegration.origin, ) span.__enter__() diff --git a/sentry_sdk/integrations/rq.py b/sentry_sdk/integrations/rq.py index c0df1c5e53..462f3ad30a 100644 --- a/sentry_sdk/integrations/rq.py +++ b/sentry_sdk/integrations/rq.py @@ -90,9 +90,13 @@ def sentry_patched_perform_job(self, job, *args, **kwargs): def sentry_patched_handle_exception(self, job, *exc_info, **kwargs): # type: (Worker, Any, *Any, **Any) -> Any - # Note, the order of the `or` here is important, - # because calling `job.is_failed` will change `_status`. - if job._status == JobStatus.FAILED or job.is_failed: + retry = ( + hasattr(job, "retries_left") + and job.retries_left + and job.retries_left > 0 + ) + failed = job._status == JobStatus.FAILED or job.is_failed + if failed and not retry: _capture_exception(exc_info) return old_handle_exception(self, job, *exc_info, **kwargs) diff --git a/tests/integrations/rq/test_rq.py b/tests/integrations/rq/test_rq.py index ffd6f458e1..e445b588be 100644 --- a/tests/integrations/rq/test_rq.py +++ b/tests/integrations/rq/test_rq.py @@ -254,11 +254,6 @@ def test_traces_sampler_gets_correct_values_in_sampling_context( @pytest.mark.skipif( parse_version(rq.__version__) < (1, 5), reason="At least rq-1.5 required" ) -@pytest.mark.skipif( - parse_version(rq.__version__) >= (2,), - reason="Test broke in RQ 2.0. Investigate and fix. " - "See https://github.com/getsentry/sentry-python/issues/3707.", -) def test_job_with_retries(sentry_init, capture_events): sentry_init(integrations=[RqIntegration()]) events = capture_events()