@@ -75,16 +75,15 @@ vi <some-directory>/node-oracledb/test/dbconfig.js
7575module .exports = {
7676 user : process .env .NODE_ORACLEDB_USER || " hr" ,
7777 password : process .env .NODE_ORACLEDB_PASSWORD || " welcome" ,
78- connectString : process .env .NODE_ORACLEDB_CONNECTIONSTRING || " localhost/orcl" ,
79- externalAuth : process .env .NODE_ORACLEDB_EXTERNALAUTH ? true : false
78+ connectString : process .env .NODE_ORACLEDB_CONNECTIONSTRING || " localhost/orcl"
8079};
8180```
8281
83- To use external authentication, set the ` externalAuth ` property to
84- ` true ` . Also make sure Oracle Database and the authentication service
85- have been appropriately configured. See
82+ To enable external authentication tests, please make sure Oracle Database
83+ and the authentication service have been appropriately configured. See
8684[ Documentation for External Authentication] ( https://github.com/oracle/node-oracledb/blob/master/doc/api.md#extauth )
87- for more details.
85+ for more details. And then, set the environment variable ` NODE_ORACLEDB_EXTERNALAUTH `
86+ to be ` true ` .
8887
8988Note: the test suite requires a schema with these privileges:
9089
@@ -117,10 +116,10 @@ This calls the `test` script defined in `oracledb/package.json`.
117116
118117```
119118cd <some-directory>/node_oracledb
120- npm run-script testWindows
119+ npm run testwindows
121120```
122121
123- This calls the ` testWindows ` script defined in ` oracledb/package.json ` .
122+ This calls the ` testwindows ` script defined in ` oracledb/package.json ` .
124123
125124See [ npm scripts] ( https://docs.npmjs.com/misc/scripts ) for more information
126125about how npm handles the "scripts" field of ` package.json ` .
@@ -135,6 +134,7 @@ cd <some-directory>/node_oracledb
135134See [ mochajs.org] ( http://mochajs.org/ ) for more information on running tests with mocha.
136135
137136## 3. Add Tests
137+
138138See [ CONTRIBUTING] ( https://github.com/oracle/node-oracledb/blob/master/CONTRIBUTING.md )
139139for general information on contribution requirements.
140140
@@ -145,6 +145,82 @@ assigned a number. The following number ranges have been chosen:
145145- 21 - 50 are reserved for data type supporting tests
146146- 51 onwards are for other tests
147147
148- ## 4. Test Index
148+ In order to include your tests in the suite, add each new test file
149+ name to [ ` test/opts/mocha.opts ` ] ( https://github.com/oracle/node-oracledb/blob/master/test/opts/mocha.opts ) .
150+
151+ Please also add a description of each individual test to the Test
152+ List.
153+
154+ ## 4. Test List
155+
156+ See [ ` test/list.txt ` ] ( https://github.com/oracle/node-oracledb/blob/master/test/list.txt )
157+ for the list of existing tests.
158+
159+ ## 5. Tests Compatibility
160+
161+ - We conduct base testing with Instant Client 11.2.0.4 and 12.1.0.2 on Linux X64
162+ and Windows 7.
163+
164+ - Users of 11.2.0.1 and 11.2.0.2 clients may see failures with poolTimeout.js
165+ and dataTypeDouble.js.
166+
167+ - Slow networks may cause some tests to timeout.
168+
169+ ## 6. Troubleshooting
170+
171+ You may encounter some troubles when running the test suite. These troubles
172+ might be caused by the concurrency issue of Mocha framework, network latencies,
173+ or database server issues. This section gives some issues that we ever saw
174+ and our solutions.
175+
176+ ### 6.1 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
177+
178+ This error occurs when Node.js programs try to change database objects which
179+ hold locks. The workaround would be:
180+
181+ (1) Use unique DB object names for each test to avoid interference between
182+ test files.
183+ (2) Try not to use 'beforeEach' blocks for object operations to avoid
184+ the interference between cases.
149185
150- See [ ` test/list.txt ` ] ( https://github.com/oracle/node-oracledb/blob/master/test/list.txt ) for the list of existing tests.
186+ ### 6.2 ORA-00018: maximum number of sessions exceeded
187+
188+ This error occurs when the test suite takes up more sessions than the
189+ configured limit. You can alter the session limit on the database server side.
190+ If you do not have access to change the database session setting, you could
191+ use the below script to deliberately add an interval between tests.
192+
193+ ``` Bash
194+ arr=$( ls test/* js)
195+ for case in ${arr[@]}
196+ do
197+ var=" $NODE_PATH /../node_modules/.bin/mocha --timeout 10000 $case "
198+ eval $var
199+ sleep 1
200+ done
201+ ```
202+
203+ ### 6.3 ORA-28865: SSL connection closed
204+
205+ You may encounter this error when the test suite sends more connection
206+ requests per second than the database is configured to handle.
207+
208+ There are two solutions:
209+
210+ - Solution 1: Change database ` RATE_LIMIT ` configuration. This parameter
211+ defines the connection count allowed per second. See [ RATE_LIMIT] ( https://docs.oracle.com/database/122/NETRF/Oracle-Net-Listener-parameters-in-listener-ora-file.htm#NETRF426 )
212+ for more information.
213+
214+ - Solution 2: Set the ` RETRY_COUNT ` and ` RETRY_DELAY ` parameters in
215+ connectString.
216+
217+ For example, below is the connectString which could be defined in
218+ ` tnsnames.ora ` file.
219+
220+ ```
221+ dbaccess = (description=(RETRY_COUNT=20)(RETRY_DELAY=3)
222+ (address=(protocol=tcps)(port=1521)(host=<db-host>))
223+ (connect_data=(service_name=<service-name>))
224+ (security=(my_wallet_directory=<wallet-location>)(ssl_server_cert_dn=<ssl-server-cert-dn>))
225+ )
226+ ```
0 commit comments