Skip to content

Commit

Permalink
Minor adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonkopliku committed Nov 15, 2022
1 parent 3410355 commit 7d4cd04
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ curl --request POST 'http://localhost:4000/api/checks/executions/start' \
}'
```

> **execution_id** is a unique uuid provided by the consumer when starting the execution.
> **execution_id** must be new and unique for every new execution. If an already used **execution_id** is provided, starting the execution fails.
In order to get the detailed information for an execution see [Getting Execution details](#getting-execution-details).

Expand Down
4 changes: 1 addition & 3 deletions lib/wanda/executions/target.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ defmodule Wanda.Executions.Target do
Execution targets.
"""

alias Wanda.Executions.Target

defstruct [
:agent_id,
checks: []
Expand All @@ -24,7 +22,7 @@ defmodule Wanda.Executions.Target do

def map_targets(map_list) do
Enum.map(map_list, fn %{agent_id: agent_id, checks: checks} ->
%Target{agent_id: agent_id, checks: checks}
%__MODULE__{agent_id: agent_id, checks: checks}
end)
end
end
3 changes: 1 addition & 2 deletions lib/wanda_web/schemas/accepted_execution_response.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ defmodule WandaWeb.Schemas.AcceptedExecutionResponse do

OpenApiSpex.schema(%{
title: "AcceptedExecutionResponse",
description:
"Identifiers of the Accepted Execution, status needs to be checks at appropriate API",
description: "Identifiers of the recently accepted execution",
type: :object,
properties: %{
execution_id: %Schema{type: :string, format: :uuid},
Expand Down
10 changes: 5 additions & 5 deletions test/executions/target_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ defmodule Wanda.Executions.TargetTest do
%{
agent_id: agent_1 = Faker.UUID.v4(),
checks: [
check_1 = "SOME_CHECK",
check_2 = "ANOTHER_CHECK"
check_1 = Faker.Airports.iata(),
check_2 = Faker.Cannabis.brand()
]
},
%{
agent_id: agent_2 = Faker.UUID.v4(),
checks: [
check_3 = "YET_ANOTHER_CHECK"
check_3 = Faker.Color.name()
]
}
]

assert [
%{
%Target{
agent_id: ^agent_1,
checks: [
^check_1,
^check_2
]
},
%{
%Target{
agent_id: ^agent_2,
checks: [
^check_3
Expand Down

0 comments on commit 7d4cd04

Please sign in to comment.