Disables calls to custom API endpoints.
This commit is contained in:
parent
bf18fa03a2
commit
45fbd699a9
|
@ -13,8 +13,9 @@ namespace CodexPlugin
|
|||
string GetName();
|
||||
CodexDebugResponse GetDebugInfo();
|
||||
CodexDebugPeerResponse GetDebugPeer(string peerId);
|
||||
CodexDebugBlockExchangeResponse GetDebugBlockExchange();
|
||||
CodexDebugRepoStoreResponse[] GetDebugRepoStore();
|
||||
// These debug methods are not available in master-line Codex. Use only for custom builds.
|
||||
//CodexDebugBlockExchangeResponse GetDebugBlockExchange();
|
||||
//CodexDebugRepoStoreResponse[] GetDebugRepoStore();
|
||||
ContentId UploadFile(TrackedFile file);
|
||||
TrackedFile? DownloadContent(ContentId contentId, string fileLabel = "");
|
||||
void ConnectToPeer(ICodexNode node);
|
||||
|
|
|
@ -57,8 +57,8 @@ namespace ContinuousTests.Tests
|
|||
|
||||
private void LogRepoStore(ICodexNode codexNode)
|
||||
{
|
||||
var response = codexNode.GetDebugRepoStore();
|
||||
Log.Log($"{codexNode.GetName()} has {string.Join(",", response.Select(r => r.cid))}");
|
||||
//var response = codexNode.GetDebugRepoStore();
|
||||
//Log.Log($"{codexNode.GetName()} has {string.Join(",", response.Select(r => r.cid))}");
|
||||
}
|
||||
|
||||
private void LogStoredBytes(ICodexNode node)
|
||||
|
@ -90,8 +90,8 @@ namespace ContinuousTests.Tests
|
|||
|
||||
private void LogBlockExchangeStatus(ICodexNode codexNode, string msg)
|
||||
{
|
||||
var response = codexNode.GetDebugBlockExchange();
|
||||
Log.Log($"{codexNode.GetName()} {msg}: {JsonConvert.SerializeObject(response)}");
|
||||
//var response = codexNode.GetDebugBlockExchange();
|
||||
//Log.Log($"{codexNode.GetName()} {msg}: {JsonConvert.SerializeObject(response)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,21 +42,22 @@ namespace CodexTests.BasicTests
|
|||
{
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
Time.Retry(() => AssertBlockExchangeIsEmpty(node), nameof(AssertExchangeIsEmpty));
|
||||
// API Call not available in master-line Codex image.
|
||||
//Time.Retry(() => AssertBlockExchangeIsEmpty(node), nameof(AssertExchangeIsEmpty));
|
||||
}
|
||||
}
|
||||
|
||||
private void AssertBlockExchangeIsEmpty(ICodexNode node)
|
||||
{
|
||||
var msg = $"BlockExchange for {node.GetName()}: ";
|
||||
var response = node.GetDebugBlockExchange();
|
||||
foreach (var peer in response.peers)
|
||||
{
|
||||
var activeWants = peer.wants.Where(w => !w.cancel).ToArray();
|
||||
Assert.That(activeWants.Length, Is.EqualTo(0), msg + "thinks a peer has active wants.");
|
||||
}
|
||||
Assert.That(response.taskQueue, Is.EqualTo(0), msg + "has tasks in queue.");
|
||||
Assert.That(response.pendingBlocks, Is.EqualTo(0), msg + "has pending blocks.");
|
||||
}
|
||||
//private void AssertBlockExchangeIsEmpty(ICodexNode node)
|
||||
//{
|
||||
// var msg = $"BlockExchange for {node.GetName()}: ";
|
||||
// var response = node.GetDebugBlockExchange();
|
||||
// foreach (var peer in response.peers)
|
||||
// {
|
||||
// var activeWants = peer.wants.Where(w => !w.cancel).ToArray();
|
||||
// Assert.That(activeWants.Length, Is.EqualTo(0), msg + "thinks a peer has active wants.");
|
||||
// }
|
||||
// Assert.That(response.taskQueue, Is.EqualTo(0), msg + "has tasks in queue.");
|
||||
// Assert.That(response.pendingBlocks, Is.EqualTo(0), msg + "has pending blocks.");
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue