Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58b557f

Browse files
authored
Merge pull request #792 from utPLSQL/release/v3.1.3
Release/v3.1.3
2 parents 2e2e943 + d13b0ef commit 58b557f

318 files changed

Lines changed: 4783 additions & 3076 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,15 @@ node_modules/
1515
utPLSQL_latest_release/
1616
utPLSQL-cli/
1717
development/env.sh
18+
development/*.jar
1819
*.log
20+
21+
# exclusions based on artifacts created via actions documented in CONTRIBUTING.md
22+
test/dummy.sql
23+
coverage.html_assets/
24+
coverage.html
25+
coverage.json
26+
coverage.xml
27+
tfs_test_results.xml
28+
junit_test_results.xml
29+
test_results.xml

.travis.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,23 @@ env:
4949
- MAVEN_HOME=/usr/local/maven
5050
- MAVEN_CFG=$HOME/.m2
5151
matrix:
52-
- ORACLE_VERSION="${DOCKER_TAG_11G:-11g-r2-xe}" CONNECTION_STR='127.0.0.1:1521/XE' DOCKER_OPTIONS='--shm-size=1g'
53-
- ORACLE_VERSION="${DOCKER_TAG_12C:-12c-r1-se2}" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
54-
- ORACLE_VERSION="${DOCKER_TAG_12C2:-12c-r2-se2}" CONNECTION_STR='127.0.0.1:1521/ORCLPDB1' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
52+
- ORACLE_VERSION="${DOCKER_TAG_11G:-11g-r2-xe}" CONNECTION_STR='127.0.0.1:1521/XE' DOCKER_OPTIONS='--shm-size=1g'
53+
- ORACLE_VERSION="${DOCKER_TAG_12C:-12c-r1-se2-small}" CONNECTION_STR='127.0.0.1:1521/ORCLCDB' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
54+
- ORACLE_VERSION="${DOCKER_TAG_12C2:-12c-r2-se2-small}" CONNECTION_STR='127.0.0.1:1521/ORCLCDB' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
55+
- ORACLE_VERSION="${DOCKER_TAG_18:-18c-se2-small}" CONNECTION_STR='127.0.0.1:1521/ORCLCDB' DOCKER_OPTIONS="-v /dev/pdbs:/opt/oracle/oradata/pdbs"
5556

5657
cache:
5758
pip: true
5859
directories:
5960
- $CACHE_DIR
61+
- /home/travis/.sonar/cache
6062
- node_modules
6163
- $MAVEN_CFG
6264

6365
before_install:
66+
#cache to be used between stages. Based on https://github.com/travis-ci/docs-travis-ci-com/issues/1329
67+
#delete all files in cache that are older than 5 days
68+
- mkdir -p $CACHE_DIR/stages_cache; find $CACHE_DIR/stages_cache/ -mtime +5 -exec rm {} \;
6469
#The update_project_version.sh is done before deployment to validate that the change of project files does not break installation
6570
- bash .travis/update_project_version.sh
6671
#Allow for sonar to blame issues
@@ -79,9 +84,7 @@ install:
7984
- bash .travis/install_sqlcl.sh
8085
- sudo mkdir -p /dev/pdbs
8186
- sudo chmod -R 777 /dev/pdbs
82-
- df -h
8387
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/start_db.sh; fi
84-
- df -h
8588

8689
before_script:
8790
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/install.sh; fi
@@ -92,7 +95,7 @@ before_script:
9295
script:
9396
- if [[ ! $TRAVIS_TAG ]]; then bash test/install_and_run_tests.sh; fi
9497
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/validate_report_files.sh; fi
95-
- if [[ ! $TRAVIS_TAG ]] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ]; then bash .travis/run_sonar_scanner.sh; fi
98+
- if [[ ! $TRAVIS_TAG ]] && [ "${TRAVIS_REPO_SLUG}" = "${UTPLSQL_REPO}" ] && [ "${TRAVIS_PULL_REQUEST_SLUG}" = "${TRAVIS_REPO_SLUG}" ]; then bash .travis/run_sonar_scanner.sh; fi
9699
- if [[ ! $TRAVIS_TAG ]]; then bash .travis/coveralls_uploader.sh; fi
97100

98101
notifications:

.travis/download.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var paramUsername = casper.cli.get(0);
1717
var paramPassword = casper.cli.get(1);
1818
var agreementUrl = casper.cli.get(2);
1919
var downloadUrl = casper.cli.get(3);
20+
var downloaded = false;
2021

2122
casper.start();
2223
// TODO: Error handling.
@@ -41,10 +42,11 @@ casper.thenOpen(downloadUrl).waitForUrl(/signon\.jsp$/, function (re) {
4142
});
4243

4344
casper.on("resource.received", function (resource) {
44-
if (resource.url.indexOf("AuthParam") !== -1) {
45+
if (resource.url.indexOf("AuthParam") !== -1 && !downloaded) {
4546
// this.echo("DownloadUrl:");
4647
// Print the download url.
4748
this.echo(resource.url);
49+
downloaded = true;
4850
// TODO: Try to download file from here. this.download is not working because of cross site request.
4951
}
5052
});

.travis/download.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ PRODUCT=""
1212
# Then download the file using curl.
1313
downloadFile() {
1414
downloadUrl=$(exec casperjs download.js $ORACLE_OTN_USER $ORACLE_OTN_PASSWORD $1 $2)
15+
downloadUrl=${downloadUrl%$'\r'}
1516
echo "DownloadURL: $downloadUrl"
16-
curl $downloadUrl -o $3
17+
curl -o $3 -L "$downloadUrl"
1718
}
1819

1920
#############################
@@ -60,8 +61,8 @@ fi
6061

6162
if [ "$PRODUCT" == "sqlcl" ]; then
6263
agreementUrl="http://www.oracle.com/technetwork/developer-tools/sqlcl/downloads/index.html"
63-
downloadUrl="http://download.oracle.com/otn/java/sqldeveloper/sqlcl-4.2.0.17.073.1038-no-jre.zip"
64-
outputFile=sqlcl-4.2.0.17.073.1038-no-jre.zip
64+
downloadUrl="https://download.oracle.com/otn/java/sqldeveloper/sqlcl-18.3.0.259.2029.zip"
65+
outputFile=sqlcl-18.3.0.259.2029.zip
6566
downloadFile $agreementUrl $downloadUrl $outputFile
6667
exit 0
6768
fi

.travis/install.sh

Lines changed: 43 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,66 @@
22

33
cd source
44
set -ev
5+
56
#install core of utplsql
6-
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
7+
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
78
set feedback off
89
set verify off
910
10-
alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6003,6009,6010,7206)';
11+
--alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6003,6009,6010,7206)';
12+
alter session set plsql_optimize_level=0;
1113
@install_headless.sql $UT3_OWNER $UT3_OWNER_PASSWORD
1214
SQL
1315

14-
#uninstall core of utplsql
15-
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
16-
set feedback off
17-
set verify off
18-
19-
@uninstall_all.sql $UT3_OWNER
20-
declare
21-
v_leftover_objects_count integer;
22-
begin
23-
select sum(cnt)
24-
into v_leftover_objects_count
25-
from (select count(1) cnt from dba_objects where owner = '$UT3_OWNER'
26-
union all
27-
select count(1) cnt from dba_synonyms where table_owner = '$UT3_OWNER'
28-
);
29-
if v_leftover_objects_count > 0 then
30-
raise_application_error(-20000, 'Not all objects were successfully uninstalled - leftover objects count='||v_leftover_objects_count);
31-
end if;
32-
end;
33-
/
16+
#Run this step only on second child job (12.1 - at it's fastest)
17+
if [[ "${TRAVIS_JOB_NUMBER}" =~ \.2$ ]]; then
18+
19+
#check code-style for errors
20+
time "$SQLCLI" $UT3_OWNER/$UT3_OWNER_PASSWORD@//$CONNECTION_STR @../development/utplsql_style_check.sql
21+
22+
#test install/uninstall process
23+
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
24+
set feedback off
25+
set verify off
26+
27+
@uninstall_all.sql $UT3_OWNER
28+
declare
29+
v_leftover_objects_count integer;
30+
begin
31+
select sum(cnt)
32+
into v_leftover_objects_count
33+
from (select count(1) cnt from dba_objects where owner = '$UT3_OWNER'
34+
union all
35+
select count(1) cnt from dba_synonyms where table_owner = '$UT3_OWNER'
36+
);
37+
if v_leftover_objects_count > 0 then
38+
raise_application_error(-20000, 'Not all objects were successfully uninstalled - leftover objects count='||v_leftover_objects_count);
39+
end if;
40+
end;
41+
/
3442
SQL
3543

36-
#reinstall core of utplsql
37-
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
38-
set feedback off
39-
set verify off
44+
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
45+
set feedback off
46+
set verify off
4047
41-
alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6003,6009,6010,7206)';
42-
@install.sql $UT3_OWNER
48+
alter session set plsql_optimize_level=0;
49+
@install.sql $UT3_OWNER
4350
SQL
4451

52+
fi
53+
4554
#additional privileges to run scripted tests
46-
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
55+
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
4756
set feedback on
4857
--needed for Mystats script to work
4958
grant select any dictionary to $UT3_OWNER;
5059
--Needed for testing a coverage outside ut3_owner.
5160
grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER;
52-
53-
conn $UT3_OWNER/$UT3_OWNER_PASSWORD@//$CONNECTION_STR
54-
@../development/utplsql_style_check.sql
5561
SQL
5662

57-
#Create additional users
58-
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
63+
#Create user that will own the tests
64+
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
5965
set feedback off
6066
@create_utplsql_owner.sql $UT3_TESTER $UT3_TESTER_PASSWORD $UT3_TABLESPACE
6167
@@ -70,29 +76,11 @@ grant create job to $UT3_TESTER;
7076
exit
7177
SQL
7278

73-
#additional privileges to run tests
74-
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
75-
set feedback on
76-
--needed for Mystats script to work
77-
grant select any dictionary to $UT3_OWNER;
78-
--Needed for testing a coverage outside ut3_owner.
79-
grant create any procedure, drop any procedure, execute any procedure to $UT3_OWNER;
80-
81-
exit
82-
SQL
83-
84-
#Create additional users
85-
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
79+
#Create additional UT3$USER# to test for special characters
80+
time "$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
8681
set feedback off
8782
@create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE
88-
89-
exit
90-
SQL
91-
92-
#Grant UT3 framework to UT3$USER#
93-
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<-SQL
94-
set feedback off
83+
--Grant UT3 framework to UT3$USER#
9584
@create_user_grants.sql $UT3_OWNER $UT3_USER
96-
9785
exit
9886
SQL

.travis/install_sqlcl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -e
33

4-
SQLCL_FILE=sqlcl-4.2.0.17.073.1038-no-jre.zip
4+
SQLCL_FILE=sqlcl-18.3.0.259.2029.zip
55
cd .travis
66

77
# Download if not present on cache dir.

.travis/install_utplsql_release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ end;
3737
SQL
3838

3939
"$SQLCLI" sys/$ORACLE_PWD@//$CONNECTION_STR AS SYSDBA <<SQL
40-
alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6003,6009,6010,7206)';
40+
alter session set plsql_optimize_level=0;
4141
@install_headless.sql ${UT3_RELEASE_VERSION_SCHEMA}
4242
exit
4343
SQL

.travis/start_db.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ else
1010
mkdir -p $HOME/.docker && cp $CACHE_DIR/.docker/config.json $HOME/.docker/
1111
fi
1212

13-
docker pull $DOCKHER_HUB_REPO:$ORACLE_VERSION
13+
df -h
14+
time docker pull $DOCKHER_HUB_REPO:$ORACLE_VERSION
15+
df -h
1416
docker run -d --name $ORACLE_VERSION $DOCKER_OPTIONS -p 1521:1521 $DOCKHER_HUB_REPO:$ORACLE_VERSION
15-
docker logs -f $ORACLE_VERSION | grep -m 1 "DATABASE IS READY TO USE!" --line-buffered
17+
time docker logs -f $ORACLE_VERSION | grep -m 1 "DATABASE IS READY TO USE!" --line-buffered
18+
df -h

CONTRIBUTING.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,18 @@ export CONNECTION_STR=127.0.0.1:1521/xe # Adjust the connect string
8989
export ORACLE_PWD=oracle # Adjust your local SYS password
9090
```
9191

92+
### Download Oracle JDBC drivers
93+
94+
Download `ojdbc8-xxx.jar` and `orai18n-xxx.jar` from [Oracle](https://www.oracle.com/technetwork/database/features/jdbc/jdbc-ucp-122-3110062.html).
95+
Place them in `development` directory of the project.
96+
97+
9298
### Download utPLSQL release sources and utplsq-cli
9399

94100
The below script is fetching latest release version from utPLSQL repository. Latest release version is used for self-testing.
95101
```bash
96102
development/refresh_sources.sh
97103
```
98-
> **Important notice:**
99-
> You'll have to provide the ojdbc.jar in the folder utPLSQL-cli/lib manually due to Oracle licensing restrictions.
100104

101105
### Setup local database for utPLSQL development
102106

@@ -175,6 +179,7 @@ We are using private docker images to test utPLSQL for our Travis CI builds. The
175179
* 11g XE R2
176180
* 12c SE R1
177181
* 12c SE R2
182+
* 18c SE
178183

179184
These images are based on the slimmed versions [official dockerfiles released by Oracle](https://github.com/utPLSQL/docker-scripts), but due to licensing restrictions, we can't make the images public.
180185
You can build your own and use it locally, or push to a private docker repository.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v3.1.2
1+
v3.1.3

0 commit comments

Comments
 (0)