Skip to content

Commit cf91dc5

Browse files
author
Pablo Municio
committed
Feat(CMK-34190): MSI UTs
Change-Id: I2c613a8028f5f5dbdf0102cb59dae79cb77e388c
1 parent 9054fe0 commit cf91dc5

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

buildscripts/scripts/relay-msi.groovy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ void main() {
1313

1414
def windows = load("${checkout_dir}/buildscripts/scripts/utils/windows.groovy");
1515
def versioning = load("${checkout_dir}/buildscripts/scripts/utils/versioning.groovy");
16+
def test_jenkins_helper = load("${checkout_dir}/buildscripts/scripts/utils/test_helper.groovy");
1617

1718
def branch_name = versioning.safe_branch_name();
1819
def branch_version = versioning.get_branch_version(checkout_dir);
@@ -41,6 +42,23 @@ void main() {
4142
VERSION: cmk_version,
4243
);
4344
}
45+
46+
// Unit tests: validate the MSI we just built (structure + signature).
47+
// test-msi.ps1 gates via exit code AND emits a JUnit XML.
48+
try {
49+
windows.build(
50+
TARGET: 'relay_msi_test',
51+
REQUIRE_SIGNATURE: should_sign,
52+
);
53+
} finally {
54+
// Publish the JUnit XML
55+
archiveArtifacts(
56+
allowEmptyArchive: true,
57+
artifacts: "artefacts/relay_msi_test_results.xml",
58+
fingerprint: true,
59+
);
60+
test_jenkins_helper.analyse_issues("JUNIT", "artefacts/relay_msi_test_results.xml");
61+
}
4462
}
4563
}
4664

buildscripts/scripts/utils/windows.groovy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ void build(Map args) {
7979
"pwsh -File build-msi.ps1 -ProductVersion ${args.VERSION} -OutputDir ..\\..\\..\\..\\${artifacts_dir} -Sign",
8080
"CheckmkRelayInstaller.msi"] :
8181

82+
(args.TARGET == "relay_msi_test") ? [
83+
"non-free/packages/cmk-relay-engine/windows-installer",
84+
"pwsh -File test-msi.ps1" +
85+
" -MsiPath ..\\..\\..\\..\\${artifacts_dir}\\CheckmkRelayInstaller.msi" +
86+
" -ResultsDir ..\\..\\..\\..\\${artifacts_dir}" +
87+
((args.REQUIRE_SIGNATURE == true) ? " -RequireSignature" : ""),
88+
""] :
89+
8290
(args.TARGET == "test_integration") ? [
8391
"agents/wnx",
8492
"call run_tests.cmd --component --integration",

0 commit comments

Comments
 (0)