cs-codex-dist-tests/ContinuousTests/K8sFactory.cs

33 lines
1.1 KiB
C#
Raw Normal View History

2023-06-28 13:11:20 +00:00
using DistTestCore.Codex;
using DistTestCore;
using Logging;
namespace ContinuousTests
{
public class K8sFactory
{
public TestLifecycle CreateTestLifecycle(string kubeConfigFile, string logPath, string dataFilePath, string customNamespace, ITimeSet timeSet, BaseLog log, TestRunnerLocation runnerLocation)
2023-06-28 13:11:20 +00:00
{
var kubeConfig = GetKubeConfig(kubeConfigFile);
2023-06-28 13:11:20 +00:00
var lifecycleConfig = new DistTestCore.Configuration
(
kubeConfigFile: kubeConfig,
logPath: logPath,
2023-06-28 13:11:20 +00:00
logDebug: false,
dataFilesPath: dataFilePath,
2023-06-28 13:11:20 +00:00
codexLogLevel: CodexLogLevel.Debug,
runnerLocation: runnerLocation,
k8sNamespacePrefix: customNamespace
2023-06-28 13:11:20 +00:00
);
return new TestLifecycle(log, lifecycleConfig, timeSet, "continuous-tests", string.Empty);
2023-06-28 13:11:20 +00:00
}
private static string? GetKubeConfig(string kubeConfigFile)
{
if (string.IsNullOrEmpty(kubeConfigFile) || kubeConfigFile.ToLowerInvariant() == "null") return null;
return kubeConfigFile;
}
}
}