Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/views/data_drip/backfill_runs/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</div>
<div class="flex-1 flex flex-col gap-1">
<p class="text-sm font-light text-left mt-0.5"><span class="font-semibold">Batch Size:</span>
<%= @backfill_run.batches.first&.batch_size || @backfill_run.batch_size %></p>
<%= @backfill_run.batch_size %></p>
<p class="text-sm font-light text-left mt-0.5"><span class="font-semibold">Created At:</span>
<%= format_datetime_in_user_timezone(@backfill_run.created_at, @user_timezone) %>
</p>
Expand Down Expand Up @@ -121,7 +121,7 @@
<thead>
<tr>
<th class="py-2 px-4 text-gray-400 font-semibold text-sm">STATUS</th>
<th class="py-2 px-4 text-gray-400 font-semibold text-sm">BATCH SIZE</th>
<th class="py-2 px-4 text-gray-400 font-semibold text-sm">ITEMS PROCESSED</th>
<th class="py-2 px-4 text-gray-400 font-semibold text-sm">FINISHED AT</th>
<th class="py-2 px-4 text-gray-400 font-semibold text-sm">START ID</th>
<th class="py-2 px-4 text-gray-400 font-semibold text-sm">FINISH ID</th>
Expand Down
63 changes: 63 additions & 0 deletions spec/controllers/data_drip/backfill_runs_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,69 @@
end
end

describe "GET #index" do
render_views

let!(:backfill_run) do
DataDrip::BackfillRun.create!(
backfill_class_name: "AddRoleToEmployee",
batch_size: 50,
start_at: 1.hour.from_now,
backfiller: backfiller
)
end

let!(:batch) do
DataDrip::BackfillRunBatch.create!(
backfill_run: backfill_run,
batch_size: 10,
start_id: 1,
finish_id: 10,
status: :pending
)
end

it "displays the configured batch_size, not the chunk size" do
get :index
expect(response.body).to include("50")
end
end

describe "GET #show" do
render_views

let!(:backfill_run) do
DataDrip::BackfillRun.create!(
backfill_class_name: "AddRoleToEmployee",
batch_size: 50,
start_at: 1.hour.from_now,
backfiller: backfiller
)
end

let!(:batch) do
DataDrip::BackfillRunBatch.create!(
backfill_run: backfill_run,
batch_size: 10,
start_id: 1,
finish_id: 10,
status: :pending
)
end

it "displays the configured batch_size in the summary" do
get :show, params: { id: backfill_run.id }
expect(response.body).to include("Batch Size")
expect(response.body).to include("50")
end

it "displays items processed in the batches table" do
get :show, params: { id: backfill_run.id }
expect(response.body).to include("ITEMS PROCESSED")
expect(response.body).to include("10")
end
end

describe "#backfill_class_names" do
it "returns sorted and unique backfill class names" do
expect(controller.send(:backfill_class_names)).to include(
Expand Down
Loading