-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite predictions pubsub tests (#2129)
* rewrite mostly working * mocks and first test * all tests passing * tests * cleanup and start channel tests * start of final test file * add other test stubs * all tests passing * last two tests * add comments * try to sleep for supervisor children check * alphabetize type keys * add more sleep for pubsub test * remove process sleep hackiness * cleanup * move stream stopping code into the only test using it * remove flaky test
- Loading branch information
1 parent
a9e240e
commit 9b1b4ad
Showing
16 changed files
with
372 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
defmodule Predictions.PubSub.Behaviour do | ||
@moduledoc """ | ||
Defines the behaviour for the Predictions PubSub. | ||
""" | ||
|
||
@callback subscribe(String.t()) :: [Prediction.t()] | {:error, term()} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
defmodule Predictions.Store.Behaviour do | ||
@moduledoc """ | ||
Defines the behaviour for the Predictions Store. | ||
""" | ||
|
||
alias Predictions.Prediction | ||
alias Routes.Route | ||
alias Schedules.Trip | ||
alias Stops.Stop | ||
alias Vehicles.Vehicle | ||
|
||
@type fetch_keys :: [ | ||
direction: 0 | 1, | ||
prediction_id: Prediction.id_t(), | ||
route: Route.id_t(), | ||
stop: Stop.id_t(), | ||
trip: Trip.id_t(), | ||
vehicle_id: Vehicle.id_t() | ||
] | ||
|
||
@callback clear(fetch_keys()) :: :ok | ||
@callback fetch(fetch_keys()) :: [Prediction.t()] | ||
@callback update({atom, [Prediction.t()]}) :: :ok | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.