Skip to content

Commit

Permalink
Merge pull request #204 from tigrisdata/main
Browse files Browse the repository at this point in the history
Beta release
  • Loading branch information
adilansari authored Jan 9, 2023
2 parents 03742e3 + 1811872 commit 768337e
Show file tree
Hide file tree
Showing 52 changed files with 2,948 additions and 1,900 deletions.
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Describe your changes

## How best to test these changes

## Issue ticket number and link
4 changes: 2 additions & 2 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Build package
run: npm ci
- name: Install semantic-release
Expand All @@ -30,4 +30,4 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --debug --dryRun
run: npx semantic-release@18 --debug --dryRun
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Build package
run: npm ci
- name: Install semantic-release
Expand All @@ -48,4 +48,4 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release --debug
run: npx semantic-release@18 --debug
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Ignore artifacts:
dist/
src/__tests__/
src/proto/
api/
coverage/
2 changes: 1 addition & 1 deletion api/proto
Submodule proto updated from 9aac84 to c5ced5
3 changes: 2 additions & 1 deletion jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
"collectCoverage": true,
"coverageDirectory": "coverage",
"coverageProvider": "v8",
"coveragePathIgnorePatterns": ["<rootDir>/src/decorators/metadata/*.ts"],
"collectCoverageFrom": [
"src/*.ts",
"src/consumables/*.ts",
"src/decorators/**/*.ts",
"src/decorators/*.ts",
"src/schema/**/*.ts",
"src/search/**/*.ts",
"src/utils/**/*.ts"
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions src/__tests__/consumables/cursor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {Server, ServerCredentials} from "@grpc/grpc-js";
import TestService, {TestTigrisService} from "../test-service";
import {TigrisService} from "../../proto/server/v1/api_grpc_pb";
import {IBook} from "../tigris.rpc.spec";
import {Tigris} from "../../tigris";
import {CursorInUseError} from "../../error";
import {ObservabilityService} from "../../proto/server/v1/observability_grpc_pb";
import { Server, ServerCredentials } from "@grpc/grpc-js";
import TestService, { TestTigrisService } from "../test-service";
import { TigrisService } from "../../proto/server/v1/api_grpc_pb";
import { IBook } from "../tigris.rpc.spec";
import { Tigris } from "../../tigris";
import { CursorInUseError } from "../../error";
import { ObservabilityService } from "../../proto/server/v1/observability_grpc_pb";
import TestObservabilityService from "../test-observability-service";
import {DB} from "../../db";
import { DB } from "../../db";

describe("class FindCursor", () => {
let server: Server;
Expand All @@ -30,7 +30,7 @@ describe("class FindCursor", () => {
}
}
);
const tigris = new Tigris({serverUrl: "localhost:" + SERVER_PORT, projectName: "db3"});
const tigris = new Tigris({ serverUrl: "localhost:" + SERVER_PORT, projectName: "db3" });
db = tigris.getDatabase();
done();
});
Expand All @@ -52,7 +52,7 @@ describe("class FindCursor", () => {
bookCounter++;
}
expect(bookCounter).toBeGreaterThan(0);
})
});

it("Pipes the stream as iterable", async () => {
const cursor = db.getCollection<IBook>("books").findMany();
Expand All @@ -62,22 +62,22 @@ describe("class FindCursor", () => {
bookCounter++;
}
expect(bookCounter).toBeGreaterThan(0);
})
});

it("returns stream as an array", () => {
const cursor = db.getCollection<IBook>("books").findMany();
const booksPromise = cursor.toArray();
booksPromise.then(books => expect(books.length).toBeGreaterThan(0));
booksPromise.then((books) => expect(books.length).toBeGreaterThan(0));

return booksPromise;
})
});

it("does not allow cursor to be re-used", () => {
const cursor = db.getCollection<IBook>("books").findMany();
// cursor is backed by is a generator fn, calling next() would retrieve item from stream
cursor[Symbol.asyncIterator]().next();
expect(() => cursor.toArray()).toThrow(CursorInUseError);
})
});

it("allows cursor to be re-used once reset", async () => {
const cursor = db.getCollection<IBook>("books").findMany();
Expand All @@ -88,8 +88,8 @@ describe("class FindCursor", () => {
bookCounter++;
}

cursor.reset()
cursor.reset();
const books = await cursor.toArray();
expect(books.length).toBe(bookCounter);
})
});
});
41 changes: 0 additions & 41 deletions src/__tests__/data/basicCollection.json

This file was deleted.

21 changes: 0 additions & 21 deletions src/__tests__/data/basicCollectionWithObjectType.json

This file was deleted.

37 changes: 0 additions & 37 deletions src/__tests__/data/collectionWithObjectArrays.json

This file was deleted.

26 changes: 0 additions & 26 deletions src/__tests__/data/collectionWithPrimitiveArrays.json

This file was deleted.

Loading

0 comments on commit 768337e

Please sign in to comment.