Skip to content

Commit da11cfc

Browse files
committed
Make it easier to test external authentication with wallets
1 parent cbed304 commit da11cfc

File tree

4 files changed

+14
-22
lines changed

4 files changed

+14
-22
lines changed

test/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,15 @@ vi <some-directory>/node-oracledb/test/dbconfig.js
7575
module.exports = {
7676
user : process.env.NODE_ORACLEDB_USER || "hr",
7777
password : process.env.NODE_ORACLEDB_PASSWORD || "welcome",
78-
connectString : process.env.NODE_ORACLEDB_CONNECTIONSTRING || "localhost/orcl",
79-
externalAuth : process.env.NODE_ORACLEDB_EXTERNALAUTH ? true : false
78+
connectString : process.env.NODE_ORACLEDB_CONNECTIONSTRING || "localhost/orcl"
8079
};
8180
```
8281

83-
To use external authentication, set the `externalAuth` property to
84-
`true`. Also make sure Oracle Database and the authentication service
85-
have been appropriately configured. See
82+
To enable external authentication tests, please make sure Oracle Database
83+
and the authentication service have been appropriately configured. See
8684
[Documentation for External Authentication](https://github.com/oracle/node-oracledb/blob/master/doc/api.md#extauth)
87-
for more details.
85+
for more details. And then, set the environment variable `NODE_ORACLEDB_EXTERNALAUTH`
86+
to be `true`.
8887

8988
Note: the test suite requires a schema with these privileges:
9089

test/dbconfig.js

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,8 @@
3030
*
3131
*****************************************************************************/
3232

33-
if (process.env.NODE_ORACLEDB_EXTERNALAUTH)
34-
{
35-
exports.externalAuth = true;
36-
}
37-
else
38-
{
39-
exports.externalAuth = false;
40-
exports.user = process.env.NODE_ORACLEDB_USER || "hr";
41-
exports.password = process.env.NODE_ORACLEDB_PASSWORD || "welcome";
42-
}
43-
44-
exports.connectString = process.env.NODE_ORACLEDB_CONNECTIONSTRING || "localhost/orcl";
33+
module.exports = {
34+
user : process.env.NODE_ORACLEDB_USER || "hr",
35+
password : process.env.NODE_ORACLEDB_PASSWORD || "welcome",
36+
connectString : process.env.NODE_ORACLEDB_CONNECTIONSTRING || "localhost/orcl"
37+
};

test/externalAuth.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,10 @@ describe('5. externalAuth.js', function() {
238238

239239
}); // 5.1
240240

241-
describe.skip('5.2 tests only work when externalAuth is configured on DB', function() {
241+
describe('5.2 tests only work when externalAuth is configured on DB', function() {
242242

243243
// need to skip these tests if external authentication is not configured
244-
var it = (dbConfig.externalAuth) ? global.it : global.it.skip;
244+
var it = (process.env.NODE_ORACLEDB_EXTERNALAUTH) ? global.it : global.it.skip;
245245

246246
it("5.2.1 can get connection from oracledb with external authentication", function(done) {
247247

test/list.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ Overview of node-oracledb functional tests
134134
5.1.8 throws error when getting pool from oracledb only given password when externalAuth is enabled
135135
5.2 tests only work when externalAuth is configured on DB
136136
5.2.1 can get connection from oracledb with external authentication
137-
- 5.2.2 can get pool from oracledb with external authentication
137+
5.2.2 can get pool from oracledb with external authentication
138138
5.2.3 gets multiple connections from oracledb
139-
- 5.2.4 gets multiple pools from oracledb
139+
5.2.4 gets multiple pools from oracledb
140140

141141
6. dmlReturning.js
142142
6.1 NUMBER & STRING driver data type

0 commit comments

Comments
 (0)