Skip to content

Commit

Permalink
Dm/clean up test directories (vertica#145)
Browse files Browse the repository at this point in the history
* Restructuring v-pool test directory
* Updating package.json and tsconfig.json based on recent structure changes
  • Loading branch information
DMickens authored May 14, 2024
1 parent 2f62918 commit 62173ea
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 10 deletions.
5 changes: 3 additions & 2 deletions packages/v-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
"typescript": "^4.0.3"
},
"scripts": {
"test": "node_modules/.bin/mocha dist/**/*.test.js",
"test": "tsc -p ./test/tsconfig.json; node_modules/.bin/mocha test/dist/test/*.test.js",
"build": "tsc",
"build:watch": "tsc --watch",
"prepublish": "yarn build",
"pretest": "yarn build"
"pretest": "yarn build",
"clean": "rm -rf dist; rm -rf test/dist"
},
"repository": {
"type": "git",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
* =============================================================================
*/

import buffers from './testing/test-buffers'
import BufferList from './testing/buffer-list'
import { parse } from '.'
import buffers from './test-buffers'
import BufferList from './buffer-list'
import { parse } from '../src'
import assert from 'assert'
import { PassThrough } from 'stream'
import { BackendMessage } from './backend-messages'
import { BackendMessage } from '../src/backend-messages'

var authOkBuffer = buffers.authenticationOk()
var paramStatusBuffer = buffers.parameterStatus('client_encoding', 'UTF8')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/

import assert from 'assert'
import { serialize } from './serializer'
import BufferList from './testing/buffer-list'
import { serialize } from '../src/serializer'
import BufferList from './buffer-list'

describe('serializer', () => {
/*it('builds startup message', function () {
Expand Down
File renamed without changes.
27 changes: 27 additions & 0 deletions packages/v-protocol/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"target": "es6",
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"incremental": true,
"baseUrl": ".",
"declaration": true,
"paths": {
"*": [
"node_modules/*",
"src/types/*"
]
}
},
"include": [
"outbound-serializer.test.ts",
"inbound-parser.test.ts"
]
}

2 changes: 1 addition & 1 deletion packages/vertica-nodejs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ update-npm:
@npm i npm --global

bench:
@find benchmark -name "*-bench.js" | $(node-command)
@find test/benchmark -name "*bench.js" | $(node-command)

test-unit:
@printf "\n***TESTING VERTICA-NODEJS UNIT TESTS***\n\n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

const vertica = require('./lib')
const vertica = require('../../lib')

const params = {
text:
Expand Down Expand Up @@ -50,6 +50,9 @@ const bench = async (client, q, time) => {
}

const run = async () => {
console.log("Benchmarking currently does not work for vertica-nodejs and has not worked since being ported from node-postgres.")
console.log("In the future, consider fixing, or removing.")
/*
const client = new vertica.Client()
await client.connect()
console.log('start')
Expand Down Expand Up @@ -96,6 +99,7 @@ const run = async () => {
await client.end()
await client.end()
*/
}

run().catch((e) => console.error(e) || process.exit(-1))

0 comments on commit 62173ea

Please sign in to comment.