You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: development/cleanup.sh
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,10 @@ drop user ${UT3_USER} cascade;
15
15
begin
16
16
for i in (
17
17
select decode(owner,'PUBLIC','drop public synonym "','drop synonym "'||owner||'"."')|| synonym_name ||'"' drop_orphaned_synonym from dba_synonyms a
18
-
where not exists (select null from dba_objects b where a.table_name=b.object_name and a.table_owner=b.owner )
19
-
and a.table_owner <> 'SYS'
18
+
where not exists (select 1 from dba_objects b where (a.table_name=b.object_name and a.table_owner=b.owner or b.owner='SYS' and a.table_owner=b.object_name) )
The release process is automated in the following way:
2
-
1) With every build, the build process on Travis updates files with an appropriate version number before deployment into the database.
3
-
This is to confirm that the update of versions works properly.
4
-
2) When a build is executed on a branch named `release/v1.2.3-something` then additional steps are taken:
5
-
- the project version in files: `sonar-project.properties`, `VERSION` is updated from the version number derived from the release branch
6
-
- changes to those two files are committed and pushed - this should happen only once, when the release branch is initially created on the main repo
7
-
3) To create a release, just create a tag on the code to be released. The tag name must match the regex pattern: `^v[0-9]+\.[0-9]+\.[0-9]+.*$`
8
-
- When a tag build is executed, the documentation is built and files are uploaded to the tag.
9
-
- The version number is derived from the tag name.
10
-
4) The release version does not provide access to unversioned source files (the default zip file from GitHub is empty).
11
-
The sources for release are provided in separate zip files delivered from the Travis build process.
1
+
The release process is semi-automated.
2
+
3
+
With every build, the build process on Travis updates files with an appropriate version number before deployment into the database.
4
+
This step is performed, to confirm that the update of versions works properly.
5
+
6
+
To create a release:
7
+
- create release branch and wait for release build to complete successfully
8
+
- merge release branch to master and wait for master build to complete successfully
9
+
- create a release from the master branch using github web page and populate release description using information found on the issues and pull requests for release
10
+
11
+
The following will happen:
12
+
- build executed on branch `release/v1.2.3-[something]` updates files `sonar-project.properties`, `VERSION` with project version derived from the release branch name
13
+
- changes to those two files are committed and pushed back to release branch by Travis
14
+
- when a release is created, a new tag is added in on the repository and a tag build is executed
15
+
- the documentation for new release is published on `utplsql.github.io` and installation archives are added to the tag.
16
+
17
+
Note:
18
+
The released version does not provide access to un-versioned source files (the default zip file from GitHub is empty).
19
+
The sources for release are provided in separate zip files delivered from the Travis build process.
20
+
This is because we do not keep version in our source files in develop branch.
Copy file name to clipboardExpand all lines: docs/userguide/annotations.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -214,3 +214,26 @@ When processing the test suite `test_pkg` defined in [Example of annotated test
214
214
rollback to savepoint 'beforeall'
215
215
216
216
```
217
+
218
+
# Annotation cache
219
+
220
+
utPLSQL needs to scan sources of package specifications to identify and parse annotations.
221
+
To improve framework startup time, specially when dealing with database users owning large amount of packages the framework has build-in persistent cache for annotations.
222
+
223
+
Cache is checked for staleness and refreshed automatically on every run.
224
+
The initial startup of utPLSQL for a schema will take longer than consecutive executions.
225
+
226
+
If you're in situation, where your database is controlled via CI/CD server and gets refreshed/wiped before each run of your tests,
227
+
consider building upfront and creating the snapshot of our database after the cache was refreshed.
228
+
229
+
To build annotation cache without actually invoking any tests, call `ut_runner.rebuild_annotation_cache(a_object_owner, a_object_type)` sql block for every unit test owner that you want to have annotations cache prebuilt.
ut.expect( 'supercat', 'checked superhero-animal was not a dog' ).to_( equal('superdog') );
36
+
````
37
+
The message is added to the normal failure message returned by the matcher.
38
+
39
+
This is not only useful to give more detailed and specific information about a test, but also if you have some kind of dynamic tests.
40
+
41
+
### Dynamic tests example
42
+
You have a bunch of tables and an archive-functionality for them and you want to test if the things you put into live-tables are removed from live-tables and present in archive-tables:
Parameters `a_pattern` and `a_modifiers` represent a valid regexp pattern accepted by [Oracle REGEXP_LIKE condition](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF00501)
265
+
193
266
## equal
194
267
195
268
The equal matcher is a very restrictive matcher. It only returns true if the compared data-types are the same.
@@ -401,22 +474,44 @@ end;
401
474
402
475
This test will fail as `v_actual` is not equal `v_expected`.
403
476
404
-
## match
405
-
Validates that the actual value is matching the expected regular expression.
477
+
# Expecting exceptions
478
+
479
+
Below example illustrates how to write test to check for expected exceptions (thrown by tested code).
ut.fail('Expected exception but nothing was raised');
501
+
exception
502
+
when others then
503
+
ut.expect( sqlcode ).to_equal( -1476 );
504
+
ut.expect( sqlerrm ).to_match( 'equal to zero' );
505
+
end;
506
+
end;
507
+
/
416
508
```
417
509
418
-
Parameters `a_pattern` and `a_modifiers` represent a valid regexp pattern accepted by [Oracle REGEXP_LIKE condition](https://docs.oracle.com/database/121/SQLRF/conditions007.htm#SQLRF00501)
510
+
The call to `ut.fail` is required to make sure that the test fails, if we expect an exception, but the tested code does not throw any.
511
+
512
+
The call to `ut.expect` uses `equal` matcher to check that the exception that was raised was exactly the one we were expecting to get in particular situation.
419
513
514
+
Depending on the situation you will want to check for `sqlcode`, `sqlerrm`, both or perform additional expectation checks to make sure nothing was changed by the called procedure in the database.
420
515
421
516
422
517
# Supported data types
@@ -471,3 +566,4 @@ end;
471
566
```
472
567
Since NULL is neither *true* nor *not true*, both expectations will report failure.
0 commit comments