node-oracledb/test
Christopher Jones 0d328cf09a Add OAuth 2.0 token based authentication 2022-09-08 16:45:12 +10:00
..
opts Add OAuth 2.0 token based authentication 2022-09-08 16:45:12 +10:00
.editorconfig Add test editorconfig 2016-05-16 09:35:54 +10:00
README.md Add OAuth 2.0 token based authentication 2022-09-08 16:45:12 +10:00
accessPropertiesOnClosedObjects.js New attribution standards 2022-04-19 10:06:36 +10:00
aq1.js Refactor tests 2022-09-08 16:31:11 +10:00
aq2.js Refactor tests 2022-09-08 16:31:11 +10:00
aq3.js Refactor tests 2022-09-08 16:31:11 +10:00
aq4.js Tweak test 2022-08-12 16:01:17 +10:00
asyncStack.js Capture the error stack 2022-04-19 09:45:45 +10:00
autoCommit.js Refactor tests 2022-09-08 16:31:11 +10:00
autoCommit4nestedExecutes.js Refactor tests 2022-09-08 16:31:11 +10:00
autoCommitForSelect.js Refactor tests 2022-09-08 16:31:11 +10:00
bindTimestamp.js New attribution standards 2022-04-19 10:06:36 +10:00
binding.js New attribution standards 2022-04-19 10:06:36 +10:00
binding_DMLInsert.js New attribution standards 2022-04-19 10:06:36 +10:00
binding_DMLReturningInto.js New attribution standards 2022-04-19 10:06:36 +10:00
binding_buffer_string.js Update tests 2022-04-19 09:53:53 +10:00
binding_defaultBindIn.js New attribution standards 2022-04-19 10:06:36 +10:00
binding_defaultBindInout.js New attribution standards 2022-04-19 10:06:36 +10:00
binding_functionBindIn.js New attribution standards 2022-04-19 10:06:36 +10:00
binding_functionBindInout.js New attribution standards 2022-04-19 10:06:36 +10:00
binding_functionBindOut.js New attribution standards 2022-04-19 10:06:36 +10:00
binding_procedureBindIn.js New attribution standards 2022-04-19 10:06:36 +10:00
binding_procedureBindInout.js New attribution standards 2022-04-19 10:06:36 +10:00
binding_procedureBindOut.js New attribution standards 2022-04-19 10:06:36 +10:00
blobDMLBindAsBuffer.js New attribution standards 2022-04-19 10:06:36 +10:00
blobDMLReturningMultipleRowsAsBuffer.js New attribution standards 2022-04-19 10:06:36 +10:00
blobDMLReturningMultipleRowsAsStream.js New attribution standards 2022-04-19 10:06:36 +10:00
blobPlsqlBindAsBuffer_bindin.js New attribution standards 2022-04-19 10:06:36 +10:00
blobPlsqlBindAsBuffer_bindinout.js New attribution standards 2022-04-19 10:06:36 +10:00
blobPlsqlBindAsBuffer_bindout.js New attribution standards 2022-04-19 10:06:36 +10:00
blobStream.js New attribution standards 2022-04-19 10:06:36 +10:00
booleanBind.js New attribution standards 2022-04-19 10:06:36 +10:00
callTimeout.js New attribution standards 2022-04-19 10:06:36 +10:00
changePassword.js New attribution standards 2022-04-19 10:06:36 +10:00
clobDMLBindAsString.js New attribution standards 2022-04-19 10:06:36 +10:00
clobDMLReturningMultipleRowsAsStream.js New attribution standards 2022-04-19 10:06:36 +10:00
clobDMLReturningMultipleRowsAsString.js New attribution standards 2022-04-19 10:06:36 +10:00
clobPlsqlBindAsString_bindin.js New attribution standards 2022-04-19 10:06:36 +10:00
clobPlsqlBindAsString_bindinout.js New attribution standards 2022-04-19 10:06:36 +10:00
clobPlsqlBindAsString_bindout.js New attribution standards 2022-04-19 10:06:36 +10:00
clobPlsqlString.js New attribution standards 2022-04-19 10:06:36 +10:00
clobStream.js New attribution standards 2022-04-19 10:06:36 +10:00
clobexample.txt Update URL to reflect changed OTN hierarchy 2015-11-15 08:28:11 +11:00
columnMetadata.js New attribution standards 2022-04-19 10:06:36 +10:00
connClose.js New attribution standards 2022-04-19 10:06:36 +10:00
connHealthy.js New attribution standards 2022-04-19 10:06:36 +10:00
connProps.js New attribution standards 2022-04-19 10:06:36 +10:00
connection.js Refactor tests 2022-09-08 16:31:11 +10:00
connectionClass.js New attribution standards 2022-04-19 10:06:36 +10:00
constants.js New attribution standards 2022-04-19 10:06:36 +10:00
cqn01.js New attribution standards 2022-04-19 10:06:36 +10:00
cqn02.js New attribution standards 2022-04-19 10:06:36 +10:00
currentSchema.js Refactor a test 2022-08-12 14:25:25 +10:00
dataTypeAssist.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeBinaryDouble.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeBinaryFloat.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeBlob.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeChar.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeClob.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeDate.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeFloat.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeFloat2.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeJson.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeLong.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeLongRaw.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeNchar.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeNclob.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeNumber.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeNumber2.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeNvarchar2.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeRaw.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeRowid.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeTimestamp1.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeTimestamp2.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeTimestamp3.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeTimestamp4.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeTimestamp5.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeTimestamp6.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeUrowid.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeVarchar2.js New attribution standards 2022-04-19 10:06:36 +10:00
dataTypeXML.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject1.js Test case for multiple OUT binds for dbObject files 2022-05-17 13:16:40 +10:00
dbObject2.js Test case for multiple OUT binds for dbObject files 2022-05-17 13:16:40 +10:00
dbObject3.js Test case for multiple OUT binds for dbObject files 2022-05-17 13:16:40 +10:00
dbObject4.js Pesky whitespace 2022-06-08 20:02:39 +10:00
dbObject5.js Pesky whitespace 2022-06-08 20:02:39 +10:00
dbObject6.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject7.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject8.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject9.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject10.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject11.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject12.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject13.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject14.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject15.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject16.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject17.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject18.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObject19.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObjectOutBind.js New attribution standards 2022-04-19 10:06:36 +10:00
dbObjectsNestedTable.js Update template text 2022-05-17 13:16:40 +10:00
dbType01.js New attribution standards 2022-04-19 10:06:36 +10:00
dbType02.js New attribution standards 2022-04-19 10:06:36 +10:00
dbType03.js New attribution standards 2022-04-19 10:06:36 +10:00
dbType04.js Improve portability of a JSON test 2022-08-12 14:25:25 +10:00
dbconfig.js New attribution standards 2022-04-19 10:06:36 +10:00
devnull.js New attribution standards 2022-04-19 10:06:36 +10:00
dmlReturning.js New attribution standards 2022-04-19 10:06:36 +10:00
driverName.js New attribution standards 2022-04-19 10:06:36 +10:00
dupColNames1.js Add duplicate column name test 2022-09-08 16:31:11 +10:00
dupColNames2.js New attribution standards 2022-04-19 10:06:36 +10:00
editionTest.js New attribution standards 2022-04-19 10:06:36 +10:00
end2endTracing.js New attribution standards 2022-04-19 10:06:36 +10:00
errorOffset.js New attribution standards 2022-04-19 10:06:36 +10:00
examineOwnedProperties.js New attribution standards 2022-04-19 10:06:36 +10:00
examples.js Refactor tests 2022-09-08 16:31:11 +10:00
executeMany1.js New attribution standards 2022-04-19 10:06:36 +10:00
executeMany2.js New attribution standards 2022-04-19 10:06:36 +10:00
executeQueue.js New attribution standards 2022-04-19 10:06:36 +10:00
extendedMetaData.js New attribution standards 2022-04-19 10:06:36 +10:00
externalAuth.js New attribution standards 2022-04-19 10:06:36 +10:00
externalProxyAuth.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchArraySize1.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchArraySize2.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchArraySize3.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchArraySize4.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchArraySize5.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchArraySize6.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchArraySize7.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchArraySize8.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchArraySize9.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchAs.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchAsStringWithRefCursor.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchBinaryTypesAsString.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchBlobAsBuffer1.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchBlobAsBuffer2.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchBlobAsBuffer3.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchBlobAsBuffer4.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchClobAsString1.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchClobAsString2.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchClobAsString3.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchClobAsString4.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchLobAsStrBuf.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchNClobAsString.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchRawAsString.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchRowidAsString.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchTimestampAsString.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchUrowidAsString.js New attribution standards 2022-04-19 10:06:36 +10:00
fetchUrowidAsString_indexed.js New attribution standards 2022-04-19 10:06:36 +10:00
file.js New attribution standards 2022-04-19 10:06:36 +10:00
fuzzydinosaur.jpg Update tests for new functionality 2015-08-17 16:19:36 +10:00
getDataOfLob.js New attribution standards 2022-04-19 10:06:36 +10:00
getStmtInfo.js New attribution standards 2022-04-19 10:06:36 +10:00
implicitResults.js New attribution standards 2022-04-19 10:06:36 +10:00
indexedTables01.js New attribution standards 2022-04-19 10:06:36 +10:00
insertAll.js New attribution standards 2022-04-19 10:06:36 +10:00
insertNaNToNumber.js New attribution standards 2022-04-19 10:06:36 +10:00
instanceof1.js New attribution standards 2022-04-19 10:06:36 +10:00
jsObjectGetter1.js New attribution standards 2022-04-19 10:06:36 +10:00
jsObjectGetter2.js New attribution standards 2022-04-19 10:06:36 +10:00
jsonBind1.js New attribution standards 2022-04-19 10:06:36 +10:00
jsonBind2.js New attribution standards 2022-04-19 10:06:36 +10:00
keepInStmtCache.js New attribution standards 2022-04-19 10:06:36 +10:00
lastRowid.js New attribution standards 2022-04-19 10:06:36 +10:00
list.txt Add OAuth 2.0 token based authentication 2022-09-08 16:45:12 +10:00
lobBind1.js New attribution standards 2022-04-19 10:06:36 +10:00
lobBind2.js New attribution standards 2022-04-19 10:06:36 +10:00
lobBindAsStringBuffer.js New attribution standards 2022-04-19 10:06:36 +10:00
lobClose.js New attribution standards 2022-04-19 10:06:36 +10:00
lobProperties1.js New attribution standards 2022-04-19 10:06:36 +10:00
lobProperties2.js New attribution standards 2022-04-19 10:06:36 +10:00
lobResultSet.js New attribution standards 2022-04-19 10:06:36 +10:00
longDMLBind.js New attribution standards 2022-04-19 10:06:36 +10:00
longProcedureBind_in.js New attribution standards 2022-04-19 10:06:36 +10:00
longProcedureBind_inout.js New attribution standards 2022-04-19 10:06:36 +10:00
longProcedureBind_out.js New attribution standards 2022-04-19 10:06:36 +10:00
longrawDMLBind.js New attribution standards 2022-04-19 10:06:36 +10:00
longrawProcedureBind_in.js New attribution standards 2022-04-19 10:06:36 +10:00
longrawProcedureBind_inout.js New attribution standards 2022-04-19 10:06:36 +10:00
longrawProcedureBind_out.js New attribution standards 2022-04-19 10:06:36 +10:00
maxRows.js New attribution standards 2022-04-19 10:06:36 +10:00
methodName.js Keep the method name in internally bound functions 2022-04-19 09:42:29 +10:00
multipleLobInsertion.js New attribution standards 2022-04-19 10:06:36 +10:00
nclobDMLBindAsString.js New attribution standards 2022-04-19 10:06:36 +10:00
nestedCursor01.js New attribution standards 2022-04-19 10:06:36 +10:00
nestedCursor02.js New attribution standards 2022-04-19 10:06:36 +10:00
nestedCursor03.js New attribution standards 2022-04-19 10:06:36 +10:00
nestedCursor04.js New attribution standards 2022-04-19 10:06:36 +10:00
nestedCursor05.js New attribution standards 2022-04-19 10:06:36 +10:00
notes.js New attribution standards 2022-04-19 10:06:36 +10:00
nullColumnValues.js New attribution standards 2022-04-19 10:06:36 +10:00
plsqlBindCursorsIN.js New attribution standards 2022-04-19 10:06:36 +10:00
plsqlBindIndexedTable1.js New attribution standards 2022-04-19 10:06:36 +10:00
plsqlBindIndexedTable2.js New attribution standards 2022-04-19 10:06:36 +10:00
plsqlBindList.js New attribution standards 2022-04-19 10:06:36 +10:00
plsqlBindScalar.js New attribution standards 2022-04-19 10:06:36 +10:00
pool.js New attribution standards 2022-04-19 10:06:36 +10:00
poolCache.js New attribution standards 2022-04-19 10:06:36 +10:00
poolClose.js New attribution standards 2022-04-19 10:06:36 +10:00
poolDrain.js New attribution standards 2022-04-19 10:06:36 +10:00
poolPing.js New attribution standards 2022-04-19 10:06:36 +10:00
poolReconfigure.js New attribution standards 2022-04-19 10:06:36 +10:00
prefetchRows.js New attribution standards 2022-04-19 10:06:36 +10:00
properties.js Test refactoring 2022-08-12 14:25:20 +10:00
random.js New attribution standards 2022-04-19 10:06:36 +10:00
resultSet1.js Refactor tests 2022-09-08 16:31:11 +10:00
resultSet2.js New attribution standards 2022-04-19 10:06:36 +10:00
resultSetClose.js New attribution standards 2022-04-19 10:06:36 +10:00
resultsetToStream.js New attribution standards 2022-04-19 10:06:36 +10:00
rowidDMLBindAsString.js New attribution standards 2022-04-19 10:06:36 +10:00
rowidFunctionBindAsString_bind.js New attribution standards 2022-04-19 10:06:36 +10:00
rowidFunctionBindAsString_bindinout.js New attribution standards 2022-04-19 10:06:36 +10:00
rowidProcedureBindAsString_bindin.js New attribution standards 2022-04-19 10:06:36 +10:00
rowidProcedureBindAsString_bindinout.js New attribution standards 2022-04-19 10:06:36 +10:00
rowidProcedureBindAsString_bindout.js New attribution standards 2022-04-19 10:06:36 +10:00
rsGetAllRows1.js New attribution standards 2022-04-19 10:06:36 +10:00
rsGetAllRows2.js New attribution standards 2022-04-19 10:06:36 +10:00
runCQN.js New attribution standards 2022-04-19 10:06:36 +10:00
sessionTag.js New attribution standards 2022-04-19 10:06:36 +10:00
soda1.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda2.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda3.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda4.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda5.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda6.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda7.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda8.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda9.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda10.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda11.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda12.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda13.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
soda14.js Refactor some SODA tests 2022-08-12 14:25:25 +10:00
sodaInstanceof.js New attribution standards 2022-04-19 10:06:36 +10:00
sodaMetaDataCache.js New attribution standards 2022-04-19 10:06:36 +10:00
sodaOverwrite.js New attribution standards 2022-04-19 10:06:36 +10:00
sodaUtil.js New attribution standards 2022-04-19 10:06:36 +10:00
sodahint.js New attribution standards 2022-04-19 10:06:36 +10:00
sql.js New attribution standards 2022-04-19 10:06:36 +10:00
sqlClone.js New attribution standards 2022-04-19 10:06:36 +10:00
sqlWithWarnings.js New attribution standards 2022-04-19 10:06:36 +10:00
stream1.js New attribution standards 2022-04-19 10:06:36 +10:00
stream2.js New attribution standards 2022-04-19 10:06:36 +10:00
streamErrorEvent.js New attribution standards 2022-04-19 10:06:36 +10:00
testsUtil.js New attribution standards 2022-04-19 10:06:36 +10:00
tpc.js New attribution standards 2022-04-19 10:06:36 +10:00
tpcResume.js New attribution standards 2022-04-19 10:06:36 +10:00
tree.jpg Sync tests and fix missed merges 2017-06-14 11:54:45 +10:00
uninitializedLob.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidDMLBindAsString1.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidDMLBindAsString2.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidFunctionBindAsString1.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidFunctionBindAsString2.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidFunctionBindAsString3.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidFunctionBindAsString4.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidProcedureBindAsString1.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidProcedureBindAsString2.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidProcedureBindAsString3.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidProcedureBindAsString4.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidProcedureBindAsString5.js New attribution standards 2022-04-19 10:06:36 +10:00
urowidProcedureBindAsString6.js New attribution standards 2022-04-19 10:06:36 +10:00
userName.js New attribution standards 2022-04-19 10:06:36 +10:00
writableProperties1.js New attribution standards 2022-04-19 10:06:36 +10:00

