From ab8a5b41b805b46cd96e53904ce473beb99fbb13 Mon Sep 17 00:00:00 2001 From: Shuheng Liu Date: Fri, 10 Jan 2025 13:40:23 -0500 Subject: [PATCH] test: add test cases for oras tag conversion --- .../Test/PM/Integration/OrasTag.cls | 35 +++++++++++++++++++ .../PM/Integration/_data/oras-tag/module.xml | 12 +++++++ .../_data/oras-tag/src/OrasTag/Main.cls | 9 +++++ 3 files changed, 56 insertions(+) create mode 100644 tests/integration_tests/Test/PM/Integration/OrasTag.cls create mode 100644 tests/integration_tests/Test/PM/Integration/_data/oras-tag/module.xml create mode 100644 tests/integration_tests/Test/PM/Integration/_data/oras-tag/src/OrasTag/Main.cls diff --git a/tests/integration_tests/Test/PM/Integration/OrasTag.cls b/tests/integration_tests/Test/PM/Integration/OrasTag.cls new file mode 100644 index 00000000..fef9f10a --- /dev/null +++ b/tests/integration_tests/Test/PM/Integration/OrasTag.cls @@ -0,0 +1,35 @@ +Class Test.PM.Integration.OrasTag Extends Test.PM.Integration.Base +{ + +Parameter TargetModuleName As STRING = "oras-tag"; + +Method TestOrasTagConversion() +{ + Set tModuleDir = ..GetModuleDir(..#TargetModuleName) + + Set tSC = ##class(%IPM.Main).Shell("load -verbose " _ tModuleDir) + Do $$$AssertStatusOK(tSC,"Loaded module successfully") + + Set tSC = ##class(%IPM.Main).Shell("repo -delete-all") + Do $$$AssertStatusOK(tSC,"Deleted repos successfully") + + Set tSC = ##class(%IPM.Main).Shell("repo -o -name oras -url http://oras:5000 -publish 1") + Do $$$AssertStatusOK(tSC,"Set up oras module successfully") + + Set tSC = ##class(%IPM.Main).Shell("publish oras-tag -r oras -verbose") + Do $$$AssertStatusOK(tSC,"Published module successfully") + + Set tSC = ##class(%IPM.Main).Shell("uninstall oras-tag") + Do $$$AssertStatusOK(tSC,"Uninstalled module successfully") + + Set tSC = ##class(%IPM.Main).Shell("install oras-tag") + Do $$$AssertStatusOK(tSC,"Installed module from ORAS registry successfully") + + Set tSC = ##class(%IPM.Main).Shell("repo -delete-all") + Do $$$AssertStatusOK(tSC,"Deleted repos successfully") + + Set tSC = ##class(%IPM.Main).Shell("repo -reset-defaults") + Do $$$AssertStatusOK(tSC,"Reset repos to default successfully") +} + +} diff --git a/tests/integration_tests/Test/PM/Integration/_data/oras-tag/module.xml b/tests/integration_tests/Test/PM/Integration/_data/oras-tag/module.xml new file mode 100644 index 00000000..70b33d08 --- /dev/null +++ b/tests/integration_tests/Test/PM/Integration/_data/oras-tag/module.xml @@ -0,0 +1,12 @@ + + + + + oras-tag + 0.0.1-beta.1+build + module + src + + + + \ No newline at end of file diff --git a/tests/integration_tests/Test/PM/Integration/_data/oras-tag/src/OrasTag/Main.cls b/tests/integration_tests/Test/PM/Integration/_data/oras-tag/src/OrasTag/Main.cls new file mode 100644 index 00000000..a8080da3 --- /dev/null +++ b/tests/integration_tests/Test/PM/Integration/_data/oras-tag/src/OrasTag/Main.cls @@ -0,0 +1,9 @@ +Class OrasTag.Main +{ + +ClassMethod Main() +{ + Write "This is OrasTag.main" +} + +}