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

Skip to content

Commit c935f64

Browse files
authored
Merge pull request #1199 from utPLSQL/feature/fix_sonar_test_results
Fix for unit-test results reporting into Sonar
2 parents 79fcf85 + 6a32fc4 commit c935f64

21 files changed

Lines changed: 121 additions & 117 deletions

.github/variables/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ UT3_DEVELOP_SCHEMA=UT3_DEVELOP
33
UT3_DEVELOP_SCHEMA_PASSWORD=ut3
44
UT3_RELEASE_VERSION_SCHEMA=UT3
55
UT3_RELEASE_VERSION_SCHEMA_PASSWORD=ut3
6-
UT3_USER='UT3$USER#'
6+
UT3_USER='UT3_USER'
77
UT3_USER_PASSWORD=ut3
88
UT3_TESTER=UT3_TESTER
99
UT3_TESTER_PASSWORD=ut3

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ jobs:
193193

194194
- name: SonarCloud Scan
195195
id: sonar
196-
if: ${{ matrix.db_version_name == '21XE' }}
196+
if: ${{ always() && matrix.db_version_name == '21XE' }}
197197
uses: SonarSource/sonarcloud-github-action@master
198198
env:
199199
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ We use four different database accounts (users) for development process.
4646
* `ut3` - holds latest released version of utPLSQL. This schema holds the testing framework used for self-testing of utPLSQL development.
4747
* `ut3_develop` - holds the version of utPLSQL of your current branch. This is the schema you will be working on.
4848
* `ut3_tester` - holds unit test packages for development of utPLSQL.
49-
* `ut3$user#` - used for testing accessibility to schema names with special characters.
49+
* `ut3_user` - used for testing accessibility to schema names with special characters.
5050
* `ut3_tester_helper` - elevated privileges user, used for creating and dropping objects in other schemas during test run.
5151

5252

docs/userguide/expectations.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,13 @@ Failures:
249249
1) the_test
250250
"Checking table ALL_USERS"
251251
Actual: 28 (number) was expected to equal: 0 (number)
252-
at "UT3$USER#.SHARED_EXPECTATION_TEST.TABLE_IS_EMPTY", line 6 ut.expect( l_count, 'Checking table '||p_table_name ).to_equal(0);
253-
at "UT3$USER#.SHARED_EXPECTATION_TEST.THE_TEST", line 11
252+
at "UT3_USER.SHARED_EXPECTATION_TEST.TABLE_IS_EMPTY", line 6 ut.expect( l_count, 'Checking table '||p_table_name ).to_equal(0);
253+
at "UT3_USER.SHARED_EXPECTATION_TEST.THE_TEST", line 11
254254
255255
"Checking table ALL_TABLES"
256256
Actual: 55 (number) was expected to equal: 0 (number)
257-
at "UT3$USER#.SHARED_EXPECTATION_TEST.TABLE_IS_EMPTY", line 6 ut.expect( l_count, 'Checking table '||p_table_name ).to_equal(0);
258-
at "UT3$USER#.SHARED_EXPECTATION_TEST.THE_TEST", line 12
257+
at "UT3_USER.SHARED_EXPECTATION_TEST.TABLE_IS_EMPTY", line 6 ut.expect( l_count, 'Checking table '||p_table_name ).to_equal(0);
258+
at "UT3_USER.SHARED_EXPECTATION_TEST.THE_TEST", line 12
259259
260260
Finished in .066344 seconds
261261
1 tests, 1 failed, 0 errored, 0 disabled, 0 warning(s)

