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
|`tstPgm`|Test program |Specifies the name of the test program (`*SRVPGM`) to create. By default, this will be set to `&OPENLIB/&OPENMBR` for source members and `&CURLIB/&SHORTNAME` for local files. ||
146
+
|`srcFile`|Source file |Specifies the name of the source file containing a member with the same name as `TSTPGM`. By default, this will be set to `&OPENLIB/&OPENSPF` for source members. ||
147
+
|`srcMbr`|Source member |Specifies the name of the member containing the source code to be compiled. By default, this will be set to `&OPENMBR` for source members. ||
148
+
|`srcStmf`|Source stream file |Specifies the path name of the stream file containing the source code to be compiled. By default, this will be set to `&FULLPATH` for local files. ||
135
149
|`text`|Text description |Allows you to enter text that briefly describes the RPGUnit test case and its function. ||
136
150
|`cOption`|Compile options |Refer to the `OPTION` parameter in `CRTRPGMOD` command help. |*EVENTF |
137
151
|`dbgView`|Debugging views |Refer to the `DBGVIEW` parameter in `CRTRPGMOD` command help. |*SOURCE |
@@ -153,6 +167,10 @@ Here is an example with all execution parameters set in the `testing.json` file:
|`tstPgm`|Test program |Specifies the name of the test program (`*SRVPGM`) to create. By default, this will be set to `&OPENLIB/&OPENMBR` for source members and `&CURLIB/&SHORTNAME` for local files. ||
171
+
|`srcFile`|Source file |Specifies the name of the source file containing a member with the same name as `TSTPGM`. By default, this will be set to `&OPENLIB/&OPENSPF` for source members. ||
172
+
|`srcMbr`|Source member |Specifies the name of the member containing the source code to be compiled. By default, this will be set to `&OPENMBR` for source members. ||
173
+
|`srcStmf`|Source stream file |Specifies the path name of the stream file containing the source code to be compiled. By default, this will be set to `&FULLPATH` for local files. ||
156
174
|`text`|Text description |Allows you to enter text that briefly describes the RPGUnit test case and its function. ||
157
175
|`cOption`|Compile options |Refer to the `OPTION` parameter in `CRTCBLMOD` command help. |*EVENTF |
158
176
|`dbgView`|Debugging views |Refer to the `DBGVIEW` parameter in `CRTCBLMOD` command help. |*SOURCE |
@@ -178,18 +196,75 @@ Here is an example with all execution parameters set in the `testing.json` file:
|Run Order |Specifies the order for running the test procedures. Useful to check that there is no dependencies between test procedures. |*API |
184
-
|Library List |Specifies the library list for executing the specified unit test. |*CURRENT |
185
-
|Job Description |Specifies the name of the job description that is used to set the library list, when the `IBM i Testing: Library List` setting is set to `*JOBD`. `*DFT` can be used here to indicate the library of the unit test suite (service program) is searched for job description `RPGUNIT`. |*DFT |
186
-
|Report Detail |Specifies how detailed the test run report should be. |*BASIC |
187
-
|Create Report |Specifies whether a report is created. |*ALLWAYS |
188
-
|Reclaim Resources |Specifies when to reclaim resources. Resources, such as open files, can be reclaimed after each test case or at the end of the test suite. This option is useful if the test suite calls OPM programs, which do not set the `*INLR` indicator. |*NO |
|`tstPgm`|Test program |Specifies the name of the test program (`*SRVPGM`). By default, this will be set to `&OPENLIB/&OPENMBR` for source members and `&CURLIB/&SHORTNAME` for local files. ||
202
+
|`order`|Run Order |Specifies the order for running the test procedures. Useful to check that there is no dependencies between test procedures. |*API |
203
+
|`libl`|Library List |Specifies the library list for executing the specified unit test. |*CURRENT |
204
+
|`jobD`|Job Description |Specifies the name of the job description that is used to set the library list, when the `IBM i Testing: Library List` setting is set to `*JOBD`. `*DFT` can be used here to indicate the library of the unit test suite (service program) is searched for job description `RPGUNIT`. |*DFT |
205
+
|`detail`|Report Detail |Specifies how detailed the test run report should be. |*BASIC |
206
+
|`output`|Create Report |Specifies whether a report is created. |*ALLWAYS |
207
+
|`rclRsc`|Reclaim Resources |Specifies when to reclaim resources. Resources, such as open files, can be reclaimed after each test case or at the end of the test suite. This option is useful if the test suite calls OPM programs, which do not set the `*INLR` indicator. |*NO |
208
+
|`onFailure`|On Failure |Specifies test execution behavior after a failing assertion. |*ABORT |
209
+
|`wrapperCmd`|Wrapper Command |Specifies a custom command to wrap the `RUCALLTST` command. ||
189
210
</TabItem>
190
211
</Tabs>
191
212
192
-
### Vendor Integration
213
+
## Advanced Configuration
214
+
215
+
Some compile and execution configuration parameters (`TSTPGM`, `SRCFILE`, `SRCMBR`, `SRCSTMF`) are special because the extension typically manages and sets them for you. This is because they can be determined by the extension based on what tests are being compiled and executed. However, to provide maximum flexibility in configuring even these parameters, users can still do so via the `testing.json` file. A simple use case could be that you want to build your source member tests into your current library instead of the library containing the source.
216
+
217
+
Under the covers, the extension has default values for these special parameters along with supported variables based on whether you are working with local files or source members. The defaults below can be overwritten in the `testing.json` file:
218
+
219
+
<Tabs>
220
+
<TabItemlabel="Source Members">
221
+
```json
222
+
{
223
+
"rpgunit": {
224
+
"rucrtrpg": {
225
+
"tstPgm": "&OPENLIB/&OPENMBR",
226
+
"srcFile": "&OPENLIB/&OPENSPF",
227
+
"srcMbr": "&OPENMBR"
228
+
},
229
+
"rucalltst": {
230
+
"tstPgm": "&OPENLIB/&OPENMBR"
231
+
}
232
+
}
233
+
}
234
+
```
235
+
Supported Variables:
236
+
*`&CURLIB`: Current library, changeable in the **Library List**
237
+
*`&OPENLIB`: Library name where the test source member lives
238
+
*`&OPENSPF`: Source file name where the test source member lives
239
+
*`&OPENMBR`: Name of the test source member
240
+
241
+
</TabItem>
242
+
243
+
<TabItemlabel="Local Files">
244
+
```json
245
+
{
246
+
"rpgunit": {
247
+
"rucrtrpg": {
248
+
"tstPgm": "&CURLIB/&SHORTNAME"
249
+
"srcStmf": "&FULLPATH",
250
+
},
251
+
"rucalltst": {
252
+
"tstPgm": "&CURLIB/&SHORTNAME"
253
+
}
254
+
}
255
+
}
256
+
```
257
+
258
+
Supported Variables:
259
+
*`&CURLIB`: Current library, changeable in the **Library List**
260
+
*`&NAME`: Name of the test file
261
+
*`&SHORTNAME`: Shortened name of the test file (based on rules [here](https://ibm.github.io/sourceorbit/#/./pages/general/rules?id=long-file-names))
262
+
*`&FULLPATH`: Full path of the test file on the remote system
263
+
</TabItem>
264
+
</Tabs>
265
+
266
+
267
+
## Vendor Integration
193
268
The `wrapperCmd` parameter in the `RUCRTRPG`/`RUCRTCBL`/`RUCALLTST` specifications are not actual parameters of the RPGUnit commands, but rather are provided by the extension to allow wrappering them. This is primarily used when integrating RPGUnit with other vendor tools.
Copy file name to clipboardExpand all lines: src/content/docs/developing/testing/overview.mdx
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,14 @@ The following extensions can be installed from the Visual Studio Code Marketplac
35
35
36
36
### 2. RPGUnit
37
37
38
-
The `RPGUNIT` library ***(`5.1.0-beta.005` minimum)*** must be be installed on your IBM i in order to leverage the framework and assertions that it provides. It can be installed easily via the extension using the steps below which is the recommended approach or manually using the instructions [here](https://irpgunit.sourceforge.io/help/).
38
+
The `RPGUNIT` library must be installed on your IBM i in order to leverage the framework and assertions that it provides. It can be installed easily via the extension using the steps below which is the recommended approach or manually using the instructions [here](https://irpgunit.sourceforge.io/help/).
39
+
40
+
The required RPGUnit version depends on which version of the **IBM i Testing** extension you have installed:
Copy file name to clipboardExpand all lines: src/content/docs/developing/testing/running.mdx
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,8 @@ For tests to be discovered by the extension, you must first [connect to an IBM i
18
18
19
19

20
20
21
+
### Running Tests
22
+
21
23
From here you can hover on any test case, test suite, folder, library, or source file and use the inline **Run Test** button. Using this action will start the following process:
22
24
23
25
<Steps>
@@ -32,6 +34,16 @@ From here you can hover on any test case, test suite, folder, library, or source
32
34

33
35
</Aside>
34
36
37
+
### Cancelling Tests
38
+
39
+
The current test deployment, compilation, and execution can be cancelled at anytime by navigating to the **Test Explorer** view and using the **Cancel Test Run** button.
40
+
41
+

42
+
43
+
Any test suites which were executed before cancellation will still have their test results shown in the **Test Results** view. Cancelled test suites will be marked accordingly and a total count of cancelled test suites and cases will be included in the test summary.
44
+
45
+

46
+
35
47
## Test Results
36
48
37
49
After running any test, the results will be displayed in detail in the **Test Results** view. This will include the number of passed, failed, and errored test cases along with any relevant messages. The results can also be viewed at a high level in the `Testing` view itself where the icon will be updated to reflect the status of the test. Failures associated with a specific line will also be displayed in the editor.
@@ -42,6 +54,12 @@ After running any test, the results will be displayed in detail in the **Test Re
42
54
43
55

44
56
57
+
### Diagnosing Errors
58
+
59
+
When there is an assertion failure, you can view the actual and expected results (depending on the type of assertion) along with the failure message in the **Test Results** view. In addition, you can scroll through the editor and see the same message inline right next to the failing assertion. Upon clicking on this message, you will get an expanded inline view of the error which also includes a diff of the actual and expected result along with the stack trace.
60
+
61
+

62
+
45
63
## Code Coverage
46
64
47
65
You can also run the tests with code coverage to see which lines of code were executed during the test run. This is useful for identifying untested code paths and ensuring that your tests cover all critical areas of your application.
0 commit comments