Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
emrgnt-cmplxty committed Dec 1, 2024
2 parents 9dd4105 + d4bfba7 commit 5ad3212
Show file tree
Hide file tree
Showing 51 changed files with 3,665 additions and 1,744 deletions.
149 changes: 143 additions & 6 deletions .github/workflows/r2r-js-sdk-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
name: R2R JS SDK Integration Tests

on:
push:
branches:
- '**' # Trigger on all branches
- '**'

jobs:
test:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python and install dependencies
uses: ./.github/actions/setup-python-light
with:
os: ubuntu-latest
- name: Setup and start PostgreSQL
uses: ./.github/actions/setup-postgres-ext
with:
os: ubuntu-latest
- name: Start R2R Light server
uses: ./.github/actions/start-r2r-light
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "20.x"
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x
run_install: false
- name: Install JS SDK dependencies
working-directory: ./js/sdk
run: pnpm install
- name: Check if R2R server is running
run: |
curl http://localhost:7272/v2/health || echo "Server not responding"
v2-unit-test:
needs: setup
runs-on: ubuntu-latest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Expand Down Expand Up @@ -42,9 +75,113 @@ jobs:
- name: Install JS SDK dependencies
working-directory: ./js/sdk
run: pnpm install
- name: Check if R2R server is running
run: |
curl http://localhost:7272/v2/health || echo "Server not responding"
- name: Run r2rV2Client tests
working-directory: ./js/sdk
run: pnpm jest r2rV2Client.test.ts

v2-integration-tests:
needs: v2-unit-test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-group:
- r2rV2ClientIntegrationSuperUser.test.ts
- r2rV2ClientIntegrationUser.test.ts
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
AZURE_API_KEY: ${{ secrets.AZURE_API_KEY }}
AZURE_API_BASE: ${{ secrets.AZURE_API_BASE }}
AZURE_API_VERSION: ${{ secrets.AZURE_API_VERSION }}
TELEMETRY_ENABLED: 'false'
R2R_POSTGRES_HOST: localhost
R2R_POSTGRES_DBNAME: postgres
R2R_POSTGRES_PORT: '5432'
R2R_POSTGRES_PASSWORD: postgres
R2R_POSTGRES_USER: postgres
R2R_PROJECT_NAME: r2r_default
steps:
- uses: actions/checkout@v2
- name: Set up Python and install dependencies
uses: ./.github/actions/setup-python-light
with:
os: ubuntu-latest
- name: Setup and start PostgreSQL
uses: ./.github/actions/setup-postgres-ext
with:
os: ubuntu-latest
- name: Start R2R Light server
uses: ./.github/actions/start-r2r-light
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "20.x"
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x
run_install: false
- name: Install JS SDK dependencies
working-directory: ./js/sdk
run: pnpm install
- name: Run integration tests
working-directory: ./js/sdk
run: pnpm test
run: pnpm jest ${{ matrix.test-group }}

v3-integration-tests:
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-group:
- ChunksIntegrationSuperUser.test.ts
- CollectionsIntegrationSuperUser.test.ts
- ConversationsIntegrationSuperUser.test.ts
- DocumentsAndCollectionsIntegrationUser.test.ts
- DocumentsIntegrationSuperUser.test.ts
- GraphsIntegrationSuperUser.test.ts
- PromptsIntegrationSuperUser.test.ts
- RetrievalIntegrationSuperUser.test.ts
- SystemIntegrationSuperUser.test.ts
- SystemIntegrationUser.test.ts
- UsersIntegrationSuperUser.test.ts
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
AZURE_API_KEY: ${{ secrets.AZURE_API_KEY }}
AZURE_API_BASE: ${{ secrets.AZURE_API_BASE }}
AZURE_API_VERSION: ${{ secrets.AZURE_API_VERSION }}
TELEMETRY_ENABLED: 'false'
R2R_POSTGRES_HOST: localhost
R2R_POSTGRES_DBNAME: postgres
R2R_POSTGRES_PORT: '5432'
R2R_POSTGRES_PASSWORD: postgres
R2R_POSTGRES_USER: postgres
R2R_PROJECT_NAME: r2r_default
steps:
- uses: actions/checkout@v2
- name: Set up Python and install dependencies
uses: ./.github/actions/setup-python-light
with:
os: ubuntu-latest
- name: Setup and start PostgreSQL
uses: ./.github/actions/setup-postgres-ext
with:
os: ubuntu-latest
- name: Start R2R Light server
uses: ./.github/actions/start-r2r-light
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "20.x"
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.x
run_install: false
- name: Install JS SDK dependencies
working-directory: ./js/sdk
run: pnpm install
- name: Run remaining tests
working-directory: ./js/sdk
run: pnpm jest ${{ matrix.test-group }}
2 changes: 1 addition & 1 deletion js/sdk/__tests__/ChunksIntegrationSuperUser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe("r2rClient V3 Collections Integration Tests", () => {
expect(response.results).toEqual([
{
document_id: expect.any(String),
message: "Ingestion task completed successfully.",
message: "Document created and ingested successfully.",
},
]);
}, 10000);
Expand Down
Loading

0 comments on commit 5ad3212

Please sign in to comment.