docs/userguide/running-unit-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ declare
195195
begin
196196
l_reporter.set_reporter_id( 'd8a79e85915640a6a4e1698fdf90ba74' );
197197
l_reporter.output_buffer.init();
198-
ut_runner.run (ut_varchar2_list ('ut3_tester','ut3$user#'), ut_reporters( l_reporter ) );
198+
ut_runner.run (ut_varchar2_list ('ut3_tester','ut3_user'), ut_reporters( l_reporter ) );
199199
end;
200200
/
201201
```

test/install_ut3_tester_helper.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ alter session set plsql_optimize_level=0;
3535
@@ut3_tester_helper/annotation_cache_helper.pks
3636
@@ut3_tester_helper/annotation_cache_helper.pkb
3737
create or replace synonym ut3_tester.annotation_cache_helper for ut3_tester_helper.annotation_cache_helper;
38-
create or replace synonym ut3$user#.coverage_helper for ut3_tester_helper.coverage_helper;
38+
create or replace synonym ut3_user.coverage_helper for ut3_tester_helper.coverage_helper;
3939

4040
set linesize 200
4141
set define on

test/run_tests.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ git rev-parse && cd "$(git rev-parse --show-cdup)"
66

77
time utPLSQL-cli/bin/utplsql run ${UT3_TESTER_HELPER}/${UT3_TESTER_HELPER_PASSWORD}@${CONNECTION_STR} \
88
-source_path=source -owner=ut3_develop \
9-
-p='ut3_tester,ut3$user#' \
9+
-p='ut3_tester,ut3_user' \
1010
-test_path=test -c \
11+
-regex_expression="test/(\w+)(/(\w+))*/(\w+)\.(.{3})$" \
12+
-owner_subexpression=1 \
13+
-type_subexpression=5 \
14+
-name_subexpression=4 \
1115
-f=ut_coverage_sonar_reporter -o=coverage.xml \
1216
-f=ut_coverage_cobertura_reporter -o=cobertura.xml \
1317
-f=ut_coverage_html_reporter -o=coverage.html \

test/ut3_tester/core/annotations/test_annotation_manager.pkb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,19 @@ create or replace package body test_annotation_manager is
7171
exec_autonomous(q'[alter package dummy_test_package compile]');
7272
end;
7373

74-
procedure create_parse_proc_as_ut3$user# is
74+
procedure create_parse_proc_as_ut3_user is
7575
begin
76-
ut3_tester_helper.main_helper.create_parse_proc_as_ut3$user#();
76+
ut3_tester_helper.main_helper.create_parse_proc_as_ut3_user();
7777
end;
7878

79-
procedure parse_dummy_test_as_ut3$user# is
79+
procedure parse_dummy_test_as_ut3_user is
8080
begin
81-
ut3_tester_helper.main_helper.parse_dummy_test_as_ut3$user#();
81+
ut3_tester_helper.main_helper.parse_dummy_test_as_ut3_user();
8282
end;
8383

84-
procedure drop_parse_proc_as_ut3$user# is
84+
procedure drop_parse_proc_as_ut3_user is
8585
begin
86-
ut3_tester_helper.main_helper.drop_parse_proc_as_ut3$user#();
86+
ut3_tester_helper.main_helper.drop_parse_proc_as_ut3_user();
8787
exception
8888
when others then
8989
null;
@@ -400,10 +400,10 @@ create or replace package body test_annotation_manager is
400400
l_start_date date;
401401
begin
402402
l_start_date := sysdate;
403-
parse_dummy_test_as_ut3$user#();
403+
parse_dummy_test_as_ut3_user();
404404
drop_dummy_test_package();
405405
--Act
406-
parse_dummy_test_as_ut3$user#();
406+
parse_dummy_test_as_ut3_user();
407407
--Assert
408408
select count(1)
409409
into l_cache_count

test/ut3_tester/core/annotations/test_annotation_manager.pks

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ create or replace package test_annotation_manager is
1414

1515
procedure create_dummy_test_package;
1616

17-
procedure create_parse_proc_as_ut3$user#;
17+
procedure create_parse_proc_as_ut3_user;
1818

19-
procedure drop_parse_proc_as_ut3$user#;
19+
procedure drop_parse_proc_as_ut3_user;
2020

2121
procedure drop_dummy_test_package;
2222

@@ -85,8 +85,8 @@ create or replace package test_annotation_manager is
8585
procedure update_modified_test_package;
8686

8787
--%test(Keeps annotations in cache when object was removed but user can't see whole schema)
88-
--%beforetest(create_dummy_test_package,create_parse_proc_as_ut3$user#)
89-
--%aftertest(drop_parse_proc_as_ut3$user#)
88+
--%beforetest(create_dummy_test_package,create_parse_proc_as_ut3_user)
89+
--%aftertest(drop_parse_proc_as_ut3_user)
9090
procedure keep_dropped_data_in_cache;
9191

9292
--%test(Does not return data for dropped object)

test/ut3_tester_helper/main_helper.pkb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,26 +104,26 @@ create or replace package body main_helper is
104104
commit;
105105
end;
106106

107-
procedure create_parse_proc_as_ut3$user# is
107+
procedure create_parse_proc_as_ut3_user is
108108
pragma autonomous_transaction;
109109
begin
110110
execute immediate q'[
111-
create or replace procedure ut3$user#.parse_annotations is
111+
create or replace procedure ut3_user.parse_annotations is
112112
begin
113113
ut3_develop.ut_runner.rebuild_annotation_cache('UT3_TESTER','PACKAGE');
114114
end;]';
115115
end;
116116

117-
procedure drop_parse_proc_as_ut3$user# is
117+
procedure drop_parse_proc_as_ut3_user is
118118
pragma autonomous_transaction;
119119
begin
120-
execute immediate 'drop procedure ut3$user#.parse_annotations';
120+
execute immediate 'drop procedure ut3_user.parse_annotations';
121121
end;
122122

123-
procedure parse_dummy_test_as_ut3$user# is
123+
procedure parse_dummy_test_as_ut3_user is
124124
pragma autonomous_transaction;
125125
begin
126-
execute immediate 'begin ut3$user#.parse_annotations; end;';
126+
execute immediate 'begin ut3_user.parse_annotations; end;';
127127
end;
128128

129129
procedure append_to_list(a_list in out nocopy ut3_develop.ut_varchar2_list, a_item varchar2) is

0 commit comments

Comments
 (0)