-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove gRPC objects from IAgent #594
Conversation
aneojgurhem
commented
Jan 22, 2024
•
edited
Loading
edited
- refactor: remove gRPC objects from IAgent NotifyResultData
- refactor: remove gRPC objects from IAgent CreateResultsMetaData
- refactor: remove gRPC objects from IAgent CreateResults
@@ -123,17 +125,14 @@ public Task Stop() | |||
}; | |||
} | |||
|
|||
var result = (await agent_.CreateResultsMetaData(new CreateResultsMetaDataRequest | |||
var result = (await agent_.CreateResultsMetaData(agent_.Token, | |||
new List<ResultCreationRequest> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new List<ResultCreationRequest> | |
new ResultCreationRequest[] |
Common/tests/Helpers/SimpleAgent.cs
Outdated
public Task<ICollection<Result>> CreateResultsMetaData(string token, | ||
ICollection<ResultCreationRequest> requests, | ||
CancellationToken cancellationToken) | ||
=> Task.FromResult(new List<Result>().AsICollection()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=> Task.FromResult(new List<Result>().AsICollection()); | |
=> Task.FromResult(Array.Empty<Result>().AsICollection()); |
Common/tests/Helpers/SimpleAgent.cs
Outdated
@@ -70,21 +68,21 @@ public Task FinalizeTaskCreation(CancellationToken cancellationToken) | |||
CancellationToken cancellationToken) | |||
=> Task.FromResult(new List<TaskCreationRequest>().AsICollection()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=> Task.FromResult(new List<TaskCreationRequest>().AsICollection()); | |
=> Task.FromResult(Array.Empty<TaskCreationRequest>().AsICollection()); |
Common/tests/Pollster/AgentTest.cs
Outdated
CommunicationToken = token, | ||
}, | ||
Assert.ThrowsAsync<RpcException>(() => holder.Agent.CreateResultsMetaData(token, | ||
new List<ResultCreationRequest>(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new List<ResultCreationRequest>(), | |
Array.Empty<ResultCreationRequest>(), |
Common/tests/Pollster/AgentTest.cs
Outdated
@@ -746,52 +684,34 @@ public async Task SubmitTasksCreateOneRequestShouldSucceed(bool optionsNull) | |||
{ | |||
using var holder = new AgentHolder(); | |||
|
|||
var payload = await holder.Agent.CreateResults(new CreateResultsRequest | |||
var payload = await holder.Agent.CreateResults(holder.Token, | |||
new List<(ResultCreationRequest request, ReadOnlyMemory<byte> data)> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new List<(ResultCreationRequest request, ReadOnlyMemory<byte> data)> | |
new (ResultCreationRequest request, ReadOnlyMemory<byte> data)[] |
Common/tests/Pollster/AgentTest.cs
Outdated
}, | ||
CancellationToken.None) | ||
.ConfigureAwait(false); | ||
|
||
var eok = await holder.Agent.CreateResultsMetaData(new CreateResultsMetaDataRequest | ||
var eok = await holder.Agent.CreateResultsMetaData(holder.Token, | ||
new List<ResultCreationRequest> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new List<ResultCreationRequest> | |
new ResultCreationRequest[] |
eok.Select(r => r.ResultId) | ||
.AsICollection(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eok.Select(r => r.ResultId) | |
.AsICollection(), | |
eok.ViewSelect(r => r.ResultId), |
Common/tests/Pollster/AgentTest.cs
Outdated
@@ -837,37 +757,27 @@ public async Task SubmitTasksUploadPayloadShouldSucceed(bool optionsNull) | |||
{ | |||
using var holder = new AgentHolder(); | |||
|
|||
var eok = await holder.Agent.CreateResultsMetaData(new CreateResultsMetaDataRequest | |||
var eok = await holder.Agent.CreateResultsMetaData(holder.Token, | |||
new List<ResultCreationRequest> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new List<ResultCreationRequest> | |
new ResultCreationRequest[] |