Skip to content

Commit

Permalink
Test case updates for 6.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadraju committed May 22, 2024
1 parent 9980a79 commit 46f7ef3
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ Set the following environment variables to provide credentials for the test suit

* `NODE_ORACLEDB_DRCP` provides an option for skipping the test run when DRCP is enabled. Setting this environment variable to `true` will skip certain test case runs due to DRCP restrictions.

* `NODE_ORACLEDB_IMPLICIT_POOL` provides an option for skipping the test run when Implicit connection pooling is enabled. Setting this environment variable to `true` will skip certain test case runs due to Implicit connection pooling restrictions.

* `NODE_ORACLEDB_DRIVER_MODE` provides an option to set the 'Thin' or 'Thick' modes of node-oracledb. Setting this environment variable to `thick` will enable Thick mode. Setting it to `thin` will retain the Thin mode. The default mode is Thin.

* `NODE_ORACLEDB_WALLET_LOCATION` provides the local directory name for the wallets that may be required for mutual TLS (mTLS) connections, especially to Oracle Cloud Autonomous Databases optionally. The wallet location can also be provided as a part of the database connect string.
Expand Down
5 changes: 3 additions & 2 deletions test/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ describe('1. connection.js', function() {
};
await assert.rejects(
async () => await oracledb.getConnection(credential),
/ORA-01031:|ORA-24542:/
);
/ORA-01031:|ORA-24542:|ORA-56618:/
// ORA-56618: DRCP: PRELIM mode logon not allowed
); /*ORA-56618: This error is thrown when DRCP and Implicit Connection Pooling is enabled*/
});

}); // 1.7
Expand Down
11 changes: 10 additions & 1 deletion test/dbconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* If required:
* NODE_ORACLEDB_EXTERNALAUTH,
* NODE_ORACLEDB_PROXY_SESSION_USER, NODE_ORACLEDB_DRCP,
* NODE_ORACLEDB_IMPLICIT_POOL
* NODE_ORACLEDB_WALLET_LOCATION, NODE_ORACLEDB_WALLET_PASSWORD
*
*****************************************************************************/
Expand All @@ -52,7 +53,8 @@ const config = {
instantClientPath: '',
isCloudService: false,
isCmanTdm: false,
drcp: false
drcp: false,
implicitPool: false
}
};

Expand All @@ -78,6 +80,13 @@ if (process.env.NODE_ORACLEDB_DRCP) {
config.test.drcp = (process.env.NODE_ORACLEDB_DRCP.toLowerCase() === 'true');
}

if (process.env.NODE_ORACLEDB_IMPLICIT_POOL) {
if (!process.env.NODE_ORACLEDB_DRCP)
throw new Error("For Implicit pooling tests, NODE_ORACLEDB_DRCP needs to be enabled! Set the Environment Variable NODE_ORACLEDB_DRCP");
else
config.test.implicitPool = (process.env.NODE_ORACLEDB_IMPLICIT_POOL.toLowerCase() === 'true');
}

if (process.env.NODE_ORACLEDB_USER) {
config.user = process.env.NODE_ORACLEDB_USER;
} else {
Expand Down
2 changes: 1 addition & 1 deletion test/jsonDualityViews5.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ annotation or NOUPDATE annotation specified.*/
{StudentClassId : scid,
Class : class {ClassId: clsid, Name: name}}}
`),
/ORA-40895:/ /*ORA-40895: invalid SQL expression in JSON relational duality view (duplicate sub-object)*/
/ORA-44971:/ //ORA-44971: JSON relational duality view cannot have duplicate column 'STUDENT'.'STUID' specified.
);

await connection.execute(`
Expand Down
2 changes: 1 addition & 1 deletion test/keepInStmtCache.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('258. keepInStmtCache.js', function() {
let sid;

before(async function() {
if (!dbConfig.test.DBA_PRIVILEGE) {
if (!dbConfig.test.DBA_PRIVILEGE || dbConfig.test.implicitPool) {
// Without DBA privilege, the test cannot get the current parse count!
// So skip the tests
this.skip();
Expand Down
2 changes: 1 addition & 1 deletion test/listIndexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('286. listIndexes.js', function() {
// For listIndexes, Oracle Client library version 19.13 (or later DBRU)
// or version 21.3 (or higher) is needed
runnable = runnable && (testsUtil.getClientVersion >= 1913000000 ||
(testsUtil.getClientVersion >= 2100000000 && testsUtil.getClientVersion >= 2103000000))
(testsUtil.getClientVersion >= 2100000000 && testsUtil.getClientVersion >= 2103000000));
if (!oracledb.thin) {
await sodaUtil.cleanup();
}
Expand Down
1 change: 1 addition & 0 deletions test/resultSet2.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ describe('55. resultSet2.js', function() {
});

it('55.5.1 (1) get RS (2) modify data in that table and commit (3) check RS', async function() {
if (dbConfig.test.implicitPool) this.skip();
let rowsCount = 0;
const result = await connection.execute(
"SELECT * FROM nodb_rs2_emp ORDER BY employees_id",
Expand Down

0 comments on commit 46f7ef3

Please sign in to comment.