Skip to content

Commit 95706e1

Browse files
committed
Update test/README.md
1 parent fce9036 commit 95706e1

File tree

1 file changed

+48
-20
lines changed

1 file changed

+48
-20
lines changed

test/README.md

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,44 @@ The node-oracledb test suite uses 'mocha', 'should' and 'async'. See
1919
[LICENSE](https://github.com/oracle/node-oracledb/blob/master/LICENSE.md)
2020
for relevant licenses.
2121

22-
## 1. Preparations
22+
## <a name="contents"></a> Contents
23+
24+
1. [Preparations](#preparations)
25+
- 1.1 [Create a work directory](#workdir)
26+
- 1.2 [Clone node-oracledb from GitHub](#clonerep)
27+
- 1.3 [Build](#build)
28+
- 1.4 [Configure Database credentials](#credentials)
29+
- 1.5 [Set NODE_PATH](#nodepath)
30+
2. [Run tests](#runtests)
31+
- 2.1 [Run the complete test suite](#runall)
32+
- 2.2 [Run specified tests](#runspecified)
33+
3. [Enable tests that require extra configuration](#enablespecified)
34+
- 3.1 [externalProxyAuth.js](#externalproxyauth)
35+
4. [Contribute New Tests](#addtests)
36+
5. [Troubleshoot](#troubleshoot)
37+
- 5.1 [ORA-00054: resource busy](#ORA-00054)
38+
- 5.2 [ORA-00018: maximum number of sessions exceeded](#ORA-00018)
39+
- 5.3 [ORA-28865: SSL connection closed](#ORA-28865)
40+
- 5.4 [ORA-03114: not connected to ORACLE](#ORA-03114)
41+
42+
43+
## <a name="preparations"></a> 1. Preparations
2344

2445
See [INSTALL](https://oracle.github.io/node-oracledb/INSTALL.html)
2546
for installation details.
2647

2748
Note: the
2849
[test suite](https://github.com/oracle/node-oracledb/tree/master/test)
29-
is on GitHub. NPM module has not contained the tests since node-oracledb 1.9.1.
50+
is on GitHub. NPM module had not contained the tests since node-oracledb 1.9.1.
3051

31-
### 1.1 Create a working directory
52+
### <a name="workdir"></a> 1.1 Create a working directory
3253

3354
```
3455
mkdir <some-directory>
3556
cd <some-directory>
3657
```
3758

38-
### 1.2 Clone node-oracledb from GitHub
59+
### <a name="clonerep"></a> 1.2 Clone node-oracledb from GitHub
3960

4061
Clone the project repository:
4162

@@ -44,7 +65,7 @@ cd <some-directory>
4465
git clone https://github.com/oracle/node-oracledb.git
4566
```
4667

47-
### 1.3 Build
68+
### <a name="build"></a> 1.3 Build
4869

4970
```
5071
cd <some-directory>/node-oracledb
@@ -60,7 +81,7 @@ The test suite uses [mocha](https://www.npmjs.com/package/mocha),
6081
[async](https://www.npmjs.com/package/async) and
6182
[should](https://www.npmjs.com/package/should).
6283

63-
### 1.4 Configure Database credentials
84+
### <a name="credentials"></a> 1.4 Configure Database credentials
6485

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

@@ -80,25 +101,27 @@ Set the following environment variables to provide credentials for the test suit
80101

81102
* `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.
82103

83-
Note: the test suite requires a schema with privileges CREATE TABLE, CREATE SESSION,
84-
CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER.
104+
* `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.
85105

86-
### 1.5 Set NODE_PATH
106+
Note: the test suite requires the schema to have these privileges: CREATE TABLE, CREATE SESSION,
107+
CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER, and CREATE TYPE.
108+
109+
### <a name="nodepath"></a> 1.5 Set NODE_PATH
87110

88111
```bash
89112
export NODE_PATH=<some-directory>/node-oracledb/lib
90113
```
91114

92-
## 2. Run tests
115+
## <a name="runtests"></a> 2. Run tests
93116

94-
### 2.1 Run the complete test suite
117+
### <a name="runall"></a> 2.1 Run the complete test suite
95118

96119
```
97120
cd node-oracledb
98121
npm test
99122
```
100123

101-
### 2.2 Run specified test(s)
124+
### <a name="runspecified"></a> 2.2 Run specified tests
102125

103126
```
104127
cd node_oracledb
@@ -107,11 +130,11 @@ cd node_oracledb
107130

108131
See [mochajs.org](http://mochajs.org/) for more information on running tests with mocha.
109132

110-
## 3. Enable test(s) that requires extra configuration
133+
## <a name="enablespecified"></a> 3. Enable tests that requires extra configuration
111134

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

114-
### 3.1 externalProxyAuth.js
137+
### <a name="externalproxyauth"></a> 3.1 externalProxyAuth.js
115138
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.
116139

117140
* Enable external authentication on the schema user which you used for testing. See [Documentation for External Authentication](https://oracle.github.io/node-oracledb/doc/api.html#extauth) for more information on external authentication. Then use the following command to enable external authentication in the test suite.
@@ -128,8 +151,7 @@ This test aims to test the combined usage of external authentication and proxy a
128151
129152
```
130153
131-
132-
## 4. Add Tests
154+
## <a name="addtests"></a> 4. Contribute New Tests
133155
134156
See [CONTRIBUTING](https://github.com/oracle/node-oracledb/blob/master/CONTRIBUTING.md)
135157
for general information on contribution requirements.
@@ -141,14 +163,14 @@ shows the numbering of tests.
141163
In order to include your tests in the suite, add each new test file
142164
name to [`test/opts/mocha.opts`](https://github.com/oracle/node-oracledb/blob/master/test/opts/mocha.opts).
143165
144-
## 5. Troubleshooting
166+
## <a name="troubleshoot"></a> 5. Troubleshoot
145167
146168
You may encounter some troubles when running the test suite. These troubles
147169
might be caused by the concurrency issue of Mocha framework, network latencies,
148170
or database server issues. This section gives some issues that we ever saw
149171
and our solutions.
150172
151-
### 5.1 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
173+
### <a name="ORA-00054"></a> 5.1 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
152174
153175
This error occurs when Node.js programs try to change database objects which
154176
hold locks. The workaround would be:
@@ -158,7 +180,7 @@ test files.
158180
(2) Try not to use 'beforeEach' blocks for object operations to avoid
159181
the interference between cases.
160182
161-
### 5.2 ORA-00018: maximum number of sessions exceeded
183+
### <a name="ORA-00018"></a> 5.2 ORA-00018: maximum number of sessions exceeded
162184
163185
This error occurs when the test suite takes up more sessions than the
164186
configured limit. You can alter the session limit on the database server side.
@@ -175,7 +197,7 @@ do
175197
done
176198
```
177199

178-
### 5.3 ORA-28865: SSL connection closed
200+
### <a name="ORA-28865"></a> 5.3 ORA-28865: SSL connection closed
179201

180202
You may encounter this error when the test suite sends more connection
181203
requests per second than the database is configured to handle.
@@ -199,3 +221,9 @@ dbaccess = (description=(RETRY_COUNT=20)(RETRY_DELAY=3)
199221
(security=(my_wallet_directory=<wallet-location>)(ssl_server_cert_dn=<ssl-server-cert-dn>))
200222
)
201223
```
224+
225+
### <a name="ORA-03114"></a> 5.4 ORA-03114: not connected to ORACLE
226+
227+
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.
228+
229+
The solution is commenting out this line `sqlnet.recv_timeout=<minutes>` from `sqlnet.ora` file.

0 commit comments

Comments
 (0)