Skip to content

Commit

Permalink
Patch/alternative up with nolan (#1643)
Browse files Browse the repository at this point in the history
* SDK First pass

* Add feature tracking

* Typo

* Check in

* Rebase

* Add Graph tests

* Fix Agent empty message bug

* Check in JS routes

* More tests, examples

* Sync python

* Expose Entity/Relationship Params in Routes (#1640)

* Expose Entity/Relationship Params

* Descriptions

* Modify create entities

* Create relationships

* set parent_id

* Update entitiy

* Update Relationships

* Check in

* Ellipsis fixes

* More cleanup

* Start CRUD on communities

* Communities DB

* Explicit working path

* Once again

* Fail fast false

* Testing around community creation

* Delete community test

* Update community tests

* Clean up type errors, cleaner code

* More cleanup

* More

* remove chunk_entity

* Delete bad, unused methods

* More

* fixup crud

* rm pull

---------

Co-authored-by: NolanTrem <[email protected]>
  • Loading branch information
emrgnt-cmplxty and NolanTrem authored Dec 1, 2024
1 parent 9dd4105 commit b14cdbd
Show file tree
Hide file tree
Showing 51 changed files with 3,691 additions and 1,808 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 b14cdbd

Please sign in to comment.