-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: some files split and begining of logging
- Loading branch information
Showing
48 changed files
with
2,138 additions
and
1,856 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## Install ydb-platform/slo-tests | ||
|
||
GIT: https://github.com/ydb-platform/slo-tests.git | ||
Start `docker-compose up -d` to have YDB running in local container | ||
Check that YDB has started `http://localhost:8765/monitoring/cluster/tenants` | ||
|
||
## Install | ||
|
||
set YDB_ANONYMOUS_CREDENTIALS=1 | ||
set YDB_SSL_ROOT_CERTIFICATES_FILE=C:\work\slo-tests\playground\data\ydb_certs\cert.pem | ||
set YDB_SDK_LOGLEVEL=debug | ||
npm run test:integration:development | ||
|
||
src/__tests__/bytestring-identity.test.ts | ||
src/__tests__/create-table.test.ts | ||
|
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 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 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,54 @@ | ||
import {DriverContext} from '../../DriverContext'; | ||
import Driver from "./../../driver"; | ||
import {buildTestLogger} from "../../utils/tests/test-logger"; | ||
|
||
describe('driverConext', () => { | ||
|
||
it('getSafe', async () => { | ||
const {testLogger, testLoggerFn} = buildTestLogger() | ||
|
||
// Note: This way does not go for unit test - since Driver components initiates async start | ||
// const driver = new Driver({ | ||
// connectionString: 'http://test.com:1111/?database=test', | ||
// authService: new AnonymousAuthService(), | ||
// logger: testLogger}); | ||
|
||
// testLoggerFn.mockReset(); | ||
|
||
const driver = Object.create(Driver.prototype) as Driver; | ||
(driver as any).logger = testLogger; | ||
|
||
const ctx1 = DriverContext.getSafe(driver, 'method1'); | ||
await ctx1.do(() => { | ||
const ctx2 = DriverContext.getSafe(driver, 'method2'); | ||
expect(ctx2).toBe(ctx1); | ||
}); | ||
expect(testLoggerFn.mock.calls).toEqual([['trace', 'method1'], ['trace', 'method2']]); | ||
}); | ||
|
||
it('get - ok', async () => { | ||
const {testLogger, testLoggerFn} = buildTestLogger() | ||
|
||
// Note: This way does not go for unit test - since Driver components initiates async start | ||
// const driver = new Driver({ | ||
// connectionString: 'http://test.com:1111/?database=test', | ||
// authService: new AnonymousAuthService(), | ||
// logger: testLogger}); | ||
|
||
// testLoggerFn.mockReset(); | ||
|
||
const driver = Object.create(Driver.prototype) as Driver; | ||
(driver as any).logger = testLogger; | ||
|
||
const ctx1 = DriverContext.getSafe(driver,'method1'); | ||
await ctx1.do(() => { | ||
const ctx2 = DriverContext.get('method2'); | ||
expect(ctx2).toBe(ctx1); | ||
}); | ||
expect(testLoggerFn.mock.calls).toEqual([['trace', 'method1'], ['trace', 'method2']]); | ||
}); | ||
|
||
it('get - error', async () => { | ||
expect(() => DriverContext.get('method')).toThrow(); | ||
}); | ||
}); |
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.
Oops, something went wrong.