mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
Fix non-determinism in expected ordering in agent test suite test
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8493 GitOrigin-RevId: 210b6beb991d806e9a3e4cc901ee922ede0e3c84
This commit is contained in:
parent
042046bba7
commit
8acd447803
@ -6,7 +6,9 @@ import Data.Aeson qualified as J
|
|||||||
import Data.Foldable (for_)
|
import Data.Foldable (for_)
|
||||||
import Data.Functor ((<&>))
|
import Data.Functor ((<&>))
|
||||||
import Data.HashMap.Strict (HashMap)
|
import Data.HashMap.Strict (HashMap)
|
||||||
|
import Data.List (sortOn)
|
||||||
import Data.List.NonEmpty (NonEmpty (..))
|
import Data.List.NonEmpty (NonEmpty (..))
|
||||||
|
import Data.List.NonEmpty qualified as NonEmpty
|
||||||
import Data.Maybe (fromMaybe, maybeToList)
|
import Data.Maybe (fromMaybe, maybeToList)
|
||||||
import Hasura.Backends.DataConnector.API
|
import Hasura.Backends.DataConnector.API
|
||||||
import Test.AgentAPI (mutationGuarded, queryGuarded)
|
import Test.AgentAPI (mutationGuarded, queryGuarded)
|
||||||
@ -224,6 +226,14 @@ spec TestData {..} edgeCasesTestData Capabilities {..} = describe "Delete Mutati
|
|||||||
[ ("PlaylistId", _tdColumnField _tdPlaylistTracksTableName "PlaylistId"),
|
[ ("PlaylistId", _tdColumnField _tdPlaylistTracksTableName "PlaylistId"),
|
||||||
("TrackId", _tdColumnField _tdPlaylistTracksTableName "TrackId")
|
("TrackId", _tdColumnField _tdPlaylistTracksTableName "TrackId")
|
||||||
]
|
]
|
||||||
|
& qOrderBy
|
||||||
|
?~ OrderBy
|
||||||
|
mempty
|
||||||
|
( NonEmpty.fromList
|
||||||
|
[ _tdOrderByColumn [] "PlaylistId" Ascending,
|
||||||
|
_tdOrderByColumn [] "TrackId" Ascending
|
||||||
|
]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -245,7 +255,10 @@ spec TestData {..} edgeCasesTestData Capabilities {..} = describe "Delete Mutati
|
|||||||
|
|
||||||
let joinInPlaylistTracks (track :: HashMap FieldName FieldValue) =
|
let joinInPlaylistTracks (track :: HashMap FieldName FieldValue) =
|
||||||
let trackId = track ^? Data.field "TrackId" . Data._ColumnFieldNumber
|
let trackId = track ^? Data.field "TrackId" . Data._ColumnFieldNumber
|
||||||
playlistTracks = _tdPlaylistTracksRows & filter (\playlistTrack -> playlistTrack ^? Data.field "TrackId" . Data._ColumnFieldNumber == trackId)
|
playlistTracks =
|
||||||
|
_tdPlaylistTracksRows
|
||||||
|
& filter (\playlistTrack -> playlistTrack ^? Data.field "TrackId" . Data._ColumnFieldNumber == trackId)
|
||||||
|
& sortOn (\playlistTrack -> (playlistTrack ^? Data.field "PlaylistId", playlistTrack ^? Data.field "TrackId"))
|
||||||
in Data.insertField "PlaylistTracks" (Data.mkSubqueryRowsFieldValue playlistTracks) track
|
in Data.insertField "PlaylistTracks" (Data.mkSubqueryRowsFieldValue playlistTracks) track
|
||||||
|
|
||||||
let joinInTrack (invoiceLine :: HashMap FieldName FieldValue) =
|
let joinInTrack (invoiceLine :: HashMap FieldName FieldValue) =
|
||||||
|
Loading…
Reference in New Issue
Block a user