Skip to content

Commit 6720f29

Browse files
create 2 database to separate DATA and CODE
update the README.md for unit testing
1 parent b0a03af commit 6720f29

File tree

5 files changed

+45
-40
lines changed

5 files changed

+45
-40
lines changed

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"iris.script": "objectscript"
66
},
77
"objectscript.conn" :{
8-
"active": false,
8+
"active": true,
99
"ns": "IRISAPP",
1010
"username": "_SYSTEM",
1111
"password": "SYS",

Installer.cls renamed to App.Installer.cls

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ XData setup
88
<Default Name="Namespace" Value="IRISAPP"/>
99
<Default Name="database" Value="irisapp"/>
1010

11-
<Namespace Name="${Namespace}" Code="${Namespace}" Data="${Namespace}" Create="yes" Ensemble="no">
12-
11+
<Namespace Name="${Namespace}" Code="${Namespace}-CODE" Data="${Namespace}-DATA" Create="yes" Ensemble="1">
1312
<Configuration>
14-
<Database Name="${Namespace}" Dir="${mgrdir}${database}/data" Create="yes" Resource="%DB_${Namespace}"/>
13+
<Database Name="${Namespace}-DATA" Dir="${mgrdir}${database}/data" Create="yes" Resource="%DB_${Namespace}-DATA"/>
14+
<Database Name="${Namespace}-CODE" Dir="${mgrdir}${database}/code" Create="yes" Resource="%DB_${Namespace}-CODE"/>
1515
</Configuration>
16+
<CSPApplication Url="/csp/${app}" Directory="${cspdir}${app}" ServeFiles="1" Recurse="1" MatchRoles=":%DB_${Namespace}" AuthenticationMethods="32"
17+
/>
1618
</Namespace>
1719
</Manifest>
1820
}

README.md

