1
1
# Test node-oracledb
2
2
3
- * Copyright (c) 2015, 2016 , Oracle and/or its affiliates. All rights reserved.*
3
+ * Copyright (c) 2015, 2018 , Oracle and/or its affiliates. All rights reserved.*
4
4
5
5
You may not use the identified files except in compliance with the Apache
6
6
License, Version 2.0 (the "License.")
@@ -19,7 +19,7 @@ The node-oracledb test suite uses 'mocha', 'should' and 'async'. See
19
19
[ LICENSE] ( https://github.com/oracle/node-oracledb/blob/master/LICENSE.md )
20
20
for relevant licenses.
21
21
22
- ## 1. Preparations for running tests
22
+ ## 1. Preparations
23
23
24
24
See [ INSTALL] ( https://github.com/oracle/node-oracledb/blob/master/INSTALL.md )
25
25
for installation requirements and more details.
@@ -36,7 +36,7 @@ mkdir <some-directory>
36
36
cd <some-directory>
37
37
```
38
38
39
- ### 1.2 Get node-oracledb from GitHub
39
+ ### 1.2 Clone node-oracledb from GitHub
40
40
41
41
Clone the project repository:
42
42
@@ -85,13 +85,8 @@ and the authentication service have been appropriately configured. See
85
85
for more details. And then, set the environment variable ` NODE_ORACLEDB_EXTERNALAUTH `
86
86
to be ` true ` .
87
87
88
- Note: the test suite requires a schema with these privileges:
89
-
90
- - CREATE TABLE
91
- - CREATE SESSION
92
- - CREATE PROCEDURE
93
- - CREATE SEQUENCE
94
- - CREATE TRIGGER
88
+ Note: the test suite requires a schema with privileges CREATE TABLE, CREATE SESSION,
89
+ CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER.
95
90
96
91
### 1.5 Set NODE_PATH
97
92
@@ -103,32 +98,16 @@ export NODE_PATH=<some-directory>/node-oracledb/lib
103
98
104
99
### 2.1 Run the complete test suite
105
100
106
- #### 2.1.1 On Unix-like systems
107
-
108
101
```
109
- cd <some-directory>/ node-oracledb
102
+ cd node-oracledb
110
103
npm test
111
104
```
112
105
113
- This calls the ` test ` script defined in ` oracledb/package.json ` .
114
-
115
- #### 2.1.2 On Windows
116
-
117
- ```
118
- cd <some-directory>/node_oracledb
119
- npm run testwindows
120
- ```
121
-
122
- This calls the ` testwindows ` script defined in ` oracledb/package.json ` .
123
-
124
- See [ npm scripts] ( https://docs.npmjs.com/misc/scripts ) for more information
125
- about how npm handles the "scripts" field of ` package.json ` .
126
-
127
106
### 2.2 Run specified test(s)
128
107
129
108
```
130
- cd <some-directory>/ node_oracledb
131
- <mocha-executable-file-directory> /mocha test/<test-names>
109
+ cd node_oracledb
110
+ ./node_modules/.bin /mocha test/<test-names>
132
111
```
133
112
134
113
See [ mochajs.org] ( http://mochajs.org/ ) for more information on running tests with mocha.
@@ -139,41 +118,28 @@ See [CONTRIBUTING](https://github.com/oracle/node-oracledb/blob/master/CONTRIBUT
139
118
for general information on contribution requirements.
140
119
141
120
For easy correlation between results and test code, each test is
142
- assigned a number. The following number ranges have been chosen:
143
-
144
- - 1 - 20 are reserved for basic functional tests
145
- - 21 - 50 are reserved for data type supporting tests
146
- - 51 onwards are for other tests
121
+ assigned a number. The [ Test List] ( https://github.com/oracle/node-oracledb/blob/master/test/list.txt )
122
+ shows the numbering of tests.
147
123
148
124
In order to include your tests in the suite, add each new test file
149
125
name to [ ` test/opts/mocha.opts ` ] ( https://github.com/oracle/node-oracledb/blob/master/test/opts/mocha.opts ) .
150
126
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.
127
+ ## 4. Compatibility
163
128
164
- - Users of 11.2.0.1 and 11.2.0.2 clients may see failures with poolTimeout.js
165
- and dataTypeDouble.js.
129
+ We basically test with the following environment options:
166
130
167
- - Slow networks may cause some tests to timeout.
131
+ - Oracle Instant Clients: 11.2.0.4, 12.1.0.2, 12.2.0.1
132
+ - Operating Systems (X64): macOS, Linux, Windows
133
+ - Node.js LTS versions
168
134
169
- ## 6 . Troubleshooting
135
+ ## 5 . Troubleshooting
170
136
171
137
You may encounter some troubles when running the test suite. These troubles
172
138
might be caused by the concurrency issue of Mocha framework, network latencies,
173
139
or database server issues. This section gives some issues that we ever saw
174
140
and our solutions.
175
141
176
- ### 6 .1 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
142
+ ### 5 .1 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
177
143
178
144
This error occurs when Node.js programs try to change database objects which
179
145
hold locks. The workaround would be:
@@ -183,7 +149,7 @@ test files.
183
149
(2) Try not to use 'beforeEach' blocks for object operations to avoid
184
150
the interference between cases.
185
151
186
- ### 6 .2 ORA-00018: maximum number of sessions exceeded
152
+ ### 5 .2 ORA-00018: maximum number of sessions exceeded
187
153
188
154
This error occurs when the test suite takes up more sessions than the
189
155
configured limit. You can alter the session limit on the database server side.
200
166
done
201
167
```
202
168
203
- ### 6 .3 ORA-28865: SSL connection closed
169
+ ### 5 .3 ORA-28865: SSL connection closed
204
170
205
171
You may encounter this error when the test suite sends more connection
206
172
requests per second than the database is configured to handle.
0 commit comments