Skip to content

Commit 4bc7ced

Browse files
committed
Merge branch 'develop' into feature/support_of_context
# Conflicts: # source/api/ut_runner.pkb # source/core/ut_utils.pks # source/reporters/ut_teamcity_reporter.tpb
2 parents a6dadcc + 1ea85e7 commit 4bc7ced

File tree

200 files changed

+1071
-632
lines changed

Some content is hidden

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

200 files changed

+1071
-632
lines changed

.travis/install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ grant create any procedure, drop any procedure, execute any procedure to $UT3_OW
2121
2222
conn $UT3_OWNER/$UT3_OWNER_PASSWORD@//$CONNECTION_STR
2323
@../development/utplsql_style_check.sql
24-
exit
2524
SQL
2625

2726
#Create additional users

.travis/push_docs_to_gh_pages.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,16 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
5353
mkdir -p develop
5454
rm -rf develop/**./* || exit 0
5555
cp -a ../docs/. ./develop
56-
# If a Tagged Build then copy to it's own directory as well.
56+
# If a Tagged Build then copy to it's own directory as well and to the 'latest' release directory
5757
if [ -n "$TRAVIS_TAG" ]; then
5858
echo "Creating ${UTPLSQL_VERSION}"
5959
mkdir -p ${UTPLSQL_VERSION}
6060
rm -rf ${UTPLSQL_VERSION}/**./* || exit 0
6161
cp -a ../docs/. ${UTPLSQL_VERSION}
62+
echo "Populating 'latest' directory"
63+
mkdir -p latest
64+
rm -rf latest/**./* || exit 0
65+
cp -a ../docs/. latest
6266
fi
6367
# Stage changes for commit
6468
git add .
@@ -69,7 +73,6 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
6973
fi
7074
#Changes where detected, so we need to update the version log.
7175
now=$(date +"%d %b %Y - %r")
72-
export latest=" - [Latest development version](develop/) - Created $now"
7376
if [ ! -f index.md ]; then
7477
echo "---" >>index.md
7578
echo "layout: default" >>index.md
@@ -85,13 +88,12 @@ if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
8588
fi
8689
#If build running on a TAG - it's a new release - need to add it to documentation
8790
if [ -n "${TRAVIS_TAG}" ]; then
88-
latest_release=" [${TRAVIS_TAG} documentation](${UTPLSQL_VERSION}/) - Created $now"
89-
sed -i '7s@.*@'" - Latest release: ${latest_release}"'@' index.md
90-
#add entry to the end of file - ## Released Version Doc History
91-
echo "- ${latest_release}">>index.md
91+
sed -i '7s@.*@'" - [Latest ${TRAVIS_TAG} documentation](latest/) - Created $now"'@' index.md
92+
#add entry to the top of version history (line end of file - ## Released Version Doc History
93+
sed -i '12i'" - [${TRAVIS_TAG} documentation](${UTPLSQL_VERSION}/) - Created $now" index.md
9294
fi
9395
#replace 4th line in log
94-
sed -i '8s@.*@'"${latest}"'@' index.md
96+
sed -i '8s@.*@'" - [Latest development version](develop/) - Created $now"'@' index.md
9597
#Add and Commit the changes back to pages repo.
9698
git add .
9799
git commit -m "Deploy to gh-pages branch: base commit ${SHA}"

development/utplsql_style_check.sql

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
alter session set plscope_settings= 'identifiers:all';
22
set linesize 300
3+
set pagesize 10000
34

45
--install or comple all code here
56
exec dbms_utility.compile_schema(USER,compile_all => TRUE,reuse_settings => FALSE);
6-
7+
set echo off
8+
set feedback off
79

810
var errcnt number
911

1012
column errcnt_a noprint new_value errcnt_a
1113
column errcnt_l noprint new_value errcnt_l
1214
column errcnt_c noprint new_value errcnt_c
1315

14-
--find parameters that donot begin with A_
15-
prompt parameters should start with A_
16+
column NAME FORMAT A30
17+
column TYPE FORMAT A18
18+
column OBJECT_NAME FORMAT A30
19+
column OBJECT_TYPE FORMAT A18
20+
column USAGE FORMAT A16
21+
column LINE FORMAT 99999
22+
column COL FORMAT 9999
23+
24+
PROMPT parameters that are not prefixed with "a_"
1625
select name, type, object_name, object_type, usage, line, col, count(*) over() errcnt_a
1726
from user_identifiers
1827
where type like 'FORMAL%' and usage = 'DECLARATION'
@@ -21,8 +30,9 @@ select name, type, object_name, object_type, usage, line, col, count(*) over() e
2130
order by object_name, object_type, line, col
2231
;
2332

24-
prompt variables should start with L_
25-
--variables start with l_ or g_
33+
PROMPT
34+
PROMPT
35+
PROMPT variables that are not prefixed with "l_"
2636
select i.name, i.type, i.object_name, i.object_type, i.usage, i.line, i.col, count(*) over() errcnt_l
2737
from user_identifiers i
2838
join user_identifiers p
@@ -33,11 +43,13 @@ select i.name, i.type, i.object_name, i.object_type, i.usage, i.line, i.col, cou
3343
and (i.name not like 'L#_%' escape '#' and p.type in ('PROCEDURE','FUNCTION','ITERATOR')
3444
or i.name not like 'G#_%' escape '#' and p.type not in ('PROCEDURE','FUNCTION','ITERATOR'))
3545
and p.type != 'RECORD'
36-
order by object_name, object_type, line, col;
46+
order by object_name, object_type, line, col
3747
;
3848

39-
--constants start with c_ or gc_
40-
prompt constants should start with C_
49+
PROMPT
50+
PROMPT
51+
PROMPT constants that are not prefixed with with "c_"
52+
PROMPT global constants that are not prefixed with "gc_"
4153
select i.name, i.type, i.object_name, i.object_type, i.usage, i.line, i.col, count(*) over() errcnt_c
4254
from user_identifiers i
4355
join user_identifiers p
@@ -53,4 +65,4 @@ select i.name, i.type, i.object_name, i.object_type, i.usage, i.line, i.col, cou
5365
exec :errcnt := nvl('&errcnt_a',0) + nvl('&errcnt_l',0) + nvl('&errcnt_c',0);
5466

5567
--quit :errcnt
56-
-- exit success
68+
exit :errcnt

docs/images/tfs_details.png

70.2 KB
Loading

docs/images/tfs_summary.png

23.4 KB
Loading

docs/userguide/reporters.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,24 @@ Providing invalid paths or paths to non-existing files will result in failure wh
9595

9696
For details on how to invoke reporter with paths, see the **Coverage reporters** section.
9797

98+
# TFS / VSTS Reporter
99+
If you are using [TFS](https://www.visualstudio.com/tfs/) or [VSTS](https://www.visualstudio.com/team-services/) to do static code analysis for you PLSQL projects and run builds, your code analysis can benefit from code coverage and test results. TFS reporter is designed specifically to [work with Microsoft Team Fundation Server](https://docs.microsoft.com/en-us/vsts/build-release/tasks/test/publish-test-results?view=vsts) report format which is very old version of [JUnit](https://github.com/windyroad/JUnit-Schema/blob/master/JUnit.xsd).
100+
Main diffrence between standard JUnit is that <testsuite> elements cannot be nested and attribute skipped is not present.
101+
102+
utPLSQL provides test reporter to for TFS / VSTS server:
103+
- `ut_tfs_junit_reporter` - provides an XML output of each test executed per each project test file (package)
104+
105+
Example of test report from TFS CI server.
106+
107+
Summary:
108+
109+
![tfs_junit_reporter_outputs](../images/tfs_summary.png)
110+
111+
Details:
112+
113+
![tfs_junit_reporter_outputs](../images/tfs_details.png)
114+
115+
98116
# Coverage reporters
99117

100118
utPLSQL comes with a set of build-in coverage reporters. Have a look into the [coverage documentation](coverage.md) to learn more about them.

old_tests/lib/RunTest.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ declare
1010
l_duration_str varchar2(300) := ', executed in: '||((dbms_utility.get_time - :test_start_time)/100)||' second(s)';
1111
begin
1212
case
13-
when :test_result = ut_utils.tr_success then
13+
when :test_result = ut_utils.gc_success then
1414
:successes_count := :successes_count + 1;
1515
else
1616
dbms_output.put_line('---------------------------------------');

old_tests/ut/ut.run.AcceptsCoverageFileList.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ begin
1919
end loop;
2020
2121
if l_packages_reported = 3 then
22-
:test_result := ut_utils.tr_success;
22+
:test_result := ut_utils.gc_success;
2323
else
2424
for i in 1 .. l_output_data.count loop
2525
dbms_output.put_line(l_output_data(i));

old_tests/ut/ut.run.AcceptsCoverageFileListWithSutePaths.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ begin
1919
end loop;
2020
2121
if l_packages_reported = 3 then
22-
:test_result := ut_utils.tr_success;
22+
:test_result := ut_utils.gc_success;
2323
else
2424
for i in 1 .. l_output_data.count loop
2525
dbms_output.put_line(l_output_data(i));

old_tests/ut/ut.run.AcceptsSutePaths.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ begin
1616
end loop;
1717
1818
if l_packages_executed = 3 then
19-
:test_result := ut_utils.tr_success;
19+
:test_result := ut_utils.gc_success;
2020
else
2121
for i in 1 .. l_output_data.count loop
2222
dbms_output.put_line(l_output_data(i));

0 commit comments

Comments
 (0)