Skip to content

Commit

Permalink
try skipping integration tests from forks
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Jun 10, 2024
1 parent 1f71c72 commit 2fd1ad3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/amazon_bedrock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ jobs:
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Set IS_FORK environment variable
run: echo "IS_FORK=$([[ ${{ github.event.pull_request.head.repo.full_name }} != ${{ github.repository }} ]] && echo true || echo false)" >> $GITHUB_ENV


- name: AWS authentication
if: env.IS_FORK == 'false'
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
aws-region: ${{ env.AWS_REGION }}
Expand Down
5 changes: 5 additions & 0 deletions integrations/amazon_bedrock/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
from unittest.mock import patch

import os
import pytest

def pytest_runtest_setup(item):
if os.getenv("IS_FORK") == "true" and "integration" in item.keywords:
pytest.skip("Skipping integration test since it's running in a forked repository")


@pytest.fixture
def set_env_variables(monkeypatch):
Expand Down

0 comments on commit 2fd1ad3

Please sign in to comment.