Skip to content

Commit 551e461

Browse files
committed
Add pre-req information to test/README.md
1 parent 332b0e9 commit 551e461

File tree

1 file changed

+48
-5
lines changed

1 file changed

+48
-5
lines changed

test/README.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@ CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER.
7676
export NODE_PATH=<some-directory>/node-oracledb/lib
7777
```
7878

79+
### 1.6 Available Environment Variables
80+
81+
Setting the following environment variables will override the default values defined in test/dbconfig.js.
82+
83+
* `NODE_ORACLEDB_USER` overrides the username of the schema user which you used for testing.
84+
85+
* `NODE_ORACLEDB_PASSWORD` overrides the password of the schema user which you used for testing.
86+
87+
* `NODE_ORACLEDB_CONNECTIONSTRING` overrides the connection string that points to your database's location.
88+
89+
* `NODE_ORACLEDB_EXTERNALAUTH` overrides the options for external authentication tests. Setting this environment variable to "true" will enable the tests that require external authentication.
90+
91+
* `NODE_ORACLEDB_DBA_PRIVILEGE` overrides the options for DBA privilege. Setting this environment variable to "true" will enable the tests and utilities that require DBA privilege.
92+
93+
* `NODE_ORACLEDB_DBA_USER` overrides the username of the DBA user which you used for testing, disabled if `NODE_ORACLEDB_DBA_PRIVILEGE` is not `true`.
94+
95+
* `NODE_ORACLEDB_DBA_PASSWORD` overrides the password of the DBA user which you used for testing, disabled if `NODE_ORACLEDB_DBA_PRIVILEGE` is not `true`.
96+
97+
* `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.
98+
99+
79100
## 2. Run tests
80101

81102
### 2.1 Run the complete test suite
@@ -94,7 +115,29 @@ cd node_oracledb
94115

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

97-
## 3. Add Tests
118+
## 3. Enable test(s) that requires extra configuration
119+
120+
The following test(s) are automatically skipped if their required environment variable(s) are not properly set.
121+
122+
### 3.1 externalProxyAuth.js
123+
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.
124+
125+
* 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.
126+
127+
```
128+
export NODE_ORACLEDB_EXTERNALAUTH true
129+
130+
```
131+
132+
* 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](https://oracle.github.io/node-oracledb/doc/api.html#pool-proxy-authentication) for more information on proxy authentication. Then use the following command to enable proxy authentication in the test suite.
133+
134+
```
135+
export NODE_ORACLEDB_PROXY_SESSION_USER "Your_Proxy_Authenticating_User"
136+
137+
```
138+
139+
140+
## 4. Add Tests
98141

99142
See [CONTRIBUTING](https://github.com/oracle/node-oracledb/blob/master/CONTRIBUTING.md)
100143
for general information on contribution requirements.
@@ -106,14 +149,14 @@ shows the numbering of tests.
106149
In order to include your tests in the suite, add each new test file
107150
name to [`test/opts/mocha.opts`](https://github.com/oracle/node-oracledb/blob/master/test/opts/mocha.opts).
108151

109-
## 4. Troubleshooting
152+
## 5. Troubleshooting
110153

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

116-
### 4.1 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
159+
### 5.1 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
117160

118161
This error occurs when Node.js programs try to change database objects which
119162
hold locks. The workaround would be:
@@ -123,7 +166,7 @@ test files.
123166
(2) Try not to use 'beforeEach' blocks for object operations to avoid
124167
the interference between cases.
125168

126-
### 4.2 ORA-00018: maximum number of sessions exceeded
169+
### 5.2 ORA-00018: maximum number of sessions exceeded
127170

128171
This error occurs when the test suite takes up more sessions than the
129172
configured limit. You can alter the session limit on the database server side.
@@ -140,7 +183,7 @@ do
140183
done
141184
```
142185

143-
### 4.3 ORA-28865: SSL connection closed
186+
### 5.3 ORA-28865: SSL connection closed
144187

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

0 commit comments

Comments
 (0)