diff --git a/source/Calamari.Tests/KubernetesFixtures/KubernetesContextScriptWrapperLiveFixtureEks.cs b/source/Calamari.Tests/KubernetesFixtures/KubernetesContextScriptWrapperLiveFixtureEks.cs index 8e94ef007..30a9bd773 100644 --- a/source/Calamari.Tests/KubernetesFixtures/KubernetesContextScriptWrapperLiveFixtureEks.cs +++ b/source/Calamari.Tests/KubernetesFixtures/KubernetesContextScriptWrapperLiveFixtureEks.cs @@ -121,87 +121,6 @@ protected override async Task> GetEnvironmentVars(Can }; } - /* - [Test] - public void DeployRawYaml_WithMultipleYamlFilesGlobPatterns_YamlFilesAppliedInCorrectBatches() - { - SetVariablesToAuthoriseWithAmazonAccount(); - - SetVariablesForKubernetesResourceStatusCheck(30); - - SetVariablesForRawYamlCommand($@"deployments/**/* - services/{ServiceFileName} - configmaps/*.yml"); - - string CreatePackageWithMultipleYamlFiles(string directory) - { - var packageToPackage = CreatePackageWithFiles(ResourcePackageFileName, directory, - ("deployments", DeploymentFileName, SimpleDeploymentResource), - (Path.Combine("deployments", "subfolder"), DeploymentFileName2, SimpleDeploymentResource2), - ("services", ServiceFileName, SimpleService), - ("services", "EmptyYamlFile.yml", ""), - ("configmaps", ConfigMapFileName, SimpleConfigMap), - ("configmaps", ConfigMapFileName2, SimpleConfigMap2), - (Path.Combine("configmaps","subfolder"), "InvalidJSONNotUsed.yml", InvalidDeploymentResource)); - return packageToPackage; - } - - ExecuteCommandAndVerifyResult(KubernetesApplyRawYamlCommand.Name, CreatePackageWithMultipleYamlFiles); - - var rawLogs = Log.Messages.Select(m => m.FormattedMessage).Where(l => !l.StartsWith("##octopus")).ToArray(); - - // We take the logs starting from when Calamari starts applying batches - // to when the last k8s resource is created and compare them in an assent test. - var startIndex = Array.FindIndex(rawLogs, l => l.StartsWith("Applying Batch #1")); - var endIndex = - Array.FindLastIndex(rawLogs, l => l == "Resource Status Check: 2 new resources have been added:") + 2; - var assentLogs = rawLogs.Skip(startIndex) - .Take(endIndex + 1 - startIndex) - .Where(l => !l.StartsWith("##octopus")).ToArray(); - var batch3Index = Array.FindIndex(assentLogs, l => l.StartsWith("Applying Batch #3")); - - // In this case the two config maps have been loaded in reverse order - // This can happen as Directory.EnumerateFiles() does not behave the - // same on all platforms. - // We'll flip them back the right way before performing the Assent Test. - if (assentLogs[batch3Index + 1].Contains("myapp-configmap1.yml")) - { - var configMap1Idx = batch3Index + 1; - var configMap2Idx = Array.FindIndex(assentLogs, l => l.Contains("myapp-configmap2.yml")); - var endIdx = Array.FindLastIndex(assentLogs, l => l == "Created Resources:") - 1; - InPlaceSwap(assentLogs, configMap1Idx, configMap2Idx, endIdx); - } - - // We need to replace the backslash with forward slash because - // the slash comes out differently on windows machines. - var assentString = string.Join('\n', assentLogs).Replace("\\", "/"); - this.Assent(assentString, configuration: AssentConfiguration.DefaultWithPostfix("ApplyingBatches")); - - var resources = new[] - { - (Name: SimpleDeploymentResourceName, Label: "Deployment1"), - (Name: SimpleDeployment2ResourceName,Label: "Deployment2"), - (Name: SimpleServiceResourceName, Label: "Service1"), - (Name: SimpleConfigMapResourceName, Label: "ConfigMap1"), - (Name: SimpleConfigMap2ResourceName, Label: "ConfigMap3") - }; - - var statusMessages = Log.Messages.GetServiceMessagesOfType("k8s-status"); - - foreach (var (name, label) in resources) - { - // Check that each resource was created and the appropriate setvariable service message was created. - var resource = AssertResourceCreatedAndGetJson(name); - this.Assent(resource, configuration: AssentConfiguration.DefaultWithPostfix(label)); - - // Check that each deployed resource has a "Successful" status reported. - statusMessages.Should().Contain(m => m.Properties["name"] == name && m.Properties["status"] == "Successful"); - } - - rawLogs.Should().ContainSingle(m => - m.Contains("Resource status check completed successfully because all resources are deployed successfully")); - }*/ - [Test] [TestCase(true)] [TestCase(false)]