Skip to content

Commit 3262c19

Browse files
committed
fix: invalid oref error on ptd import
1 parent 1d4ec66 commit 3262c19

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

cls/SourceControl/Git/Production.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ ClassMethod ImportPTD(externalName As %String, productionName As %String, timeou
166166
lock +^Ens.DeploymentToken("SourceControl",$namespace):timeout
167167
if $test {
168168
set deploymentToken = ##class(Ens.Deployment.Token).%OpenId("DeployToken")
169-
if deploymentToken.InProgress {
169+
if $isobject(deploymentToken) && deploymentToken.InProgress {
170170
$$$ThrowOnError(##class(Ens.Deployment.Deploy).ClearDeploymentInProgressFlag())
171171
}
172172
set sc = ##class(Ens.Deployment.Deploy).DeployCode(externalName,productionName,0,rollbackFile)

test/UnitTest/SourceControl/Git/Util/Production.cls

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ Method TestLoadProductionsFromDirectory()
2121
set packageRoot = ##class(SourceControl.Git.PackageManagerContext).ForInternalName("git-source-control.zpm").Package.Root
2222
$$$ThrowOnError($System.OBJ.Load(packageRoot_"test/_resources/cls/UnitTest/SampleProduction.cls","ck"))
2323
// call LoadProductionsFromDirectory on a directory under resources/ptd
24-
do $$$AssertStatusOK(##class(SourceControl.Git.Util.Production).LoadProductionsFromDirectory(packageRoot_"test/_resources/ptd"))
24+
set st = ##class(SourceControl.Git.Util.Production).LoadProductionsFromDirectory(packageRoot_"test/_resources/ptd",.failedItems)
25+
if '$$$AssertStatusOK(st) {
26+
set key = $order(failedItems(""))
27+
while (key '= "") {
28+
do $$$LogMessage(key _ " failed to import")
29+
do $$$AssertStatusOK(failedItems(key))
30+
set key = $order(failedItems(key))
31+
}
32+
}
2533
// confirm items were deleted and added
2634
set itemA = ##class(Ens.Config.Production).OpenItemByConfigName("UnitTest.SampleProduction||a")
2735
do $$$AssertNotTrue($isobject(itemA),"item a was deleted")

0 commit comments

Comments
 (0)