Skip to content

Commit 7367568

Browse files
James LechtnerJames Lechtner
authored andcommitted
Adding publishing test to ProcessPythonWheel suite
1 parent bba5e5d commit 7367568

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed

tests/integration_tests/Test/PM/Integration/ProcessPythonWheel.cls

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Parameter PackageWithPythonDepsLocation = "package-with-python-deps";
1515

1616
Parameter ExportPackageWithPythonDepsLocation = "export-package-with-python-deps";
1717

18+
Parameter PublishWithPythonDepsLocation = "publish-with-python-deps";
19+
1820
/// The PythonWheel resource processor expects to install wheels from the dist directory, as opposed to source code
1921
ClassMethod GenerateWheel()
2022
{
@@ -199,4 +201,45 @@ Method TestPackageWithPythonDeps() As %Status
199201
do $$$AssertStatusOK(sc, "Deleted local filesystem repo")
200202
}
201203

204+
/// Test publishing with the -export-python-deps flag
205+
Method TestPublishWithPythonDeps() As %Status
206+
{
207+
set moduleName = "publish-with-python-deps"
208+
209+
// Create a filesystem repository
210+
set dir = ..GetModuleDir("python-deps-tests", ..#PublishWithPythonDepsLocation)
211+
set sc = ##class(%IPM.Main).Shell("repo -fs -name localrepo -path "_dir)
212+
do $$$AssertStatusOK(sc, "Configured local filesystem repo")
213+
214+
// Install module from local filesystem repo
215+
set sc = ##class(%IPM.Main).Shell("install -v localrepo/"_moduleName)
216+
do $$$AssertStatusOK(sc, "Installed module from local filesystem repo")
217+
218+
// Create a remote repository for publishing
219+
set sc = ##class(%IPM.Main).Shell("repo -r -name remote -url http://registry:52773/registry -username admin -password SYS")
220+
do $$$AssertStatusOK(sc, "Configured remote repo")
221+
222+
// Publish module to remote repository
223+
set sc = ##class(%IPM.Main).Shell("publish -v "_moduleName_" -r remote -export-python-deps")
224+
do $$$AssertStatusOK(sc, "Published module "_moduleName_" to remote repository")
225+
226+
// Uninstall module that came from filesystem repository
227+
set sc = ##class(%IPM.Main).Shell("uninstall "_moduleName)
228+
do $$$AssertStatusOK(sc, "Uninstalled module successfully")
229+
230+
// Install published module from remote repository
231+
set sc = ##class(%IPM.Main).Shell("install -v remote/"_moduleName)
232+
do $$$AssertStatusOK(sc, "Successfully installed published module "_moduleName_" from remote repository")
233+
234+
// Uninstall the module used for this test
235+
set sc = ##class(%IPM.Main).Shell("uninstall "_moduleName)
236+
do $$$AssertStatusOK(sc, "Uninstalled module "_moduleName_" successfully")
237+
238+
// Remove the repositories used for this test
239+
set sc = ##class(%IPM.Main).Shell("repo -delete -n localrepo")
240+
do $$$AssertStatusOK(sc, "Removed local filesystem repo")
241+
set sc = ##class(%IPM.Main).Shell("repo -delete -n remote")
242+
do $$$AssertStatusOK(sc, "Removed remote repo")
243+
}
244+
202245
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Export generator="IRIS" version="26">
3+
<Document name="publish-with-python-deps.ZPM">
4+
<Module>
5+
<Name>publish-with-python-deps</Name>
6+
<Version>1.6.2</Version>
7+
<Packaging>module</Packaging>
8+
<PythonWheel Name="lune-1.6.2-py3-none-any.whl" Directory="." />
9+
<PythonWheel Name="lune-1.6.4-py3-none-any.whl" Directory="wheels" />
10+
</Module>
11+
</Document>
12+
</Export>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lune==1.6.4

0 commit comments

Comments
 (0)