Skip to content

Commit 3f8797d

Browse files
committed
test: update test case to include multiple env.json files
1 parent d24d8de commit 3f8797d

File tree

4 files changed

+33
-14
lines changed

4 files changed

+33
-14
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ Method TestEnv()
77
{
88
Set localRepoPath = ..GetModuleDir(..#TargetPath)
99
Set packageName = "install-time-config"
10-
Set envPath = ##class(%File).Construct($Get(^UnitTestRoot), "_data", ..#TargetPath, "env.json")
10+
Set envPath1 = ##class(%File).Construct($Get(^UnitTestRoot), "_data", ..#TargetPath, "env1.json")
11+
Set envPath2 = ##class(%File).Construct($Get(^UnitTestRoot), "_data", ..#TargetPath, "env2.json")
1112

1213
Set tSC = ##class(%IPM.Main).Shell("repo -fs -name local -path " _ localRepoPath)
1314
Do $$$AssertStatusOK(tSC, "Set up local repo successfully")
1415

1516
Do ##class(%IPM.Utils.Module).BeginCaptureOutput(.cookie)
1617
// If the env.json files is not properly read, the RunOnLoad() method generator in the package will throw an error, causing a `Compile` failure
17-
Set tSC = ##class(%IPM.Main).Shell($$$FormatText("install %1 -env %2", packageName, envPath))
18+
Set tSC = ##class(%IPM.Main).Shell($$$FormatText("install %1 -env %2;%3", packageName, envPath1, envPath2))
1819
Do ##class(%IPM.Utils.Module).EndCaptureOutput(cookie, .output)
1920
Do $$$AssertStatusOK(tSC, "Installed module with its dependency successfully")
2021
Do $$$AssertTrue(..FindStringInMultiDimArray("Successfully acquired magic value: 1234", .output))

tests/integration_tests/Test/PM/Integration/_data/install-time-config/env.json

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"install-time-config": {
3+
"nested": {
4+
"magic": 42
5+
},
6+
"non-relevant-data": "xyz"
7+
},
8+
"install-time-config-dependency": {
9+
"nested": {
10+
"magic": "missing",
11+
"non-relevant-data": "xyz"
12+
},
13+
"non-relevant-data": "xyz"
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"install-time-config": {
3+
"nested": {
4+
"non-relevant-data": "xyz"
5+
},
6+
"non-relevant-data": "xyz"
7+
},
8+
"install-time-config-dependency": {
9+
"nested": {
10+
"magic": 1234,
11+
"non-relevant-data": "xyz"
12+
},
13+
"non-relevant-data": "xyz"
14+
}
15+
}

0 commit comments

Comments
 (0)