Skip to content

Separate auth tests in CI to reduce flakes due to rate limits #270

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

Merged
merged 2 commits into from
Mar 7, 2025
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
40 changes: 33 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
npm run format:check
npm run docs

tests:
tests-without-auth:
needs: checks
runs-on: ubuntu-latest
strategy:
Expand All @@ -47,6 +47,37 @@ jobs:
]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.versions.node }}
- name: Login to Docker Hub
if: ${{ !github.event.pull_request.head.repo.fork && github.triggering_actor != 'dependabot[bot]' }}
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: "Install dependencies"
run: |
npm ci
ci/run_dependencies.sh ${{ matrix.versions.weaviate }}
- name: "Run tests without authentication tests"
run: WEAVIATE_VERSION=${{ matrix.versions.weaviate }} npm test
- name: "Transpile the package"
run: npm run build
- name: "Stop Weaviate"
run: ci/stop_dependencies.sh ${{ matrix.versions.weaviate }}

tests-with-auth:
needs: checks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
versions: [
{ node: "22.x", weaviate: $WEAVIATE_129}
]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.versions.node }}
Expand All @@ -68,16 +99,11 @@ jobs:
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
OKTA_CLIENT_SECRET: ${{ secrets.OKTA_CLIENT_SECRET }}
run: WEAVIATE_VERSION=${{ matrix.versions.weaviate }} npm test
- name: "Run tests without authentication tests (for forks)"
if: ${{ github.event.pull_request.head.repo.fork }}
run: WEAVIATE_VERSION=${{ matrix.versions.weaviate }} npm test
- name: "Transpile the package"
run: npm run build
- name: "Stop Weaviate"
run: ci/stop_dependencies.sh ${{ matrix.versions.weaviate }}

publish:
needs: tests
needs: [tests-with-auth, tests-without-auth]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
permissions:
Expand Down