-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Still failing a test on wait_for_project_lock. <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Migrate testing framework from `uvu` to `vitest`, updating test scripts, dependencies, and test files accordingly. > > - **Testing Framework Migration**: > - Replace `uvu` with `vitest` in `package.json` test scripts. > - Remove `uvu` and related dependencies; add `vitest`. > - Add `vitest.config.ts` for configuration. > - **Test Files**: > - Convert test files from `.js` to `.ts` (e.g., `arrow.test.js` to `arrow.ts`). > - Update test syntax from `uvu` to `vitest` in `embedding.test.ts`, `neighbors.test.ts`, `project.test.ts`, and `user.test.ts`. > - Replace `assert` with `expect` in test assertions. > - **Miscellaneous**: > - Remove `project.test.js` and replace with `project.test.ts` with updated test cases. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=nomic-ai%2Fts-nomic&utm_source=github&utm_medium=referral)<sup> for ecd2422. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
Showing
10 changed files
with
2,312 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ etc/openapi.json | |
private | ||
dist | ||
docs | ||
.vscode | ||
coverage |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { test } from 'uvu'; | ||
import * as arrow from 'apache-arrow'; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { expect, test, describe } from 'vitest'; | ||
|
||
import { AtlasDataset } from '../src/project'; | ||
import { make_test_table } from './arrow'; | ||
import { AtlasProjection } from '../src/projection'; | ||
import { AtlasUser } from '../src/user'; | ||
import { AtlasViewer } from '../src/viewer'; | ||
import { AtlasOrganization } from '../src/organization'; | ||
|
||
describe('Project Flow Suite', () => { | ||
let viewer: AtlasViewer; | ||
let user: AtlasUser; | ||
let organization: AtlasOrganization; | ||
let project: AtlasDataset; | ||
let index: any; | ||
let projection: AtlasProjection; | ||
|
||
beforeAll(async () => { | ||
viewer = await new AtlasViewer({ useEnvToken: true }); | ||
user = await new AtlasUser(viewer).withLoadedAttributes(); | ||
const orgId = user.attr.organizations[0].organization_id; | ||
organization = new AtlasOrganization(orgId, viewer); | ||
}); | ||
|
||
afterAll(async () => { | ||
if (project) await project.delete(); | ||
}); | ||
|
||
test('Verify organization has no attributes initially', async () => { | ||
expect(organization.attr).toBe(undefined); | ||
await organization.fetchAttributes(); | ||
expect(organization.attr).toBeInstanceOf(Object); | ||
}); | ||
|
||
test('Create project in organization', async () => { | ||
project = await organization.create_project({ | ||
project_name: 'test-a typescript test text project', | ||
unique_id_field: 'id', | ||
modality: 'text', | ||
}); | ||
|
||
const fetchedProject = await new AtlasDataset( | ||
project.id, | ||
viewer | ||
).withLoadedAttributes(); | ||
expect(fetchedProject.id).toBe(project.id); | ||
}); | ||
|
||
test('Upload arrow table to project', async () => { | ||
const table = make_test_table({ length: 50, modality: 'text' }); | ||
await project.uploadArrow(table).catch((err) => { | ||
console.error(err); | ||
throw err; | ||
}); | ||
}); | ||
|
||
test('Create index on project and verify it', async () => { | ||
const index = await project.createIndex({ | ||
index_name: 'test index', | ||
indexed_field: 'text', | ||
colorable_fields: [], | ||
}); | ||
}); | ||
}); | ||
|
||
test('test_arrow_text', () => { | ||
const tb = make_test_table({ length: 32, modality: 'text' }); | ||
}); | ||
|
||
test('test_arrow_embeddings', () => { | ||
const tb = make_test_table({ length: 32, modality: 'embedding' }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { defineConfig } from 'vitest/config'; | ||
import { resolve } from 'path'; | ||
|
||
export default defineConfig({ | ||
root: '.', | ||
esbuild: { | ||
tsconfigRaw: '{}', | ||
}, | ||
test: { | ||
clearMocks: true, | ||
globals: true, | ||
setupFiles: ['dotenv/config'], //this line, | ||
}, | ||
resolve: { | ||
alias: [{ find: '~', replacement: resolve(__dirname, 'src') }], | ||
}, | ||
}); |