Adds better check for successful deployment of codex contracts
This commit is contained in:
parent
b590e24de8
commit
99c9b25487
|
@ -5,7 +5,6 @@ namespace DistTestCore.Marketplace
|
|||
{
|
||||
public class CodexContractsStarter : BaseStarter
|
||||
{
|
||||
private const string readyString = "Done! Sleeping indefinitely...";
|
||||
|
||||
public CodexContractsStarter(TestLifecycle lifecycle, WorkflowCreator workflowCreator)
|
||||
: base(lifecycle, workflowCreator)
|
||||
|
@ -25,7 +24,7 @@ namespace DistTestCore.Marketplace
|
|||
|
||||
WaitUntil(() =>
|
||||
{
|
||||
var logHandler = new ContractsReadyLogHandler(readyString);
|
||||
var logHandler = new ContractsReadyLogHandler();
|
||||
workflow.DownloadContainerLog(container, logHandler);
|
||||
return logHandler.Found;
|
||||
});
|
||||
|
@ -73,18 +72,19 @@ namespace DistTestCore.Marketplace
|
|||
|
||||
public class ContractsReadyLogHandler : LogHandler
|
||||
{
|
||||
private readonly string targetString;
|
||||
|
||||
public ContractsReadyLogHandler(string targetString)
|
||||
{
|
||||
this.targetString = targetString;
|
||||
}
|
||||
// Log should contain 'Compiled 15 Solidity files successfully' at some point.
|
||||
private const string RequiredCompiledString = "Solidity files successfully";
|
||||
// When script is done, it prints the ready-string.
|
||||
private const string ReadyString = "Done! Sleeping indefinitely...";
|
||||
|
||||
public bool SeenCompileString { get; private set; }
|
||||
public bool Found { get; private set; }
|
||||
|
||||
protected override void ProcessLine(string line)
|
||||
{
|
||||
if (line.Contains(targetString)) Found = true;
|
||||
if (line.Contains(RequiredCompiledString)) SeenCompileString = true;
|
||||
|
||||
if (SeenCompileString && line.Contains(ReadyString)) Found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ namespace KubernetesWorkflow
|
|||
client = new K8sClient(cluster.GetK8sClientConfig());
|
||||
|
||||
K8sTestNamespace = cluster.Configuration.K8sNamespacePrefix + testNamespace;
|
||||
log.Debug($"Test namespace: '{K8sTestNamespace}'");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
|
Loading…
Reference in New Issue