node-oracledb/test
Christopher Jones 40e8a580cf Add external proxy authentication test 2019-01-03 09:10:21 +11:00
..
opts Add external proxy authentication test 2019-01-03 09:10:21 +11:00
.editorconfig Add test editorconfig 2016-05-16 09:35:54 +10:00
README.md Use new documentation version-independent links 2018-08-22 13:14:25 +10:00
autoCommit.js Update test descriptions 2018-02-09 19:51:13 +11:00
autoCommit4nestedExecutes.js Update test descriptions 2018-02-09 19:51:13 +11:00
autoCommitForSelect.js Update test descriptions 2018-02-09 19:51:13 +11:00
bindTimestamp.js Update test descriptions 2018-02-09 19:51:13 +11:00
binding.js Avoid setting keys on the object to the value undefined 2018-06-27 16:30:21 +10:00
binding_DMLInsert.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
binding_DMLReturningInto.js Update test descriptions 2018-12-23 09:36:33 +11:00
binding_defaultBindIn.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
binding_defaultBindInout.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
binding_functionBindIn.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
binding_functionBindInout.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
binding_functionBindOut.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
binding_procedureBindIn.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
binding_procedureBindInout.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
binding_procedureBindOut.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
blobDMLBindAsBuffer.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
blobDMLReturningMultipleRowsAsBuffer.js Allow DML RETURNING of RAW data 2018-03-27 16:54:55 +11:00
blobDMLReturningMultipleRowsAsStream.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
blobPlsqlBindAsBuffer_bindin.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
blobPlsqlBindAsBuffer_bindinout.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
blobPlsqlBindAsBuffer_bindout.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
blobStream.js Update test descriptions 2018-02-09 19:51:13 +11:00
changePassword.js Update SQL of schema creation 2018-11-15 16:31:12 +11:00
checkClassesTypes.js Update test descriptions 2018-02-09 19:51:13 +11:00
clobDMLBindAsString.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
clobDMLReturningMultipleRowsAsStream.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
clobDMLReturningMultipleRowsAsString.js Update test descriptions 2018-02-09 19:51:13 +11:00
clobPlsqlBindAsString_bindin.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
clobPlsqlBindAsString_bindinout.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
clobPlsqlBindAsString_bindout.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
clobPlsqlString.js Update test descriptions 2018-02-09 19:51:13 +11:00
clobStream.js Update test descriptions 2018-02-09 19:51:13 +11:00
clobexample.txt Update URL to reflect changed OTN hierarchy 2015-11-15 08:28:11 +11:00
columnMetadata.js Update test descriptions 2018-02-09 19:51:13 +11:00
connClose.js Add properties oracledb.oracleClientVersionString and connection.oracleServerVersionString 2018-03-27 16:01:20 +11:00
connection.js Add basic tests for connection.ping() 2018-03-27 16:59:22 +11:00
constants.js Add tests for connection.getStatementInfo() 2018-04-03 07:43:37 +10:00
dataTypeAssist.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
dataTypeBinaryDouble.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeBinaryFloat.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeBlob.js Enhance LOB tests 2018-11-15 16:31:12 +11:00
dataTypeChar.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeClob.js Enhance LOB tests 2018-11-15 16:31:12 +11:00
dataTypeDate.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeFloat.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeFloat2.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeLong.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeLongRaw.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeNchar.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeNclob.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
dataTypeNumber.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeNumber2.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeNvarchar2.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeRaw.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
dataTypeRowid.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeTimestamp1.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeTimestamp2.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeTimestamp3.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeTimestamp4.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeTimestamp5.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeTimestamp6.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeUrowid.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeVarchar2.js Update test descriptions 2018-02-09 19:51:13 +11:00
dataTypeXML.js Add a negative test for XML support 2018-12-23 10:00:43 +11:00
dbconfig.js Add external proxy authentication test 2019-01-03 09:10:21 +11:00
deferLibInit.js Fix test typo 2019-01-03 09:07:56 +11:00
deferLibInit1.js Add tests for deferring ODPI-C initialization 2018-12-23 09:59:57 +11:00
deferLibInit2.js Add tests for deferring ODPI-C initialization 2018-12-23 09:59:57 +11:00
deferLibInit3.js Add tests for deferring ODPI-C initialization 2018-12-23 09:59:57 +11:00
devnull.js Sync tests and fix missed merges 2017-06-14 11:54:45 +10:00
dmlReturning.js Allow DML RETURNING of RAW data 2018-03-27 16:54:55 +11:00
driverName.js Update doc links to point to new gh-pages site https://oracle.github.io/node-oracledb/ 2018-03-27 16:11:29 +11:00
editionTest.js Update SQL of schema creation 2018-11-15 16:31:12 +11:00
end2endTracing.js Add tests for end-to-end tracing attributes 2018-03-27 16:37:25 +11:00
examples.js Adjust tests regarding DB 11 2018-09-30 22:23:39 +10:00
executeMany1.js Add regression test for GitHub issue #995 2018-11-15 16:14:40 +11:00
executeMany2.js Fix comment typo 2018-11-15 16:31:12 +11:00
extendedMetaData.js Update test descriptions 2018-02-09 19:51:13 +11:00
externalAuth.js Update external auth test 2018-11-27 13:52:24 +11:00
externalProxyAuth.js Add external proxy authentication test 2019-01-03 09:10:21 +11:00
fetchArraySize1.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchArraySize2.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchArraySize3.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchArraySize4.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchArraySize5.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchArraySize6.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchArraySize7.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchArraySize8.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchArraySize9.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
fetchAs.js Allow an empty object for fetchInfo 2018-03-27 16:54:18 +11:00
fetchAsStringWithRefCursor.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchBlobAsBuffer1.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
fetchBlobAsBuffer2.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
fetchBlobAsBuffer3.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
fetchBlobAsBuffer4.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
fetchClobAsString1.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
fetchClobAsString2.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
fetchClobAsString3.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
fetchClobAsString4.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
fetchRowidAsString.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchTimestampAsString.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchUrowidAsString.js Update test descriptions 2018-02-09 19:51:13 +11:00
fetchUrowidAsString_indexed.js Update test descriptions 2018-02-09 19:51:13 +11:00
file.js Test updates 2017-06-17 09:40:09 +10:00
fuzzydinosaur.jpg Update tests for new functionality 2015-08-17 16:19:36 +10:00
getStmtInfo.js Add tests for connection.getStatementInfo() 2018-04-03 07:43:37 +10:00
insertAll.js Add tests for INSERT ALL 2018-02-12 15:47:15 +11:00
insertNaNToNumber.js Update test descriptions 2018-02-09 19:51:13 +11:00
instanceof.js Update test descriptions 2018-02-09 19:51:13 +11:00
jsObjectGetter1.js Add regression tests 2018-11-15 16:10:27 +11:00
jsObjectGetter2.js Add regression tests 2018-11-15 16:10:27 +11:00
list.txt Add external proxy authentication test 2019-01-03 09:10:21 +11:00
lobBind1.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
lobBind2.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
lobBindAsStringBuffer.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
lobClose.js Fix a test potential async issue 2018-08-22 13:24:44 +10:00
lobProperties1.js Update test descriptions 2018-02-09 19:51:13 +11:00
lobProperties2.js Update test descriptions 2018-02-09 19:51:13 +11:00
lobResultSet.js Correct order of operations 2018-09-04 08:12:00 +10:00
longDMLBind.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
longProcedureBind_in.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
longProcedureBind_inout.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
longProcedureBind_out.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
longrawDMLBind.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
longrawProcedureBind_in.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
longrawProcedureBind_inout.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
longrawProcedureBind_out.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
maxRows.js Update test descriptions 2018-02-09 19:51:13 +11:00
multipleLobInsertion.js Update doc links to point to new gh-pages site https://oracle.github.io/node-oracledb/ 2018-03-27 16:11:29 +11:00
nclobDMLBindAsString.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
nestedCursor.js Update test descriptions 2018-02-09 19:51:13 +11:00
notes.js New Mocha test file for Node.js 6, since newer tests use async/await 2018-09-27 15:00:21 +10:00
nullColumnValues.js Update test descriptions 2018-02-09 19:51:13 +11:00
plsqlBindIndexedTable1.js Update test descriptions 2018-02-09 19:51:13 +11:00
plsqlBindIndexedTable2.js Update test descriptions 2018-02-09 19:51:13 +11:00
plsqlBindScalar.js Remove deprecated Buffer() function in tests 2018-05-22 15:02:09 +10:00
pool.js Added drainTime to pool.close() PR #950 (Danilo Silva) 2018-09-04 08:09:07 +10:00
poolCache.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
poolClose.js Test updates 2018-09-27 14:56:26 +10:00
poolDrain.js Add regression tests 2018-11-15 16:10:27 +11:00
poolPing.js Update test descriptions 2018-02-09 19:51:13 +11:00
prefetchRows.js Update test descriptions 2018-02-09 19:51:13 +11:00
promises.js Update test descriptions 2018-02-09 19:51:13 +11:00
properties.js Update connection queueing tests 2018-08-22 13:28:20 +10:00
random.js Update test descriptions 2018-02-09 19:51:13 +11:00
resultSet1.js Update table name 2018-09-30 22:20:25 +10:00
resultSet2.js Update test descriptions 2018-02-09 19:51:13 +11:00
resultSetClose.js Update test descriptions 2018-02-09 19:51:13 +11:00
resultsetToStream.js Update test descriptions 2018-02-09 19:51:13 +11:00
rowidDMLBindAsString.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
rowidFunctionBindAsString_bind.js Update test descriptions 2018-02-09 19:51:13 +11:00
rowidFunctionBindAsString_bindinout.js Update test descriptions 2018-02-09 19:51:13 +11:00
rowidProcedureBindAsString_bindin.js Update test descriptions 2018-02-09 19:51:13 +11:00
rowidProcedureBindAsString_bindinout.js Update test descriptions 2018-02-09 19:51:13 +11:00
rowidProcedureBindAsString_bindout.js Update test descriptions 2018-02-09 19:51:13 +11:00
soda1.js Adjust SODA tests for Oracle Cloud 2018-12-04 16:55:35 +11:00
soda2.js Add a test which inserts SODA documents with a pool 2018-12-23 09:35:09 +11:00
soda3.js Update test descriptions 2018-12-23 09:36:33 +11:00
soda4.js Adjust SODA tests for Oracle Cloud 2018-12-04 16:55:35 +11:00
soda5.js Add a SODA getDataGuide test 2018-11-30 08:36:47 +11:00
soda6.js Add SODA tests for sodaOperation 2018-11-30 08:34:44 +11:00
soda7.js Add SODA tests for sodaOperation 2018-11-30 08:34:44 +11:00
soda8.js Add SODA tests for sodaOperation 2018-11-30 08:34:44 +11:00
soda9.js Update SODA index tests 2018-12-04 16:54:26 +11:00
soda11.js Adjust SODA tests for Oracle Cloud 2018-12-04 16:55:35 +11:00
sodaCallback.js Initial SODA tests 2018-09-30 22:25:54 +10:00
sodaUtil.js Add SODA tests for sodaOperation 2018-11-30 08:34:44 +11:00
sql.js Test updates 2017-06-14 10:53:11 +10:00
sqlWithWarnings.js Update test descriptions 2018-02-09 19:51:13 +11:00
stream1.js Remove a stress test from the functional test suite 2018-09-27 14:56:27 +10:00
stream2.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
streamErrorEvent.js Update test descriptions 2018-02-09 19:51:13 +11:00
tree.jpg Sync tests and fix missed merges 2017-06-14 11:54:45 +10:00
uninitializedLob.js Update test descriptions 2018-02-09 19:51:13 +11:00
urowidDMLBindAsString1.js Remove the timeout settings in each specific tests 2018-04-03 07:42:39 +10:00
urowidDMLBindAsString2.js Update test descriptions 2018-02-09 19:51:13 +11:00
urowidFunctionBindAsString1.js Enable some UROWID tests 2018-03-27 16:57:04 +11:00
urowidFunctionBindAsString2.js Enable some UROWID tests 2018-03-27 16:57:04 +11:00
urowidFunctionBindAsString3.js Update test descriptions 2018-02-09 19:51:13 +11:00
urowidFunctionBindAsString4.js Update test descriptions 2018-02-09 19:51:13 +11:00
urowidProcedureBindAsString1.js Enable some UROWID tests 2018-03-27 16:57:04 +11:00
urowidProcedureBindAsString2.js Enable some UROWID tests 2018-03-27 16:57:04 +11:00
urowidProcedureBindAsString3.js Enable some UROWID tests 2018-03-27 16:57:04 +11:00
urowidProcedureBindAsString4.js Update test descriptions 2018-02-09 19:51:13 +11:00
urowidProcedureBindAsString5.js Update test descriptions 2018-02-09 19:51:13 +11:00
urowidProcedureBindAsString6.js Update test descriptions 2018-02-09 19:51:13 +11:00
writableProperties.js Update test descriptions 2018-02-09 19:51:13 +11:00