README.md

Test node-oracledb

Copyright (c) 2015, 2022, Oracle and/or its affiliates.

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.

Contents

  1. Preparations
  2. Run tests
  3. Enable tests that require extra configuration
  4. Contribute New Tests
  5. Troubleshoot

1. Preparations

See INSTALL for installation details.

On macOS, run a command like:

ln -s $HOME/Downloads/instantclient_19_8/libclntsh.dylib $(npm root)/oracledb/build/Release

Note: the test suite is on GitHub.

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

Set the following environment variables to provide credentials for the test suite.

  • NODE_ORACLEDB_USER provides the username of the schema user which you used for testing.

  • NODE_ORACLEDB_PASSWORD provides the password of the schema user which you used for testing.

  • NODE_ORACLEDB_CONNECTIONSTRING provides the connection string that points to your database's location.

  • NODE_ORACLEDB_EXTERNALAUTH provides the options for external authentication tests. Setting this environment variable to "true" will enable the tests that require external authentication. To ensure external authentication tests works, firstly make sure the Oracle external authentication service is correctly configured. See Documentation for External Authentication for details.

  • NODE_ORACLEDB_DBA_PRIVILEGE provides the options for DBA privilege. Setting this environment variable to "true" will enable the tests and utilities that require DBA privilege.

  • NODE_ORACLEDB_DBA_USER provides the username of the DBA user which you used for testing, disabled if NODE_ORACLEDB_DBA_PRIVILEGE is not true.

  • NODE_ORACLEDB_DBA_PASSWORD provides the password of the DBA user which you used for testing, disabled if NODE_ORACLEDB_DBA_PRIVILEGE is not true.

  • NODE_ORACLEDB_PROXY_SESSION_USER provides the username of a schema user that can connect through the schema user which you used for testing using proxy authentication. Setting this environment variable will enable the tests that require proxy authentication.

  • NODE_ORACLEDB_QA. This boolean environment variable serves as the toggle switch of certain tests. Some tests, such as callTimeout.js, use hard-coded variables as assertion condition. The test results may be inconsistent in different network situations.

