11# Test node-oracledb
22
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.*
44
55You may not use the identified files except in compliance with the Apache
66License, Version 2.0 (the "License.")
@@ -19,7 +19,7 @@ The node-oracledb test suite uses 'mocha', 'should' and 'async'. See
1919[ LICENSE] ( https://github.com/oracle/node-oracledb/blob/master/LICENSE.md )
2020for relevant licenses.
2121
22- ## 1. Preparations for running tests
22+ ## 1. Preparations
2323
2424See [ INSTALL] ( https://github.com/oracle/node-oracledb/blob/master/INSTALL.md )
2525for installation requirements and more details.
@@ -36,7 +36,7 @@ mkdir <some-directory>
3636cd <some-directory>
3737```
3838
39- ### 1.2 Get node-oracledb from GitHub
39+ ### 1.2 Clone node-oracledb from GitHub
4040
4141Clone the project repository:
4242
@@ -85,13 +85,8 @@ and the authentication service have been appropriately configured. See
8585for more details. And then, set the environment variable ` NODE_ORACLEDB_EXTERNALAUTH `
8686to be ` true ` .
8787
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.
9590
9691### 1.5 Set NODE_PATH
9792
@@ -103,32 +98,16 @@ export NODE_PATH=<some-directory>/node-oracledb/lib
10398
10499### 2.1 Run the complete test suite
105100
106- #### 2.1.1 On Unix-like systems
107-
108101```
109- cd <some-directory>/ node-oracledb
102+ cd node-oracledb
110103npm test
111104```
112105
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-
127106### 2.2 Run specified test(s)
128107
129108```
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>
132111```
133112
134113See [ 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
139118for general information on contribution requirements.
140119
141120For 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.
147123
148124In order to include your tests in the suite, add each new test file
149125name to [ ` test/opts/mocha.opts ` ] ( https://github.com/oracle/node-oracledb/blob/master/test/opts/mocha.opts ) .
150126
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
163128
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:
166130
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
168134
169- ## 6 . Troubleshooting
135+ ## 5 . Troubleshooting
170136
171137You may encounter some troubles when running the test suite. These troubles
172138might be caused by the concurrency issue of Mocha framework, network latencies,
173139or database server issues. This section gives some issues that we ever saw
174140and our solutions.
175141
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
177143
178144This error occurs when Node.js programs try to change database objects which
179145hold locks. The workaround would be:
@@ -183,7 +149,7 @@ test files.
183149(2) Try not to use 'beforeEach' blocks for object operations to avoid
184150the interference between cases.
185151
186- ### 6 .2 ORA-00018: maximum number of sessions exceeded
152+ ### 5 .2 ORA-00018: maximum number of sessions exceeded
187153
188154This error occurs when the test suite takes up more sessions than the
189155configured limit. You can alter the session limit on the database server side.
200166done
201167```
202168
203- ### 6 .3 ORA-28865: SSL connection closed
169+ ### 5 .3 ORA-28865: SSL connection closed
204170
205171You may encounter this error when the test suite sends more connection
206172requests per second than the database is configured to handle.
0 commit comments