Skip to content

Commit

Permalink
Merge 1dc9b5f into 424f013
Browse files Browse the repository at this point in the history
  • Loading branch information
tallysmartins committed Aug 9, 2018
2 parents 424f013 + 1dc9b5f commit f7167e1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/elixir_bench/benchmarks/job.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ defmodule ElixirBench.Benchmarks.Job do
field :claimed_at, :utc_datetime
field :completed_at, :utc_datetime
field :log, :string
field :exit_status, :integer

field :branch_name, :string
field :commit_message, :string
Expand All @@ -41,7 +42,8 @@ defmodule ElixirBench.Benchmarks.Job do
:cpu_count,
# TODO: change to a string memory
# :memory_mb,
:log
:log,
:exit_status
]

@create_fields [
Expand Down
1 change: 1 addition & 0 deletions lib/elixir_bench_web/schema/content_types.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ defmodule ElixirBenchWeb.Schema.ContentTypes do
field :claimed_at, :datetime
field :completed_at, :datetime
field :log, :string
field :exit_status, :integer

field :repo_slug, :string do
resolve(fn %{repo_id: repo_id}, _, %{context: %{loader: loader}} ->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
defmodule ElixirBench.Repo.Migrations.AddExitStatusToJob do
use Ecto.Migration

def change do
alter table(:jobs) do
add :exit_status, :integer, default: nil
end
end
end
1 change: 1 addition & 0 deletions priv/repo/seeds.exs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ data = %{
"log" => """
[now] Oh how ward it was to run this benchmark!
""",
"exit_status" => 0,
"measurements" => %{
"insert_mysql/insert_plain" => %{
"average" => 393.560253365004,
Expand Down
8 changes: 5 additions & 3 deletions test/elixir_bench_web/schema/schema_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -394,18 +394,20 @@ defmodule ElixirBenchWeb.SchemaTest do

describe "job query" do
test "fetch job by id", context do
job = insert(:job)
job = insert(:job, %{exit_status: 1})

query = """
job (id: "#{job.id}") {
id
id,
exit_status
}
"""

json_data = %{
"data" => %{
"job" => %{
"id" => "#{job.id}"
"id" => "#{job.id}",
"exit_status" => 1
}
}
}
Expand Down
1 change: 1 addition & 0 deletions test/support/factory/elixir_bench_factory.ex
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ defmodule ElixirBench.Factory do
"log" => """
[now] Oh how ward it was to run this benchmark!
""",
"exit_status" => 0,
"measurements" => %{
"insert_mysql/insert_plain" => %{
"average" => 393.560253365004,
Expand Down

0 comments on commit f7167e1

Please sign in to comment.