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
Fixes#43Fixes#20
Partially addresses #28 by adding doc on how to run via IPM - there's still more we could do to make the support more automatic but that'll be left as a future enhancement.
| Caché / Ensemble | 2.x (via artifacts available in [Releases](https://github.com/intersystems/TestCoverage/releases))|
17
+
18
+
### Installation: IPM
13
19
14
20
If you already have the [InterSystems Package Manager](https://openexchange.intersystems.com/package/InterSystems-Package-Manager-1), installation is as easy as:
15
21
```
@@ -33,19 +39,6 @@ Set root = "<path on filesystem to which repository was cloned/downloaded>"
33
39
Do $System.OBJ.ImportDir(root,"*.inc;*.cls","ck",,1)
34
40
```
35
41
36
-
### Installation: from Atelier
37
-
38
-
Note: this assumes you have the Git plugin for Atelier installed.
39
-
40
-
1. Right-click in the Atelier Explorer and select Import...
41
-
2. Select the "Projects from Git" wizard under the "Git" folder, then click "Next"
42
-
3. In the "Select Repository Source" dialog, select "Clone URI" and enter this repository's URI, then click "Next"
43
-
4. Select the branch(es) you intend to build from, then click "Next"
44
-
5. Select a local destination in which to store the code, then click "Next"
45
-
6. Choose "import existing Eclipse projects" and select the TestCoverage project, then click "Next"
46
-
7. Configure a connection for the project
47
-
8. Synchronize the project with your selected namespace
48
-
49
42
### Security
50
43
Note that, depending on your security settings, SQL privileges may be required for access to test coverage data. The relevant permissions may be granted by running:
51
44
@@ -104,6 +97,28 @@ Where:
104
97
*`tPIDList` (optional) has a $ListBuild list of process IDs to monitor. If this is empty, all processes are monitored. If this is $ListBuild("Interop") or "Interoperability", all interoperability processes and the current process are monitored. By default, only the current process is monitored.
105
98
*`tTiming` (optional) is 1 to capture execution time data for monitored classes/routines as well, or 0 (the default) to not capture this data.
106
99
100
+
### Running Tests with Coverage via IPM
101
+
102
+
Running unit tests with test coverage measurement via IPM is much simpler. Given a package `mycompany.foo`, a coverage.list file within its [unit test resource(s)](https://github.com/intersystems/ipm/wiki/03.-IPM-Manifest-(Module.xml)#unittest-or-test), and TestCoverage installed, tests can be run with coverage with:
103
+
104
+
```
105
+
zpm "mycompany.foo test -only -DUnitTest.ManagerClass=TestCoverage.Manager"
106
+
```
107
+
108
+
Additional "userparam" keys can be passed in the zpm command prefixed with `-DUnitTest.UserParam.` - for example:
Note that it is best practice to put your unit tests in a separate directory from your source code, most commonly `/tests`.
119
+
120
+
For more details and examples, see [this InterSystems Developer Community article series](https://community.intersystems.com/post/unit-tests-and-test-coverage-intersystems-package-manager).
121
+
107
122
### Viewing Results
108
123
After running the tests, a URL is shown in the output at which you can view test coverage results. If the hostname/IP address in this URL is incorrect, you can fix it by changing the "WebServerName" setting in the management portal, at System Administration > Configuration > Additional Settings > Startup.
109
124
@@ -134,6 +149,7 @@ We use [SemVer](http://semver.org/) for versioning. For the versions available,
Copy file name to clipboardexpand all lines: module.xml
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
<Exportgenerator="Cache"version="25">
3
3
<Documentname="TestCoverage.ZPM"><Module>
4
4
<Name>TestCoverage</Name>
5
-
<Version>3.2.0</Version>
5
+
<Version>4.0.0</Version>
6
6
<Description>Run your typical ObjectScript %UnitTest tests and see which lines of your code are executed. Includes Cobertura-style reporting for use in continuous integration tools.</Description>
0 commit comments