1
- <?xml version =" 1.0" encoding =" UTF-8" ?>
2
- <Export generator =" Cache" version =" 25" >
3
- <Class name =" isc.git.GitLab" >
4
- <TimeCreated >64700,73518.498808</TimeCreated >
5
-
6
- <Method name =" getDir" >
7
- <ClassMethod >1</ClassMethod >
8
- <CodeMode >expression</CodeMode >
9
- <Implementation ><![CDATA[ ##class(%File).NormalizeDirectory($system.Util.GetEnviron("CI_PROJECT_DIR"))
10
- ]]> </Implementation >
11
- </Method >
12
-
13
- <Method name =" getCommit" >
14
- <Description >
15
- For CI build - get current commit</Description >
16
- <ClassMethod >1</ClassMethod >
17
- <CodeMode >expression</CodeMode >
18
- <Implementation ><![CDATA[ $system.Util.GetEnviron("CI_COMMIT_SHA")
19
- ]]> </Implementation >
20
- </Method >
21
-
22
- <Method name =" load" >
23
- <Description >
24
- Do a full load
25
- do ##class(isc.git.GitLab).load()</Description >
26
- <ClassMethod >1</ClassMethod >
27
- <Implementation ><![CDATA[
1
+ Class isc .git .GitLab
2
+ {
3
+
4
+ ClassMethod getDir () [ CodeMode = expression ]
5
+ {
6
+ ##class (%File ).NormalizeDirectory ($system .Util .GetEnviron (" CI_PROJECT_DIR" ))
7
+ }
8
+
9
+ /// For CI build - get current commit
10
+ ClassMethod getCommit () [ CodeMode = expression ]
11
+ {
12
+ $system .Util .GetEnviron (" CI_COMMIT_SHA" )
13
+ }
14
+
15
+ /// Do a full load
16
+ /// do ##class(isc.git.GitLab).load()
17
+ ClassMethod load ()
18
+ {
28
19
try {
29
20
set dir = ..getDir ()
30
21
do ..log (" Importing dir " _ dir )
@@ -40,15 +31,12 @@ do ##class(isc.git.GitLab).load()</Description>
40
31
write !,$System .Status .GetErrorText (ex .AsStatus ()),!
41
32
do $system .Process .Terminate (, 1 )
42
33
}
43
- ]]> </Implementation >
44
- </Method >
34
+ }
45
35
46
- <Method name =" loadDiff" >
47
- <Description >
48
- Do a diff load
49
- do ##class(isc.git.GitLab).loadDiff()</Description >
50
- <ClassMethod >1</ClassMethod >
51
- <Implementation ><![CDATA[
36
+ /// Do a diff load
37
+ /// do ##class(isc.git.GitLab).loadDiff()
38
+ ClassMethod loadDiff ()
39
+ {
52
40
try {
53
41
#dim sc ,sc1 As %Status = $$$OK
54
42
set oldCommit = ##class (isc.git.Settings ).getSetting (" commit" )
@@ -98,27 +86,22 @@ do ##class(isc.git.GitLab).loadDiff()</Description>
98
86
do ..logException (ex )
99
87
do $system .Process .Terminate (, 1 )
100
88
}
101
- ]]> </Implementation >
102
- </Method >
89
+ }
103
90
104
- <Method name =" init" >
105
- <ClassMethod >1</ClassMethod >
106
- <Implementation ><![CDATA[
91
+ ClassMethod init ()
92
+ {
107
93
set init = ##class (isc.git.Settings ).getSetting (" init" )
108
94
if (init '=" " ) {
109
95
do ..log (" Running init code: " _ init )
110
96
do $classmethod ($p (init , " :" ), $p (init , " :" , 2 ))
111
97
} else {
112
98
do ..log (" No init code" )
113
99
}
114
- ]]> </Implementation >
115
- </Method >
100
+ }
116
101
117
- <Method name =" test" >
118
- <Description >
119
- do ##class(isc.git.GitLab).test()</Description >
120
- <ClassMethod >1</ClassMethod >
121
- <Implementation ><![CDATA[
102
+ /// do ##class(isc.git.GitLab).test()
103
+ ClassMethod test ()
104
+ {
122
105
try {
123
106
set tests = ##class (isc.git.Settings ).getSetting (" tests" )
124
107
if (tests '=" " ) {
@@ -134,14 +117,11 @@ do ##class(isc.git.GitLab).test()</Description>
134
117
do ..logException (ex )
135
118
do $system .Process .Terminate (, 1 )
136
119
}
137
- ]]> </Implementation >
138
- </Method >
120
+ }
139
121
140
- <Method name =" package" >
141
- <Description >
142
- do ##class(GitLab.Main).package()</Description >
143
- <ClassMethod >1</ClassMethod >
144
- <Implementation ><![CDATA[
122
+ /// do ##class(GitLab.Main).package()
123
+ ClassMethod package ()
124
+ {
145
125
try {
146
126
set dir = ..getDir ()
147
127
// TODO
@@ -152,12 +132,10 @@ do ##class(GitLab.Main).package()</Description>
152
132
do ..logException (ex )
153
133
do $system .Process .Terminate (, 1 )
154
134
}
155
- ]]> </Implementation >
156
- </Method >
135
+ }
157
136
158
- <Method name =" writeTestHTML" >
159
- <ClassMethod >1</ClassMethod >
160
- <Implementation ><![CDATA[
137
+ ClassMethod writeTestHTML ()
138
+ {
161
139
set text = ##class (%Dictionary.XDataDefinition ).IDKEYOpen ($classname (), " html" ).Data .Read ()
162
140
set text = $replace (text , " !!!" , ..getURL ())
163
141
@@ -166,49 +144,38 @@ do ##class(GitLab.Main).package()</Description>
166
144
do file .LinkToFile (name )
167
145
do file .Write (text )
168
146
quit file .%Save ()
169
- ]]> </Implementation >
170
- </Method >
147
+ }
171
148
172
- <Method name =" getURL" >
173
- <ClassMethod >1</ClassMethod >
174
- <Implementation ><![CDATA[
149
+ ClassMethod getURL ()
150
+ {
175
151
set url = ##class (isc.git.Settings ).getSetting (" url" )
176
152
set url = url _ $system .CSP .GetDefaultApp (" %SYS" )
177
153
set url = url _" /%25UnitTest.Portal.Indices.cls?Index=" _ $g (^UnitTest .Result , 1 ) _ " &$NAMESPACE=" _ $zconvert ($namespace ," O" ," URL" )
178
154
quit url
179
- ]]> </Implementation >
180
- </Method >
155
+ }
181
156
182
- <Method name =" getExtWildcard" >
183
- <Description >
184
- Get extensions as wildcard for import</Description >
185
- <ClassMethod >1</ClassMethod >
186
- <ReturnType >%String</ReturnType >
187
- <Implementation ><![CDATA[
157
+ /// Get extensions as wildcard for import
158
+ ClassMethod getExtWildcard () As %String
159
+ {
188
160
set extList = ##class (isc.git.Settings ).getSetting (" ext" )
189
161
set ext = " *." _ $lts (##class (isc.git.Settings ).getSetting (" ext" ), " ;*." )
190
162
quit ext
191
- ]]> </Implementation >
192
- </Method >
163
+ }
193
164
194
- <Method name =" isLastTestOk" >
195
- <Description >
196
- w ##class(GitLab.Main).isLastTestOk()</Description >
197
- <ClassMethod >1</ClassMethod >
198
- <ReturnType >%Boolean</ReturnType >
199
- <Implementation ><![CDATA[
165
+ /// w ##class(GitLab.Main).isLastTestOk()
166
+ ClassMethod isLastTestOk () As %Boolean
167
+ {
200
168
set in = ##class (%UnitTest.Result.TestInstance ).%OpenId (^UnitTest .Result )
201
169
for i =1 :1 :in .TestSuites .Count () {
202
170
#dim suite As %UnitTest.Result.TestSuite
203
171
set suite = in .TestSuites .GetAt (i )
204
172
return :suite .Status =0 $$$NO
205
173
}
206
174
quit $$$YES
207
- ]]> </Implementation >
208
- </Method >
175
+ }
209
176
210
- < XData name = " html" >
211
- < Data > <![CDATA[
177
+ XData html
178
+ {
212
179
<html lang =" en-US" >
213
180
<head >
214
181
<meta charset =" UTF-8" />
@@ -221,14 +188,10 @@ window.location.href = "!!!"
221
188
If you are not redirected automatically , follow this <a href ='!!!'>link to tests </a >.
222
189
</body >
223
190
</html >
224
- ]]> </Data >
225
- </XData >
191
+ }
226
192
227
- <Method name =" logVar" >
228
- <ClassMethod >1</ClassMethod >
229
- <FormalSpec >var="",name:%String=""</FormalSpec >
230
- <ReturnType >%String</ReturnType >
231
- <Implementation ><![CDATA[
193
+ ClassMethod logVar (var = " " , name As %String = " " ) As %String
194
+ {
232
195
do ..log (" Variable " _ name )
233
196
zw var
234
197
/*if $isObject(var) {
@@ -238,28 +201,22 @@ If you are not redirected automatically, follow this <a href='!!!'>link to tests
238
201
} else {
239
202
write var
240
203
}*/
241
- ]]> </Implementation >
242
- </Method >
204
+ }
205
+
206
+ ClassMethod logException (ex As %Exception .AbstractException )
207
+ {
208
+ do ..logStatus (ex .AsStatus ())
209
+ }
210
+
211
+ ClassMethod logStatus (sc As %Status )
212
+ {
213
+ do ..log ($System .Status .GetErrorText (sc ))
214
+ }
243
215
244
- <Method name =" logException" >
245
- <ClassMethod >1</ClassMethod >
246
- <FormalSpec >ex:%Exception.AbstractException</FormalSpec >
247
- <Implementation ><![CDATA[ do ..logStatus(ex.AsStatus())
248
- ]]> </Implementation >
249
- </Method >
216
+ ClassMethod log (msg As %String )
217
+ {
218
+ write !, $$$FormatText(" [%1] %2" , $zdatetime ($ztimestamp , 3 , 1 , 3 ), msg ), !
219
+ }
250
220
251
- <Method name =" logStatus" >
252
- <ClassMethod >1</ClassMethod >
253
- <FormalSpec >sc:%Status</FormalSpec >
254
- <Implementation ><![CDATA[ do ..log($System.Status.GetErrorText(sc))
255
- ]]> </Implementation >
256
- </Method >
221
+ }
257
222
258
- <Method name =" log" >
259
- <ClassMethod >1</ClassMethod >
260
- <FormalSpec >msg:%String</FormalSpec >
261
- <Implementation ><![CDATA[ write !, $$$FormatText("[%1] %2", $zdatetime($ztimestamp, 3, 1, 3), msg), !
262
- ]]> </Implementation >
263
- </Method >
264
- </Class >
265
- </Export >
0 commit comments