From f02a2e689827f70f913fb29d55a6d63e682be048 Mon Sep 17 00:00:00 2001 From: TheCakeIsNaOH Date: Sat, 13 Nov 2021 16:53:53 -0600 Subject: [PATCH 1/2] (#2450) Enable functions on non-Windows systems This runs configTransformService and capture_package_files on non-Windows platforms. Both appear to be fully functional, so there is no reason not to run them. They were added to non-Windows side of the if/else instead of being moved from the Windows side so as to not screw up the functionality of create_ignore_files_for_executables. --- .../infrastructure.app/services/ChocolateyPackageService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs index 771107ec09..d393d7c90f 100644 --- a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs +++ b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs @@ -386,7 +386,6 @@ public virtual void handle_package_result(PackageResult packageResult, Chocolate _filesService.ensure_compatible_file_attributes(packageResult, config); _configTransformService.run(packageResult, config); - //review: is this a Windows only kind of thing? pkgInfo.FilesSnapshot = _filesService.capture_package_files(packageResult, config); var is32Bit = !config.Information.Is64BitProcess || config.ForceX86; @@ -397,6 +396,11 @@ public virtual void handle_package_result(PackageResult packageResult, Chocolate else { if (config.Information.PlatformType != PlatformType.Windows) this.Log().Info(ChocolateyLoggers.Important, () => " Skipping PowerShell and shimgen portions of the install due to non-Windows."); + if (packageResult.Success) + { + _configTransformService.run(packageResult, config); + pkgInfo.FilesSnapshot = _filesService.capture_package_files(packageResult, config); + } } if (packageResult.Success) From a256c27b142d8818748711ae8e33056ec6b270c3 Mon Sep 17 00:00:00 2001 From: TheCakeIsNaOH Date: Sat, 13 Nov 2021 16:56:17 -0600 Subject: [PATCH 2/2] (#2450) Enable configTransform tests on non-Windows Re-enables the integration tests that validate the config transform service on non-Windows platforms. These can be enabled now that the config transform service runs on non-Windows platforms. --- .../scenarios/InstallScenarios.cs | 2 -- .../scenarios/UpgradeScenarios.cs | 4 ---- 2 files changed, 6 deletions(-) diff --git a/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs b/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs index 326e0db85b..1dc0713235 100644 --- a/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs @@ -3298,8 +3298,6 @@ public void should_have_a_version_of_one_dot_zero_dot_zero() } [Concern(typeof(ChocolateyInstallCommand))] - [WindowsOnly] - [Platform(Exclude = "Mono")] public class when_installing_a_package_with_config_transforms : ScenariosBase { private PackageResult packageResult; diff --git a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs index e70fdf071a..aab36ed8f4 100644 --- a/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs @@ -2818,8 +2818,6 @@ public void should_not_have_warning_package_result() } [Concern(typeof(ChocolateyUpgradeCommand))] - [WindowsOnly] - [Platform(Exclude = "Mono")] public class when_upgrading_a_package_with_config_transforms : ScenariosBase { private PackageResult _packageResult; @@ -2916,8 +2914,6 @@ public void should_add_the_insertNew_value_in_the_config_due_to_XDT_InsertIfMiss } [Concern(typeof(ChocolateyUpgradeCommand))] - [WindowsOnly] - [Platform(Exclude = "Mono")] public class when_upgrading_a_package_with_config_transforms_when_config_was_edited : ScenariosBase { private PackageResult _packageResult;