Fixes issue where boolean arguments can't be set to false.

This commit is contained in:
benbierens 2023-10-04 09:19:45 +02:00
parent 6fe9d38eb3
commit 3f2c789dd5
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 4 additions and 3 deletions

View File

@ -233,7 +233,8 @@ namespace ArgsUniform
private static bool AssignBool(T result, PropertyInfo uniformProperty, object value) private static bool AssignBool(T result, PropertyInfo uniformProperty, object value)
{ {
if (value != null) var s = value.ToString();
if (s == "1" || s.ToLowerInvariant() == "true")
{ {
uniformProperty.SetValue(result, true); uniformProperty.SetValue(result, true);
} }

View File

@ -15,7 +15,7 @@ namespace ContinuousTests
[Uniform("codex-deployment", "c", "CODEXDEPLOYMENT", true, "Path to codex-deployment JSON file.")] [Uniform("codex-deployment", "c", "CODEXDEPLOYMENT", true, "Path to codex-deployment JSON file.")]
public string CodexDeploymentJson { get; set; } = string.Empty; public string CodexDeploymentJson { get; set; } = string.Empty;
[Uniform("keep", "k", "KEEP", false, "Set to '1' to retain logs of successful tests.")] [Uniform("keep", "k", "KEEP", false, "Set to 1 or 'true' to retain logs of successful tests.")]
public bool KeepPassedTestLogs { get; set; } = false; public bool KeepPassedTestLogs { get; set; } = false;
[Uniform("kube-config", "kc", "KUBECONFIG", true, "Path to Kubeconfig file. Use 'null' (default) to use local cluster.")] [Uniform("kube-config", "kc", "KUBECONFIG", true, "Path to Kubeconfig file. Use 'null' (default) to use local cluster.")]
@ -30,7 +30,7 @@ namespace ContinuousTests
[Uniform("filter", "f", "FILTER", false, "If set, runs only tests whose names contain any of the filter strings. Comma-separated. Case sensitive.")] [Uniform("filter", "f", "FILTER", false, "If set, runs only tests whose names contain any of the filter strings. Comma-separated. Case sensitive.")]
public string Filter { get; set; } = string.Empty; public string Filter { get; set; } = string.Empty;
[Uniform("cleanup", "cl", "CLEANUP", false, "If set, the kubernetes namespace will be deleted after the test run has finished.")] [Uniform("cleanup", "cl", "CLEANUP", false, "If set to 1 or 'true', the kubernetes namespace will be deleted after the test run has finished.")]
public bool Cleanup { get; set; } = false; public bool Cleanup { get; set; } = false;
public CodexDeployment CodexDeployment { get; set; } = null!; public CodexDeployment CodexDeployment { get; set; } = null!;