Note: the test suite requires the schema to have these privileges: CREATE TABLE, CREATE SESSION, CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER, and CREATE TYPE.

1.5 Set NODE_PATH

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

2. Run tests

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

2.1 Run the complete test suite

cd node-oracledb
npm test

2.2 Run specified tests

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

3. Enable tests that requires extra configuration

The following test(s) are automatically skipped if their required environment variable(s) are not properly set.

3.1 externalProxyAuth.js

This test aims to test the combined usage of external authentication and proxy authentication. To run this test, you need to complete the following prerequisite setups.

  • Enable external authentication on the schema user which you used for testing. See Documentation for External Authentication for more information on external authentication. Then use the following command to enable external authentication in the test suite.

    export NODE_ORACLEDB_EXTERNALAUTH true
    
    
  • Enable proxy authentication on another schema user specified by environment variable NODE_ORACLEDB_PROXY_SESSION_USER that connects through the schema user which you used for testing. See Documentation for Pool Proxy Authentication for more information on proxy authentication. Then use the following command to enable proxy authentication in the test suite.

    export NODE_ORACLEDB_PROXY_SESSION_USER "Your_Proxy_Authenticating_User"
    
    

3.2 SODA tests

To execute SODA tests, Oracle Database users require the SODA_APP role granted to them by a DBA. If SODA_APP is not granted, SODA tests will be skipped.

To grant the SODA_APP role to a Oracle Database user, typically a DBA would execute:

```
grant SODA_APP to <Oracle Database user>

```

4. Contribute New 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.

5. Troubleshoot

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.

5.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.

5.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

5.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>))
       )

5.4 ORA-03114: not connected to ORACLE

We firstly encoutered this error with test/callTimeout.js. It uses some hard-coded variables as assertion condition, which may lead to assertion fail in slow network situation.

The solution is commenting out this line sqlnet.recv_timeout=<minutes> from sqlnet.ora file.