Skip to content

Commit f313d58

Browse files
committed
Implemented ability to tun ut3 from another schema
added fail procedure to `ut` interface added global comparison null behavior control to `ut` interface reorganized examples, divided them for user and developer Only User examples are executed by not-owner user
1 parent fa50762 commit f313d58

35 files changed

+271
-85
lines changed

.travis.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ env:
1515
- DATABASE_NAME=XE
1616
- ORA_SDTZ='Europe/London' #Needed as a client parameter
1717
- TZ='Europe/London' #Needed as a DB Server parameter
18-
- UT3_USER=ut3
19-
- UT3_PASSWORD=ut3
20-
- UT3_TABLESPACE=users
18+
- UT3_OWNER=ut3
19+
- UT3_OWNER_PASSWORD=ut3
20+
- UT3_OWNER_TABLESPACE=users
21+
- UT3_USER=ut3_user
22+
- UT3_USER_PASSWORD=ut3
23+
- UT3_USER_TABLESPACE=users
2124
# Target Branch and Directory for Deployment of Docs
2225
- PAGES_TARGET_BRANCH="gh-pages"
2326
- PAGES_VERSION_BASE="version3"
@@ -47,11 +50,15 @@ install:
4750
- bash .travis/oracle/install.sh
4851

4952
script:
53+
- bash .travis/create_utplsql_owner.sh
5054
- bash .travis/create_utplsql_user.sh
5155
- bash .travis/install_libraries.sh
5256
- bash .travis/install.sh
53-
- bash .travis/run_examples.sh
54-
- bash .travis/run_test.sh
57+
- bash .travis/grant_user.sh
58+
- bash .travis/run_examples_as_owner.sh
59+
- bash .travis/run_test_as_owner.sh
60+
- bash .travis/run_examples_as_user.sh
61+
# - bash .travis/run_test_as_user.sh
5562
# - bash .travis/build_docs.sh
5663
# - bash .travis/push_docs_to_gh_pages.sh
5764

.travis/create_utplsql_owner.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
set -ev
3+
4+
#create user
5+
"$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
6+
set echo off
7+
@@$(dirname "$(readlink -f "$0")")/create_utplsql_owner.sql $UT3_OWNER $UT3_OWNER_PASSWORD $UT3_OWNER_TABLESPACE
8+
SQL

.travis/create_utplsql_owner.sql

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
whenever sqlerror exit failure rollback
2+
whenever oserror exit failure rollback
3+
set echo off
4+
set feedback off
5+
set heading off
6+
set verify off
7+
8+
define ut3_user = &1
9+
define ut3_password = &2
10+
define ut3_tablespace = &3
11+
12+
create user &ut3_user identified by &ut3_password default tablespace &ut3_tablespace quota unlimited on &ut3_tablespace;
13+
14+
grant create session, create procedure, create type, create table to &ut3_user;
15+
16+
grant execute on dbms_pipe to &ut3_user;
17+
grant create job to &ut3_user;
18+
19+
grant alter session to &ut3_user;
20+
21+
--only needed to run unit tests for utplsql v3, not required to run utplsql v3 itself
22+
grant select any dictionary to &ut3_user;
23+
24+
exit success

.travis/create_utplsql_user.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ set -ev
44
#create user
55
"$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
66
set echo off
7-
@@$(dirname "$(readlink -f "$0")")/create_utplsql_user.sql $UT3_USER $UT3_PASSWORD $UT3_TABLESPACE
7+
@@$(dirname "$(readlink -f "$0")")/create_utplsql_user.sql $UT3_USER $UT3_USER_PASSWORD $UT3_USER_TABLESPACE
88
SQL

.travis/create_utplsql_user.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ create user &ut3_user identified by &ut3_password default tablespace &ut3_tables
1313

1414
grant create session, create procedure, create type, create table to &ut3_user;
1515

16-
grant execute on dbms_pipe to &ut3_user;
17-
grant create job to &ut3_user;
18-
1916
grant alter session to &ut3_user;
2017

21-
--only needed to run unit tests for utplsql v3, not required to run utplsql v3 itself
22-
grant select any dictionary to &ut3_user;
23-
2418
exit success

.travis/grant_user.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -ev
4+
5+
cd client_source
6+
#grant framework user
7+
"$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
8+
@grant_user.sql $UT3_OWNER $UT3_USER
9+
SQL

.travis/install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ set -ev
44

55
cd source
66
#install core of utplsql
7-
"$ORACLE_HOME/bin/sqlplus" $UT3_USER/$UT3_PASSWORD @install.sql
7+
"$ORACLE_HOME/bin/sqlplus" $UT3_OWNER/$UT3_OWNER_PASSWORD @install.sql
88

99

1010
cd ..
1111
cd build
1212
#do style check
13-
"$ORACLE_HOME/bin/sqlplus" $UT3_USER/$UT3_PASSWORD @utplsql_style_check.sql
13+
"$ORACLE_HOME/bin/sqlplus" $UT3_OWNER/$UT3_OWNER_PASSWORD @utplsql_style_check.sql
1414

1515
#enable plsql debug
16-
#"$ORACLE_HOME/bin/sqlplus" $UT3_USER/$UT3_PASSWORD @ut_debug_enable.sql
16+
#"$ORACLE_HOME/bin/sqlplus" $UT3_OWNER/$UT3_OWNER_PASSWORD @ut_debug_enable.sql

.travis/run_examples.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis/run_examples_as_owner.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
set -ev
4+
5+
cd examples
6+
"$ORACLE_HOME/bin/sqlplus" $UT3_OWNER/$UT3_OWNER_PASSWORD @RunAllExamplesAsTests.sql

.travis/run_examples_as_user.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -ev
4+
5+
cd examples
6+
"$ORACLE_HOME/bin/sqlplus" $UT3_USER/$UT3_USER_PASSWORD <<SQL
7+
whenever sqlerror exit failure rollback
8+
whenever oserror exit failure rollback
9+
10+
@RunUserExamples.sql
11+
12+
exit success
13+
SQL

0 commit comments

Comments
 (0)