diff --git a/DistTestCore/BaseStarter.cs b/DistTestCore/BaseStarter.cs index eb34449..83a6b8d 100644 --- a/DistTestCore/BaseStarter.cs +++ b/DistTestCore/BaseStarter.cs @@ -32,6 +32,11 @@ namespace DistTestCore lifecycle.Log.Log($"{GetClassName()} {msg}"); } + protected void Debug(string msg) + { + lifecycle.Log.Debug($"{GetClassName()} {msg}", 1); + } + private string GetClassName() { return $"({GetType().Name})"; diff --git a/DistTestCore/Marketplace/CodexContractsStarter.cs b/DistTestCore/Marketplace/CodexContractsStarter.cs index 0f65635..68d64fe 100644 --- a/DistTestCore/Marketplace/CodexContractsStarter.cs +++ b/DistTestCore/Marketplace/CodexContractsStarter.cs @@ -24,7 +24,7 @@ namespace DistTestCore.Marketplace WaitUntil(() => { - var logHandler = new ContractsReadyLogHandler(); + var logHandler = new ContractsReadyLogHandler(Debug); workflow.DownloadContainerLog(container, logHandler); return logHandler.Found; }); @@ -76,12 +76,20 @@ namespace DistTestCore.Marketplace private const string RequiredCompiledString = "Solidity files successfully"; // When script is done, it prints the ready-string. private const string ReadyString = "Done! Sleeping indefinitely..."; + private readonly Action debug; + + public ContractsReadyLogHandler(Action debug) + { + this.debug = debug; + debug($"Looking for '{RequiredCompiledString}' and '{ReadyString}' in container logs..."); + } public bool SeenCompileString { get; private set; } public bool Found { get; private set; } protected override void ProcessLine(string line) { + debug(line); if (line.Contains(RequiredCompiledString)) SeenCompileString = true; if (SeenCompileString && line.Contains(ReadyString)) Found = true; diff --git a/DistTestCore/Marketplace/ContainerInfoExtractor.cs b/DistTestCore/Marketplace/ContainerInfoExtractor.cs index ba1fd9f..7fd5638 100644 --- a/DistTestCore/Marketplace/ContainerInfoExtractor.cs +++ b/DistTestCore/Marketplace/ContainerInfoExtractor.cs @@ -79,7 +79,7 @@ namespace DistTestCore.Marketplace private string FetchPubKey() { - var enodeFinder = new PubKeyFinder(); + var enodeFinder = new PubKeyFinder(s => log.Debug(s)); workflow.DownloadContainerLog(container, enodeFinder); return enodeFinder.GetPubKey(); } @@ -103,8 +103,15 @@ namespace DistTestCore.Marketplace { private const string openTag = "self=enode://"; private const string openTagQuote = "self=\"enode://"; + private readonly Action debug; private string pubKey = string.Empty; + public PubKeyFinder(Action debug) + { + this.debug = debug; + debug($"Looking for '{openTag}' in container logs..."); + } + public string GetPubKey() { if (string.IsNullOrEmpty(pubKey)) throw new Exception("Not found yet exception."); @@ -113,6 +120,7 @@ namespace DistTestCore.Marketplace protected override void ProcessLine(string line) { + debug(line); if (line.Contains(openTag)) { ExtractPubKey(openTag, line);