Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizable SetupTests.sql #130

Open
segabor opened this issue Mar 20, 2020 · 5 comments
Open

Customizable SetupTests.sql #130

segabor opened this issue Mar 20, 2020 · 5 comments

Comments

@segabor
Copy link

segabor commented Mar 20, 2020

  1. Review existing enhancement requests

Current test setup SQL covers features not available on all DB versions. For test purposes I'm running an instance version 12.1.0.2 in docker with basic bundle option. And it turned out it does not support editions and proxy users.

  1. Describe your new request in detail

Have test SQL script customizable or more versions (core, enhanced) for different platforms.

  1. Give supporting information about tools and operating systems. Give relevant product version numbers
  • Host OS: macOS Catalina 10.15.3
  • Docker (latest)
  • Oracle DB image: container-registry.oracle.com/database/standard:12.1.0.2
@segabor
Copy link
Author

segabor commented Mar 20, 2020

In addition to above request I had to add the following line to have SQL executed:

alter session set "_oracle_script"=true;

@segabor
Copy link
Author

segabor commented Mar 20, 2020

The patched SQL script I'm using currently

diff --git a/test/sql/SetupTest.sql b/test/sql/SetupTest.sql
index fee3c7e..90499e1 100644
--- a/test/sql/SetupTest.sql
+++ b/test/sql/SetupTest.sql
@@ -32,27 +32,28 @@ CREATE DIRECTORY &dir_name AS '&dir_path';
 alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';
 alter session set nls_numeric_characters='.,';
 alter session set nls_length_semantics = byte;
+alter session set "_ORACLE_SCRIPT"=true;
 
 create user &main_user identified by &main_password
 quota unlimited on users
 default tablespace users;
 
-create user &proxy_user identified by &proxy_password;
-alter user &proxy_user grant connect through &main_user;
+-- create user &proxy_user identified by &proxy_password;
+-- alter user &proxy_user grant connect through &main_user;
 
-create user &edition_user identified by &edition_password
-quota unlimited on users
-default tablespace users;
+-- create user &edition_user identified by &edition_password
+-- quota unlimited on users
+-- default tablespace users;
 
-alter user &edition_user enable editions;
+-- alter user &edition_user enable editions;
 
-create edition &edition_name;
+-- create edition &edition_name;
 
-grant use on edition &edition_name to &edition_user;
+-- grant use on edition &edition_name to &edition_user;
 
-grant create session to &proxy_user;
+-- grant create session to &proxy_user;
 
-grant create session to &edition_user;
+-- grant create session to &edition_user;
 
 grant
     create session,

@cjbj
Copy link
Member

cjbj commented Mar 20, 2020

I'm glad someone is running tests!

Better version portability would be good. We have that with other ODPI-C consumers (e.g. node-oracledb), partly because their test frameworks make it easier.

@segabor
Copy link
Author

segabor commented Mar 22, 2020

I plan to do so. I want a test DB for testing a driver. I'm fine with having a customized test setup.

@segabor segabor closed this as completed Mar 22, 2020
@cjbj
Copy link
Member

cjbj commented Mar 22, 2020

I'm happy to leave this open as an enhancement request.

@cjbj cjbj reopened this Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants