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

Skip to content

Commit a5600ea

Browse files
authored
Merge branch 'develop' into fix-expectation-reporting
2 parents 3830360 + 1236007 commit a5600ea

11 files changed

Lines changed: 107 additions & 9 deletions

.travis/build_release_archive.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ mv -f .gitattributes.release .gitattributes
99
git add .
1010
git commit -m "tmp commit for building a release archive"
1111

12-
git archive --prefix="utPLSQL${UTPLSQL_BUILD_VERSION}"/ -o "utPLSQL${UTPLSQL_BUILD_VERSION}".zip --format=zip HEAD
13-
git archive --prefix="utPLSQL${UTPLSQL_BUILD_VERSION}"/ -o "utPLSQL${UTPLSQL_BUILD_VERSION}".tar.gz --format=tar.gz HEAD
12+
# git archive --prefix="utPLSQL${UTPLSQL_BUILD_VERSION}"/ -o "utPLSQL${UTPLSQL_BUILD_VERSION}".zip --format=zip HEAD
13+
# git archive --prefix="utPLSQL${UTPLSQL_BUILD_VERSION}"/ -o "utPLSQL${UTPLSQL_BUILD_VERSION}".tar.gz --format=tar.gz HEAD
14+
15+
git archive --prefix=utPLSQL/ -o utPLSQL.zip --format=zip HEAD
16+
git archive --prefix=utPLSQL/ -o utPLSQL.tar.gz --format=tar.gz HEAD
1417

1518

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env bash
2-
echo `sed -r "s/(v?[0-9]+\.)([0-9]+\.)([0-9]+)(-.*)/\1\2\3\.${UTPLSQL_BUILD_NO}\4/" <<< "${UTPLSQL_VERSION}"`
2+
echo `sed -r "s/(v?[0-9]+\.)([0-9]+\.)([0-9]+)(-.*)?/\1\2\3\.${UTPLSQL_BUILD_NO}\4/" <<< "${UTPLSQL_VERSION}"`

.travis/install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ set verify off
1111
@../source/create_utplsql_owner.sql $UT3_OWNER $UT3_OWNER_PASSWORD $UT3_TABLESPACE
1212
--needed for Mystats script to work
1313
grant select any dictionary to $UT3_OWNER;
14+
--Needed for testing a coverage outside ut3_owner.
15+
grant create any procedure, execute any procedure to $UT3_OWNER;
16+
1417
@../source/create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE
18+
1519
cd ..
1620
1721
--enable plsql debug

.travis/push_docs_to_gh_pages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LATEST_DOCS_BRANCH="develop"
2020
# Since we are running job matrix, only thie first job slave will need to do the work
2121
if [[ "${TRAVIS_JOB_NUMBER}" =~ \.1$ ]]; then
2222
# We don't want a pull request automatically updating the repository
23-
if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "${CURRENT_BRANCH}" == "${LATEST_DOCS_BRANCH}" ]; then
23+
if [ "$TRAVIS_PULL_REQUEST" == "false" ] && { [ "${CURRENT_BRANCH}" == "${LATEST_DOCS_BRANCH}" ] || [ -n "${TRAVIS_TAG}" ]; }; then
2424

2525
# ENV Variable checks are to help with configuration troubleshooting, they silently exit with unique message.
2626
# Anyone one of them not set can be used to turn off this functionality.

source/core/types/ut_run.tpb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ create or replace type body ut_run as
2020
self in out nocopy ut_run, a_items ut_suite_items, a_run_paths ut_varchar2_list := null,
2121
a_coverage_options ut_coverage_options := null, a_test_file_mappings ut_file_mappings := null
2222
) return self as result is
23-
l_run_schemes ut_varchar2_list;
23+
l_coverage_schema_names ut_varchar2_list;
2424
begin
2525
self.run_paths := a_run_paths;
2626
self.self_type := $$plsql_unit;
@@ -29,15 +29,15 @@ create or replace type body ut_run as
2929
self.coverage_options := a_coverage_options;
3030
self.test_file_mappings := coalesce(a_test_file_mappings, ut_file_mappings());
3131
if self.coverage_options is not null then
32-
l_run_schemes := get_run_schemes();
33-
coverage_options.schema_names := l_run_schemes;
32+
l_coverage_schema_names := coalesce(coverage_options.schema_names, get_run_schemes());
33+
coverage_options.schema_names := l_coverage_schema_names;
3434
if coverage_options.exclude_objects is not null then
3535
coverage_options.exclude_objects :=
3636
coverage_options.exclude_objects
3737
multiset union all
38-
ut_suite_manager.get_schema_ut_packages(l_run_schemes);
38+
ut_suite_manager.get_schema_ut_packages(l_coverage_schema_names);
3939
else
40-
coverage_options.exclude_objects := ut_suite_manager.get_schema_ut_packages(l_run_schemes);
40+
coverage_options.exclude_objects := ut_suite_manager.get_schema_ut_packages(l_coverage_schema_names);
4141
end if;
4242
end if;
4343
return;

tests/RunAll.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,16 @@ create table ut$test_table (val varchar2(1));
2525
@@helpers/utplsql_test_reporter.typ
2626
@@helpers/test_reporters.pks
2727
@@helpers/test_reporters.pkb
28+
@@helpers/html_coverage_test.pck
29+
@@helpers/test_reporters_1.pks
30+
@@helpers/test_reporters_1.pkb
2831

2932
--Start coverage in develop mode (coverage for utPLSQL framework)
3033
--Regular coverage excludes the framework
3134
exec ut_coverage.coverage_start_develop();
3235
@@lib/mystats/mystats start
3336

37+
3438
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.IgnoreWrappedPackageAndDoesNotRaiseException.sql
3539
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationMixedWithWrongBeforeProcedure.sql
3640
@@lib/RunTest.sql ut_annotations/ut_annotations.parse_package_annotations.ParseAnnotationNotBeforeProcedure.sql
@@ -130,6 +134,8 @@ exec ut_coverage.coverage_start_develop();
130134
@@lib/RunTest.sql ut_reporters/ut_sonar_test_reporter.ProducesExpectedOutputs.sql
131135
@@lib/RunTest.sql ut_reporters/ut_teamcity_reporter.ProducesExpectedOutputs.sql
132136
@@lib/RunTest.sql ut_reporters/ut_xunit_reporter.ProducesExpectedOutputs.sql
137+
@@lib/RunTest.sql ut_reporters/ut_html_reporter.UserOverrideSchemaCoverage.sql
138+
@@lib/RunTest.sql ut_reporters/ut_html_reporter.DefaultSchemaCoverage.sql
133139

134140
@@lib/RunTest.sql ut/ut.run.AcceptsCoverageFileList.sql
135141
@@lib/RunTest.sql ut/ut.run.AcceptsCoverageFileListWithSutePaths.sql
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
CREATE OR REPLACE PACKAGE ut3_user.html_coverage_test IS
2+
3+
-- Author : LUW07
4+
-- Created : 23/05/2017 09:37:29
5+
-- Purpose : Supporting html coverage procedure
6+
7+
-- Public type declarations
8+
PROCEDURE run_if_statment(o_result OUT NUMBER);
9+
END HTML_COVERAGE_TEST;
10+
/
11+
CREATE OR REPLACE PACKAGE BODY ut3_user.html_coverage_test IS
12+
13+
-- Private type declarations
14+
PROCEDURE run_if_statment(o_result OUT NUMBER) IS
15+
l_testedvalue NUMBER := 1;
16+
l_success NUMBER := 0;
17+
BEGIN
18+
IF l_testedvalue = 1 THEN
19+
l_success := 1;
20+
END IF;
21+
22+
o_result := l_success;
23+
END run_if_statment;
24+
END HTML_COVERAGE_TEST;
25+
/

tests/helpers/test_reporters_1.pkb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
create or replace package body test_reporters_1
2+
as
3+
procedure diffrentowner_test
4+
is
5+
l_result number;
6+
begin
7+
ut3_user.html_coverage_test.run_if_statment(l_result);
8+
ut.expect(l_result).to_equal(1);
9+
end;
10+
end;
11+
/
12+

tests/helpers/test_reporters_1.pks

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
create or replace package test_reporters_1
2+
as
3+
--%suite(A suite for testing html coverage options)
4+
5+
--%test(a test calling package outside schema)
6+
procedure diffrentowner_test;
7+
8+
end;
9+
/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
DECLARE
2+
l_results ut_varchar2_list;
3+
l_clob CLOB;
4+
l_expected VARCHAR2(32767);
5+
BEGIN
6+
l_expected := '%<h3>UT3.TEST_REPORTERS_1</h3>%';
7+
SELECT * BULK COLLECT
8+
INTO l_results
9+
FROM TABLE(ut.run('test_reporters_1', ut_coverage_html_reporter()));
10+
l_clob := ut3.ut_utils.table_to_clob(l_results);
11+
12+
IF l_clob LIKE l_expected THEN
13+
:test_result := ut3.ut_utils.tr_success;
14+
ELSE
15+
dbms_output.put_line('Failed to match to default schema');
16+
END IF;
17+
18+
END;
19+
/

0 commit comments

Comments
 (0)