Skip to content

Commit dc792ad

Browse files
committed
Push test and documentation updates
1 parent 539f0ae commit dc792ad

File tree

5 files changed

+29
-19
lines changed

5 files changed

+29
-19
lines changed

doc/src/user_guide/troubleshooting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ DPI-1047
9696

9797
- On Windows:
9898

99-
- If node-oracledb is using libraries from a local database installation, ensure that this database is the `currently configured database <https://www.oracle.com/pls/topic/lookup?ctx=dblatest&id=GUID-33D575DD-47FF-42B1-A82F-049D3F2A8791>`__.
99+
- If node-oracledb is using libraries from a local database installation, ensure that this database is the `currently configured database <https://docs.oracle.com/pls/topic/lookup?ctx=db21&id=RIWIN-GUID-33D575DD-47FF-42B1-A82F-049D3F2A8791>`__.
100100

101101
- If you are not using passing a library directory parameter to :meth:`oracledb.initOracleClient()`, then restart your command prompt and use ``set PATH`` to check if the environment variable has the correct Oracle Client listed before any other Oracle directories.
102102

test/dbconfig.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,16 @@ if (process.env.NODE_ORACLEDB_DRCP) {
7777
config.test.drcp = (process.env.NODE_ORACLEDB_DRCP.toLowerCase() === 'true');
7878
}
7979

80-
if (!config.test.externalAuth) {
81-
if (process.env.NODE_ORACLEDB_USER) {
82-
config.user = process.env.NODE_ORACLEDB_USER;
83-
} else {
84-
throw new Error("Schema User name is not set! Set the Environment Variable NODE_ORACLEDB_USER.");
85-
}
86-
87-
if (process.env.NODE_ORACLEDB_PASSWORD) {
88-
config.password = process.env.NODE_ORACLEDB_PASSWORD;
89-
} else {
90-
throw new Error("Schema User Password is not set! Set the Environment Variable NODE_ORACLEDB_PASSWORD.");
91-
}
80+
if (process.env.NODE_ORACLEDB_USER) {
81+
config.user = process.env.NODE_ORACLEDB_USER;
82+
} else {
83+
throw new Error("Schema User name is not set! Set the Environment Variable NODE_ORACLEDB_USER.");
84+
}
9285

86+
if (process.env.NODE_ORACLEDB_PASSWORD) {
87+
config.password = process.env.NODE_ORACLEDB_PASSWORD;
88+
} else {
89+
throw new Error("Schema User Password is not set! Set the Environment Variable NODE_ORACLEDB_PASSWORD.");
9390
}
9491

9592
if (process.env.NODE_ORACLEDB_QA) {

test/externalAuth.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const dbConfig = require('./dbconfig.js');
8080

8181
}); // 5.1.2
8282

83-
it("5.1.3 throws error when gettting connection from oracledb given only invalid 'user' when externalAuth is enabled", async function() {
83+
it("5.1.3 throws error when getting connection from oracledb given only invalid 'user' when externalAuth is enabled", async function() {
8484

8585
await assert.rejects(
8686
async () => {
@@ -97,7 +97,7 @@ const dbConfig = require('./dbconfig.js');
9797
);
9898
}); // 5.1.3
9999

100-
it("5.1.4 throws error when gettting connection from oracledb given only 'password' when externalAuth is enabled", async function() {
100+
it("5.1.4 throws error when getting connection from oracledb given only 'password' when externalAuth is enabled", async function() {
101101

102102
await assert.rejects(
103103
async () => {
@@ -251,7 +251,8 @@ const dbConfig = require('./dbconfig.js');
251251
// Main function of this case
252252
const connArr = []; // Initialize array of connections with IDs from 1 to 9
253253
for (let id = 1; id <= 9; id++) {
254-
connArr[id] = await getConns(id);
254+
// connArr index 0 stores ID=1, index 1 stores ID=2 ,...
255+
connArr.push(await getConns(id));
255256
}
256257

257258
await closeConns(connArr);
@@ -286,7 +287,8 @@ const dbConfig = require('./dbconfig.js');
286287
// Main function of this case
287288
const poolArr = []; // Initialize array of pools with IDs from 1 to 9
288289
for (let id = 1; id <= 9; id++) {
289-
poolArr[id] = await getPools(id);
290+
// poolArr index 0 stores ID=1, index 1 stores ID=2 ,...
291+
poolArr.push(await getPools(id));
290292
}
291293

292294
await closePools(poolArr);

test/jsonBind1.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ describe('253. jsonBind1.js', function() {
6565
" p_inout := p_inout; \n" +
6666
"END;";
6767
let skip = false;
68+
const defaultFetchTypeHandler = oracledb.fetchTypeHandler;
6869
before (async function() {
6970
oracledb.outFormat = oracledb.OUT_FORMAT_OBJECT;
7071
oracledb.extendedMetaData = true;
@@ -73,6 +74,15 @@ describe('253. jsonBind1.js', function() {
7374
skip = true;
7475
this.skip();
7576
}
77+
oracledb.fetchTypeHandler = function(metaData) {
78+
// overwrite default converter for CLOB, BLOB and VARCHAR type.
79+
if (metaData.isJson && metaData.dbType !== oracledb.DB_TYPE_JSON) {
80+
const myConverter = (v) => {
81+
return v;
82+
};
83+
return {converter: myConverter};
84+
}
85+
};
7686
await conn.execute(create_table_sql);
7787
await conn.commit();
7888
});
@@ -85,6 +95,7 @@ describe('253. jsonBind1.js', function() {
8595
if (conn) {
8696
await conn.close();
8797
}
98+
oracledb.fetchTypeHandler = defaultFetchTypeHandler;
8899
});
89100

90101
beforeEach(async function() {

test/list.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ Overview of node-oracledb functional tests
181181
5.1 tests that work both when DB has configured externalAuth and not configured
182182
5.1.1 can get connection from oracledb with correct user/password when externalAuth is disabled
183183
5.1.2 throws error when getting connection from oracledb with correct user/password when externalAuth is enabled
184-
5.1.3 throws error when gettting connection from oracledb given only invalid 'user' when externalAuth is enabled
185-
5.1.4 throws error when gettting connection from oracledb given only 'password' when externalAuth is enabled
184+
5.1.3 throws error when getting connection from oracledb given only invalid 'user' when externalAuth is enabled
185+
5.1.4 throws error when getting connection from oracledb given only 'password' when externalAuth is enabled
186186
5.1.5 can get pool from oracledb with user/password when externalAuth is disabled
187187
5.1.6 throws error when getting pool from oracledb given user/password when externalAuth is enabled
188188
5.1.7 throws error when getting pool from oracledb only given username when externalAuth is enabled

0 commit comments

Comments
 (0)