+37-34
Original file line numberDiff line numberDiff line change
@@ -116,50 +116,53 @@ IRISAPP>zpm
116116
|| Welcome to the Package Manager Shell (ZPM). ||
117117
|| Enter q/quit to exit the shell. Enter ?/help to view available commands ||
118118
=============================================================================
119-
zpm:IRISAPP>load /irisrun/repo
120-
121-
[dc-sample-template] Reload START (/irisrun/repo/)
122-
[dc-sample-template] Reload SUCCESS
123-
[dc-sample-template] Module object refreshed.
124-
[dc-sample-template] Validate START
125-
[dc-sample-template] Validate SUCCESS
126-
[dc-sample-template] Compile START
127-
[dc-sample-template] Compile SUCCESS
128-
[dc-sample-template] Activate START
129-
[dc-sample-template] Configure START
130-
[dc-sample-template] Configure SUCCESS
131-
[dc-sample-template] MakeDeployed START
132-
[dc-sample-template] MakeDeployed SUCCESS
133-
[dc-sample-template] Activate SUCCESS
134-
zpm:IRISAPP>test dc-sample-template
135-
136-
[dc-sample-template] Reload START (/irisrun/repo/)
137-
[dc-sample-template] Reload SUCCESS
138-
[dc-sample-template] Module object refreshed.
139-
[dc-sample-template] Validate START
140-
[dc-sample-template] Validate SUCCESS
141-
[dc-sample-template] Compile START
142-
[dc-sample-template] Compile SUCCESS
143-
[dc-sample-template] Activate START
144-
[dc-sample-template] Configure START
145-
[dc-sample-template] Configure SUCCESS
146-
[dc-sample-template] MakeDeployed START
147-
[dc-sample-template] MakeDeployed SUCCESS
148-
[dc-sample-template] Activate SUCCESS
149-
[dc-sample-template] Test STARTIt works!
150-
119+
zpm:IRISAPP>load /home/irisowner/dev
120+
121+
[IRISAPP|dc-sample] Reload START (/home/irisowner/dev/)
122+
[IRISAPP|dc-sample] requirements.txt START
123+
[IRISAPP|dc-sample] requirements.txt SUCCESS
124+
[IRISAPP|dc-sample] Reload SUCCESS
125+
[dc-sample] Module object refreshed.
126+
[IRISAPP|dc-sample] Validate START
127+
[IRISAPP|dc-sample] Validate SUCCESS
128+
[IRISAPP|dc-sample] Compile START
129+
[IRISAPP|dc-sample] Compile SUCCESS
130+
[IRISAPP|dc-sample] Activate START
131+
[IRISAPP|dc-sample] Configure START
132+
[IRISAPP|dc-sample] Configure SUCCESS
133+
[IRISAPP|dc-sample] Activate SUCCESS
134+
zpm:IRISAPP>test dc-sample
135+
136+
[IRISAPP|dc-sample] Reload START (/home/irisowner/dev/)
137+
[IRISAPP|dc-sample] Reload SUCCESS
138+
[dc-sample] Module object refreshed.
139+
[IRISAPP|dc-sample] Validate START
140+
[IRISAPP|dc-sample] Validate SUCCESS
141+
[IRISAPP|dc-sample] Compile START
142+
[IRISAPP|dc-sample] Compile SUCCESS
143+
[IRISAPP|dc-sample] Activate START
144+
[IRISAPP|dc-sample] Configure START
145+
[IRISAPP|dc-sample] Configure SUCCESS
146+
[IRISAPP|dc-sample] Activate SUCCESS
147+
[IRISAPP|dc-sample] Test STARTHello World!
148+
This is InterSystems IRIS with version IRIS for UNIX (Ubuntu Server LTS for ARM64 Containers) 2023.2 (Build 221U) Fri Jul 21 2023 15:12:42 EDT
149+
Current time is: 16 Aug 2023 14:32:10
151150
Use the following URL to view the result:
152-
http://172.28.0.2:52773/csp/sys/%25UnitTest.Portal.Indices.cls?Index=1&$NAMESPACE=IRISAPP
151+
http://172.31.0.2:52773/csp/sys/%25UnitTest.Portal.Indices.cls?Index=2&$NAMESPACE=IRISAPP
153152
All PASSED
154153
155-
[dc-sample-template] Test SUCCESS
154+
[IRISAPP|dc-sample] Test SUCCESS
156155
zpm:IRISAPP>
157156
```
158157

159158
In case of test errors, you can find more details back in the UnitTest portal, which can be easily opened via ObjectScript menu in VSCode:
160159

161160
![vscvode unittest](https://user-images.githubusercontent.com/2781759/152678943-7d9d9696-e26a-449f-b1d7-f924528c8e3a.png)
162161

162+
If you have installed the [_InterSystems Testing Manager for VS Code_ extension](https://openexchange.intersystems.com/package/InterSystems-Testing-Manager-for-VS-Code)
163+
you can also run unit tests directly from VSCode :
164+
![vscvode unittest](https://raw.githubusercontent.com/intersystems-community/intersystems-testingmanager/main/images/README/Overview-Client.gif)
165+
163166
## What else is inside the repository
164167

165168
### .github folder

iris.script

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
do ##class(Security.Services).Modify("%Service_CallIn",.prop)
1313

1414
// create IRISAPP namespace
15-
do $SYSTEM.OBJ.Load("/home/irisowner/dev/Installer.cls", "ck")
15+
do $SYSTEM.OBJ.Load("/home/irisowner/dev/App.Installer.cls", "ck")
1616
set sc = ##class(App.Installer).setup()
1717

1818
zn "IRISAPP"

src/dc/sample/ObjectScript.cls

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ClassMethod Test() As %Status
66
set a=42
77
write "Hello World!",!
88
write "This is InterSystems IRIS with version ",$zv,!
9-
write "Current time is: "_$zdt($h,2)
9+
write "Current time is: "_$zdt($h,2),!
1010
return a
1111
}
1212

0 commit comments

Comments
 (0)