Skip to content

Commit

Permalink
chore: Release v1.4.0 - See CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun-KumarH committed Oct 7, 2023
1 parent 5be8ca6 commit 463492c
Show file tree
Hide file tree
Showing 8 changed files with 946 additions and 776 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v1
with:
node-version: '18.2.0'
node-version: '20.8.0'

- name: Install Dependencies
run: npm ci
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v1
with:
node-version: '18.2.0'
node-version: '20.8.0'

- name: Setup System
uses: restorecommerce/setup-system-action@v1
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.4.0 (October 7th, 2023)

- updated node version to 20 and all other dependencies

### 1.3.1 (September 18th, 2023)

- updated test proto files
Expand Down
1,609 changes: 874 additions & 735 deletions package-lock.json

Large diffs are not rendered by default.

37 changes: 18 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@restorecommerce/chassis-srv",
"version": "1.3.1",
"version": "1.4.0",
"description": "Restore Commerce microservice chassis",
"main": "./lib/index.js",
"author": "n-fuse GmbH",
Expand All @@ -17,13 +17,13 @@
],
"typings": "lib/index.d.ts",
"dependencies": {
"@grpc/grpc-js": "^1.9.3",
"@restorecommerce/grpc-client": "^2.0.3",
"@restorecommerce/kafka-client": "^1.1.1",
"@restorecommerce/logger": "^1.2.4",
"@restorecommerce/protos": "^6.1.1",
"@restorecommerce/rc-grpc-clients": "^5.1.1",
"@restorecommerce/service-config": "^1.0.6",
"@grpc/grpc-js": "^1.9.5",
"@restorecommerce/grpc-client": "^2.0.4",
"@restorecommerce/kafka-client": "^1.1.3",
"@restorecommerce/logger": "^1.2.5",
"@restorecommerce/protos": "^6.1.2",
"@restorecommerce/rc-grpc-clients": "^5.1.3",
"@restorecommerce/service-config": "^1.0.7",
"arangojs": "^8.4.1",
"async": "^3.2.4",
"async-retry": "^1.3.3",
Expand All @@ -38,28 +38,27 @@
"nice-grpc": "^2.1.5",
"nice-grpc-server-reflection": "^2.0.7",
"protobufjs": "^7.2.5",
"redis": "^4.6.8"
"redis": "^4.6.10"
},
"devDependencies": {
"@types/cache-manager": "^4.0.3",
"@types/lodash": "^4.14.198",
"@types/mocha": "^10.0.1",
"@types/nedb": "^1.8.13",
"@types/node": "^20.6.2",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/eslint-plugin-tslint": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"@types/lodash": "^4.14.199",
"@types/mocha": "^10.0.2",
"@types/nedb": "^1.8.14",
"@types/node": "^20.8.3",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/eslint-plugin-tslint": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"cross-env": "^7.0.3",
"eslint": "^8.49.0",
"eslint": "^8.51.0",
"eslint-plugin-prefer-arrow-functions": "^3.1.4",
"mocha": "^10.2.0",
"mocha-typescript": "^1.1.17",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"rimraf": "^5.0.1",
"rimraf": "^5.0.5",
"rxjs": "^7.8.1",
"should": "^13.2.3",
"sleep": "^6.3.0",
"ts-node": "^10.9.1",
"tslint": "^6.1.3",
"typescript": "^5.2.2"
Expand Down
41 changes: 30 additions & 11 deletions test/database.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as chassis from '../src';
import { DatabaseProvider } from '../src/database';
const config = chassis.config;
const database = chassis.database;
const sleep = require('sleep');

let db: DatabaseProvider;

Expand Down Expand Up @@ -530,7 +529,9 @@ const testProvider = (providerCfg) => {

it('should search with default case insensitive based on first name and last name', async () => {
// delay is added since the index takes a second (since we delete and create users in beforeEach and afterEach)
await sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
let usersFound = await db.find(userCollection, {}, { search: { search: 'Ich oWd' } });
usersFound.length.should.equal(3);
usersFound[0].id.should.equal('4');
Expand All @@ -546,7 +547,9 @@ const testProvider = (providerCfg) => {

it('should search with default case insensitive based on city name and country name', async () => {
// delay is added since the index takes a second (since we delete and create users in beforeEach and afterEach)
await sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
let addressFound = await db.find(addressCollection, {}, { search: { search: 'ber man' } });
addressFound.length.should.equal(4);
addressFound[0].city.should.equal('Berlin'); // Berlin, Germany (both terms match)
Expand All @@ -557,7 +560,9 @@ const testProvider = (providerCfg) => {

it('should search with case sensitive based on first name and last name', async () => {
// delay is added since the index takes a second (since we delete and create users in beforeEach and afterEach)
await sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
let usersFound = await db.find(userCollection, {}, { search: { search: 'Ich oWd', case_sensitive: true } });
usersFound.length.should.equal(0);
usersFound = await db.find(userCollection, {}, { search: { search: 'Mic Bow', case_sensitive: true } });
Expand All @@ -575,7 +580,9 @@ const testProvider = (providerCfg) => {

it('should search for umlauts', async () => {
// delay is added since the index takes a second (since we delete and create users in beforeEach and afterEach)
await sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
let usersFound = await db.find(userCollection, {}, { search: { search: 'müll' } });
usersFound.length.should.equal(1);
usersFound[0].first_name.should.equal('David');
Expand All @@ -584,14 +591,18 @@ const testProvider = (providerCfg) => {

it('should not return any result for any match of the search string', async () => {
// delay is added since the index takes a second (since we delete and create users in beforeEach and afterEach)
await sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
let usersFound = await db.find(userCollection, {}, { search: { search: 'does not exist' } });
usersFound.length.should.equal(0);
}).timeout(5000);

it('should search with filter', async () => {
// delay is added since the index takes a second (since we delete and create users in beforeEach and afterEach)
await sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
let usersFound = await db.find(userCollection, { last_name: { $iLike: '%bow%' } }, { search: { search: 'mic' } });
usersFound.length.should.equal(1);
usersFound[0].first_name.should.equal('Michael');
Expand All @@ -600,7 +611,9 @@ const testProvider = (providerCfg) => {

it('should return an error deleting analyzer since the view still exists', async () => {
// delay is added since the index takes a second (since we delete and create users in beforeEach and afterEach)
await sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
let resp = await db.deleteAnalyzer(['trigram', 'trigram_norm']);
resp.length.should.equal(2);
resp[0].id.should.equal('trigram');
Expand All @@ -613,7 +626,9 @@ const testProvider = (providerCfg) => {

it('should return an error dropping view which does not exist', async () => {
// delay is added since the index takes a second (since we delete and create users in beforeEach and afterEach)
await sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
let resp = await db.dropView(['test']);
resp.length.should.equal(1);
resp[0].id.should.equal('test');
Expand All @@ -623,7 +638,9 @@ const testProvider = (providerCfg) => {

it('should drop view', async () => {
// delay is added since the index takes a second (since we delete and create users in beforeEach and afterEach)
await sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
let resp = await db.dropView(['users_view']);
resp.length.should.equal(1);
resp[0].id.should.equal('users_view');
Expand All @@ -633,7 +650,9 @@ const testProvider = (providerCfg) => {

it('should delete analyzers', async () => {
// delay is added since the index takes a second (since we delete and create users in beforeEach and afterEach)
await sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
// drop view and then analyzer
await db.dropView(['users_view', 'addresss_view']);
let resp = await db.deleteAnalyzer(['trigram', 'trigram_norm']);
Expand Down
9 changes: 6 additions & 3 deletions test/grpc_reflection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { createLogger } from '@restorecommerce/logger';
import * as chassis from '../src';
import { Server, buildReflectionService } from '../src';
import { createClient } from '@restorecommerce/grpc-client';
import * as sleep from 'sleep';
import {
protoMetadata
} from '@restorecommerce/rc-grpc-clients/dist/generated/test/test';
Expand Down Expand Up @@ -41,13 +40,17 @@ describe('binding the grpc.ServerReflection service', () => {
});

await server.start();
sleep.sleep(1);
await new Promise((resolve, reject) => {
setTimeout(resolve, 1000);
});
});

after(async function end() {
this.timeout(4000);
await server.stop();
sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
});
describe('calling endpoint ServerReflectionInfo', () => {
let client: ServerReflectionClient;
Expand Down
9 changes: 6 additions & 3 deletions test/microservice.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as should from 'should';
import * as _ from 'lodash';
import { createLogger } from '@restorecommerce/logger';
import * as sleep from 'sleep';
import * as chassis from '../src';
import { createClient } from '@restorecommerce/grpc-client';
import { TestDefinition, TestClient } from '@restorecommerce/rc-grpc-clients/dist/generated/test/test';
Expand Down Expand Up @@ -141,7 +140,9 @@ describe('microservice.Server', () => {
serving = !serving;
});
await server.start();
sleep.sleep(1);
await new Promise((resolve, reject) => {
setTimeout(resolve, 1000);
});
serving.should.equal(true);
const testChannel = createChannel(cfg.get('client:test:address'));
const testClient: TestClient = createClient({
Expand Down Expand Up @@ -295,7 +296,9 @@ describe('microservice.Client', () => {
implementation: testService
} as BindConfig<ServerTestDefinition>);
await server.start();
sleep.sleep(1);
await new Promise((resolve, reject) => {
setTimeout(resolve, 1000);
});
});
after(async () => {
await server.stop();
Expand Down
9 changes: 6 additions & 3 deletions test/transport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as should from 'should';
import { createLogger } from '@restorecommerce/logger';
import { createClient } from '@restorecommerce/grpc-client';
import { grpcServer } from '../src';
import * as sleep from 'sleep';
import { TestClient, TestDefinition } from '@restorecommerce/rc-grpc-clients/dist/generated/test/test';
import { TestDefinition as ServerTestDefinition } from '@restorecommerce/rc-grpc-clients/dist/generated-server/test/test';
import { testService } from './microservice.spec';
Expand Down Expand Up @@ -65,7 +64,9 @@ providers.forEach((provider) => {
describe('start', () => {
it('should start the server', async () => {
await server.start();
sleep.sleep(1);
await new Promise((resolve, reject) => {
setTimeout(resolve, 1000);
});
});
});
describe('end', () => {
Expand Down Expand Up @@ -124,7 +125,9 @@ providers.forEach((provider) => {
implementation: testService
} as BindConfig<ServerTestDefinition>);
await server.start();
sleep.sleep(2);
await new Promise((resolve, reject) => {
setTimeout(resolve, 2000);
});
});
after(async () => {
await server.end();
Expand Down

0 comments on commit 463492c

Please sign in to comment.