Makes default run id static.
This commit is contained in:
parent
8caa7ab4fa
commit
dabf836838
|
@ -5,6 +5,14 @@ namespace DistTestCore
|
||||||
{
|
{
|
||||||
public static class NameUtils
|
public static class NameUtils
|
||||||
{
|
{
|
||||||
|
private static readonly string defaultRunId;
|
||||||
|
|
||||||
|
static NameUtils()
|
||||||
|
{
|
||||||
|
var now = DateTime.UtcNow;
|
||||||
|
defaultRunId = now.ToString("yyyyMMdd-hhmmss");
|
||||||
|
}
|
||||||
|
|
||||||
public static string GetTestMethodName(string name = "")
|
public static string GetTestMethodName(string name = "")
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(name)) return name;
|
if (!string.IsNullOrEmpty(name)) return name;
|
||||||
|
@ -42,9 +50,7 @@ namespace DistTestCore
|
||||||
|
|
||||||
public static string GetRunId()
|
public static string GetRunId()
|
||||||
{
|
{
|
||||||
var now = DateTime.UtcNow;
|
return GetEnvVar("RUNID", defaultRunId);
|
||||||
var defaultValue = now.ToString("yyyyMMdd-hhmmss");
|
|
||||||
return GetEnvVar("RUNID", defaultValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetEnvVar(string name, string defaultValue)
|
private static string GetEnvVar(string name, string defaultValue)
|
||||||
|
|
Loading…
Reference in New Issue