Skip to content

Commit

Permalink
chore: update elixir to 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
grejdi-mbta committed Dec 31, 2024
1 parent 7e25163 commit b4e6d02
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do
dmap_table: dmap_table,
dmap_load_objects: dmap_load_objects
} do
{:ok, {nil, new_dmap_load_recs}} =
{:ok, {_table_original, nil, new_dmap_load_recs}} =
CubicLoad.insert_new_from_objects_with_table(dmap_load_objects, dmap_table)

assert Enum.map(dmap_load_objects, & &1.key) ==
Expand All @@ -96,7 +96,7 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do
load.s3_key
end)

assert {:ok, {nil, []}} ==
assert {:ok, {dmap_table, nil, []}} ==
CubicLoad.insert_new_from_objects_with_table(dmap_load_objects, dmap_table)

# add a new object
Expand All @@ -111,7 +111,8 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do

# adding one more load object, should only insert it as a load record
assert {:ok,
{nil, [{%CubicLoad{s3_key: "cubic/dmap/sample/20220103.csv.gz"}, nil, _table, nil}]}} =
{_table_after_one_more_load, nil,
[{%CubicLoad{s3_key: "cubic/dmap/sample/20220103.csv.gz"}, nil, _table, nil}]}} =
CubicLoad.insert_new_from_objects_with_table(dmap_load_objects, dmap_table)
end

Expand All @@ -120,7 +121,7 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do
ods_table: ods_table,
ods_load_objects: ods_load_objects
} do
{:ok, {_last_ods_table_snapshot, new_ods_load_recs}} =
{:ok, {_table_original, _last_ods_table_snapshot, new_ods_load_recs}} =
CubicLoad.insert_new_from_objects_with_table(ods_load_objects, ods_table)

assert Enum.map(ods_load_objects, & &1.key) ==
Expand All @@ -132,7 +133,7 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do
end)

# inserting again should not return any new records
assert {:ok, {_last_ods_table_snapshot, []}} =
assert {:ok, {_table_after_insert, _last_ods_table_snapshot, []}} =
CubicLoad.insert_new_from_objects_with_table(ods_load_objects, ods_table)

# add a new object
Expand All @@ -147,7 +148,7 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do

# adding one more load object, should only insert it as a load record
assert {:ok,
{_last_ods_table_snapshot,
{_table_after_one_more_load, _last_ods_table_snapshot,
[
{%CubicLoad{s3_key: "cubic/ods_qlik/SAMPLE/LOAD3.csv.gz"}, _ods_load_snapshot,
_table, _ods_table_snapshot}
Expand All @@ -157,7 +158,8 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do
test "providing an empty list of objects", %{
dmap_table: dmap_table
} do
assert {:ok, {nil, []}} = CubicLoad.insert_new_from_objects_with_table([], dmap_table)
assert {:ok, {_table, nil, []}} =
CubicLoad.insert_new_from_objects_with_table([], dmap_table)
end
end

Expand Down Expand Up @@ -236,7 +238,8 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do
dmap_load_objects: dmap_load_objects
} do
# insert records as ready
{:ok, {nil, [{first_new_load_rec, nil, _table, nil} | rest_new_load_recs]}} =
{:ok,
{_table_after_insert, nil, [{first_new_load_rec, nil, _table, nil} | rest_new_load_recs]}} =
CubicLoad.insert_new_from_objects_with_table(dmap_load_objects, dmap_table)

# set the first record to 'archived'
Expand Down Expand Up @@ -299,7 +302,7 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do
dmap_load_objects: dmap_load_objects
} do
# insert records as ready
{:ok, {nil, [{first_new_load_rec, nil, _table, nil} | _rest]}} =
{:ok, {_table_after_insert, nil, [{first_new_load_rec, nil, _table, nil} | _rest]}} =
CubicLoad.insert_new_from_objects_with_table(dmap_load_objects, dmap_table)

# update it to 'archived' status
Expand All @@ -319,7 +322,7 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do
dmap_load_objects: dmap_load_objects
} do
# insert records as ready
{:ok, {nil, new_load_recs}} =
{:ok, {_table_after_insert, nil, new_load_recs}} =
CubicLoad.insert_new_from_objects_with_table(dmap_load_objects, dmap_table)

expected =
Expand All @@ -346,7 +349,7 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do
dmap_load_objects: dmap_load_objects
} do
# insert records as ready
{:ok, {nil, new_load_recs}} =
{:ok, {_table_after_insert, nil, new_load_recs}} =
CubicLoad.insert_new_from_objects_with_table(dmap_load_objects, dmap_table)

new_load_rec_ids =
Expand All @@ -368,7 +371,7 @@ defmodule ExCubicIngestion.Schema.CubicLoadTest do
dmap_table: dmap_table,
dmap_load_objects: dmap_load_objects
} do
{:ok, {nil, new_load_recs}} =
{:ok, {_table, nil, new_load_recs}} =
CubicLoad.insert_new_from_objects_with_table(dmap_load_objects, dmap_table)

{_, ready_loads_by_table_query} =
Expand Down

0 comments on commit b4e6d02

Please sign in to comment.