README.md

Test node-oracledb

Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.

You may not use the identified files except in compliance with the Apache License, Version 2.0 (the "License.")

You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

The node-oracledb test suite uses 'mocha', 'should' and 'async'. See LICENSE for relevant licenses.

1. Preparations

See INSTALL for installation details.

Note: the test suite is on GitHub. NPM module has not contained the tests since node-oracledb 1.9.1.

1.1 Create a working directory

mkdir <some-directory>
cd <some-directory>

1.2 Clone node-oracledb from GitHub

Clone the project repository:

cd <some-directory>
git clone https://github.com/oracle/node-oracledb.git

1.3 Build

cd <some-directory>/node-oracledb
npm install

Running npm install within the node-oracledb/ directory will recompile oracledb and install all its dependent modules. These are listed in the devDependencies field of package.json file. Thus, 'mocha', 'async' and 'should' modules are installed by this command.

The test suite uses mocha, async and should.

1.4 Configure Database credentials

The file test\dbconfig.js contains the configuration. Change the credential information to yours.

To enable external authentication tests, firstly make sure the Oracle external authentication service is correctly configured. See Documentation for External Authentication for details.

Note: the test suite requires a schema with privileges CREATE TABLE, CREATE SESSION, CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER.

1.5 Set NODE_PATH

