Fixes incorrect call to node interaction from gethCompantionNodeStarter

This commit is contained in:
benbierens 2023-06-01 15:56:26 +02:00
parent 56c716a4ea
commit 44e237e60e
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
3 changed files with 11 additions and 8 deletions

View File

@ -1,5 +1,4 @@
using KubernetesWorkflow;
using Logging;
using NethereumWorkflow;
namespace DistTestCore.Marketplace
@ -15,13 +14,12 @@ namespace DistTestCore.Marketplace
public RunningContainer RunningContainer { get; }
public GethAccount[] Accounts { get; }
public NethereumInteraction StartInteraction(BaseLog log, GethAccount account)
public NethereumInteraction StartInteraction(TestLifecycle lifecycle, GethAccount account)
{
var ip = RunningContainer.Pod.Cluster.HostAddress;
var port = RunningContainer.ServicePorts[0].Number;
var address = lifecycle.Configuration.GetAddress(RunningContainer);
var privateKey = account.PrivateKey;
var creator = new NethereumInteractionCreator(log, ip, port, privateKey);
var creator = new NethereumInteractionCreator(lifecycle.Log, address.Host, address.Port, privateKey);
return creator.CreateWorkflow();
}
}

View File

@ -50,7 +50,7 @@ namespace DistTestCore.Marketplace
{
Time.WaitUntil(() =>
{
var interaction = node.StartInteraction(lifecycle.Log, node.Accounts.First());
var interaction = node.StartInteraction(lifecycle, node.Accounts.First());
return interaction.IsSynced(marketplace.Marketplace.Address, marketplace.Marketplace.Abi);
}, TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(3));
}

View File

@ -59,10 +59,15 @@ namespace KubernetesWorkflow
public string ExecuteCommand(RunningPod pod, string containerName, string command, params string[] args)
{
log.Debug($"{containerName}: {command} ({string.Join(",", args)})");
var cmdAndArgs = $"{containerName}: {command} ({string.Join(",", args)})";
log.Debug(cmdAndArgs);
var runner = new CommandRunner(client, K8sTestNamespace, pod, containerName, command, args);
runner.Run();
return runner.GetStdOut();
var result = runner.GetStdOut();
log.Debug($"{cmdAndArgs} = '{result}'");
return result;
}
public void DeleteAllResources()