public void ApplyToTest(NUnit.Framework.Internal.Test test) { var expectedVersion = GetExpectedServerVersion(); if (!TestClusterManager.IsDse && IsDseRequired()) { test.RunState = RunState.Ignored; var message = string.Format("Test designed to run with DSE {0} v{1} (executing OSS {2})", TestDseVersion.GetComparisonText(Comparison), expectedVersion, TestClusterManager.CassandraVersion); test.Properties.Set("_SKIPREASON", message); return; } var executingVersion = TestClusterManager.IsDse ? TestClusterManager.DseVersion : TestClusterManager.CassandraVersion; if (!TestDseVersion.VersionMatch(expectedVersion, executingVersion, Comparison)) { test.RunState = RunState.Ignored; var message = string.Format("Test designed to run with DSE {0} v{1} (executing {2})", TestDseVersion.GetComparisonText(Comparison), expectedVersion, executingVersion); test.Properties.Set("_SKIPREASON", message); } }
public void ApplyToTest(NUnit.Framework.Internal.Test test) { if (TestHelper.IsWin) { test.RunState = RunState.Ignored; test.Properties.Set("_SKIPREASON", "Test designed not to run with Windows"); } }
public void ApplyToTest(NUnit.Framework.Internal.Test test) { if (Supported != CloudSupported()) { test.RunState = RunState.Ignored; test.Properties.Set("_SKIPREASON", $"Test designed to run with CloudSupport = {Supported} but it isn't the case."); } }
public void ApplyToTest(NUnit.Framework.Internal.Test test) { if (!SniEnabledOnlyAttribute.IsSniEnabled()) { test.RunState = RunState.Ignored; test.Properties.Set("_SKIPREASON", "Test designed to run with SNI Enabled environments (SNI_ENABLED env variable must be set to TRUE)"); } }
public void ApplyToTest(NUnit.Framework.Internal.Test test) { var envVariable = Environment.GetEnvironmentVariable("SNI_ENABLED"); if (envVariable == null || !envVariable.Equals("true", StringComparison.OrdinalIgnoreCase)) { test.RunState = RunState.Ignored; test.Properties.Set("_SKIPREASON", "Test designed to run with SNI Enabled environments (SNI_ENABLED env variable must be set to TRUE)"); } }
public void ApplyToTest(NUnit.Framework.Internal.Test test) { if (!TestHelper.IsWin) { test.RunState = RunState.Ignored; test.Properties.Set("_SKIPREASON", "Test designed to run with Windows"); return; } if (Major > 0) { // Get windows version without using APIs not supported in .NET Core Version winVersion = null; using (var ver = new Process { StartInfo = new ProcessStartInfo { FileName = "cmd.exe", Arguments = "/c ver", UseShellExecute = false, RedirectStandardOutput = true, CreateNoWindow = true } }) { ver.Start(); var verOutput = ver.StandardOutput.ReadToEnd(); var match = VersionRegex.Match(verOutput); if (match.Success) { winVersion = new Version(Convert.ToInt32(match.Groups[1].Value), Convert.ToInt32(match.Groups[2].Value)); } ver.WaitForExit(); } string message = null; if (winVersion == null) { message = string.Format("Test designed to run with Windows version {0}.{1} or above but " + "current version could not be retrieved", Major, Minor); } if (winVersion < new Version(Major, Minor)) { test.RunState = RunState.Ignored; message = string.Format("Test designed to run with Windows version {0}.{1} or above (running {2})", Major, Minor, winVersion); } if (message != null) { test.Properties.Set("_SKIPREASON", message); test.RunState = RunState.Ignored; } } }
public void ApplyToTest(NUnit.Framework.Internal.Test test) { var expectedVersion = GetExpectedServerVersion(); if (!TestDseVersion.VersionMatch(expectedVersion, IsDseRequired(), IsOssRequired, Comparison, out var msg)) { test.RunState = RunState.Ignored; var message = msg; test.Properties.Set("_SKIPREASON", message); } }
public void ApplyToTest(NUnit.Framework.Internal.Test test) { var executingVersion = TestClusterManager.DseVersion; var expectedVersion = GetExpectedDseVersion(); if (!VersionMatch(expectedVersion, executingVersion, Comparison)) { test.RunState = RunState.Ignored; var message = string.Format("Test designed to run with DSE {0} v{1} (executing {2})", GetComparisonText(Comparison), expectedVersion, executingVersion); test.Properties.Set("_SKIPREASON", message); } }
public void ApplyToTest(NUnit.Framework.Internal.Test test) { if (!TestClusterManager.IsDse) { test.RunState = RunState.Ignored; test.Properties.Set("_SKIPREASON", $"Test designed to run with DSE version that supports Insights (executing OSS {TestClusterManager.CassandraVersion})"); return; } var executingVersion = TestClusterManager.DseVersion; var insightsSupportVerifier = new InsightsSupportVerifier(); if (insightsSupportVerifier.DseVersionSupportsInsights(executingVersion)) { return; } test.RunState = RunState.Ignored; var message = $"Test designed to run with DSE version that supports Insights (executing {executingVersion})"; test.Properties.Set("_SKIPREASON", message); }
private NUnit.Framework.Internal.TestMethod BuildTestMethod( NUnit.Framework.Internal.Test parentSuite, TestCaseInformation testCase) { var testMethod = new TestMethod( executeMethod, parentSuite, testCase.Method.DeclaringType.FullName, testCase.Method.Name) { Seed = _randomizer.Next() }; var parms = new NUnit.Framework.Internal.TestCaseParameters(new object[] { testCase }); //CheckTestMethodAttributes(testMethod); // DIRTY: NUnit's NUnitTestCaseBuilder class does collusion with the TestMethod class sharing internal field for the 'parms'. // It private method sets the parms. //CheckTestMethodSignature(testMethod, parms); var t = typeof(NUnit.Framework.Internal.TestMethod); var f = t.GetField("parms", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly); f.SetValue(testMethod, parms); parms.ApplyToTest(testMethod); var name = string.Format( "{0}({1})", testCase.Name, string.Join(",", testCase.Arguments.Select(Utilities.GetCSharpLanguageExpression))); testMethod.Name = name; testMethod.FullName = string.Format( "{0}.{1}.{2}", testCase.CategoryName, testCase.Id, name); return(testMethod); }