export NODE_PATH=<some-directory>/node-oracledb/lib

2. Run tests

2.1 Run the complete test suite

cd node-oracledb
npm test

2.2 Run specified test(s)

cd node_oracledb
./node_modules/.bin/mocha test/<test-names>

See mochajs.org for more information on running tests with mocha.

3. Add Tests

See CONTRIBUTING for general information on contribution requirements.

For easy correlation between results and test code, each test is assigned a number. The Test List shows the numbering of tests.

In order to include your tests in the suite, add each new test file name to test/opts/mocha.opts.

4. Troubleshooting

You may encounter some troubles when running the test suite. These troubles might be caused by the concurrency issue of Mocha framework, network latencies, or database server issues. This section gives some issues that we ever saw and our solutions.

4.1 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

This error occurs when Node.js programs try to change database objects which hold locks. The workaround would be:

(1) Use unique DB object names for each test to avoid interference between test files. (2) Try not to use 'beforeEach' blocks for object operations to avoid the interference between cases.

4.2 ORA-00018: maximum number of sessions exceeded

This error occurs when the test suite takes up more sessions than the configured limit. You can alter the session limit on the database server side. If you do not have access to change the database session setting, you could use the below script to deliberately add an interval between tests.

arr=$(ls test/*js)
for case in ${arr[@]}
do
  var="$NODE_PATH/../node_modules/.bin/mocha --timeout 10000 $case"
  eval $var
  sleep 1
done

4.3 ORA-28865: SSL connection closed

You may encounter this error when the test suite sends more connection requests per second than the database is configured to handle.

There are two solutions:

  • Solution 1: Change database RATE_LIMIT configuration. This parameter defines the connection count allowed per second. See RATE_LIMIT for more information.

  • Solution 2: Set the RETRY_COUNT and RETRY_DELAY parameters in connectString.

For example, below is the connectString which could be defined in tnsnames.ora file.

dbaccess = (description=(RETRY_COUNT=20)(RETRY_DELAY=3)
          (address=(protocol=tcps)(port=1521)(host=<db-host>))
          (connect_data=(service_name=<service-name>))
          (security=(my_wallet_directory=<wallet-location>)(ssl_server_cert_dn=<ssl-server-cert-dn>))
       )