Skip to content

Commit

Permalink
add test for desc get_records_for_run (dagster-io#22351)
Browse files Browse the repository at this point in the history
## Summary & Motivation
event log storage test coverage.

## How I Tested These Changes
BK
  • Loading branch information
prha authored and danielgafni committed Jun 18, 2024
1 parent fe47564 commit 010ab45
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,23 @@ def test_event_log_storage_storage_id_pagination(
storage.store_event(create_test_event_log_record(str(2), run_id=other_run_id))
storage.store_event(create_test_event_log_record("D", run_id=test_run_id))

result = storage.get_records_for_run(test_run_id, ascending=True)
storage_ids = [r.storage_id for r in result.records]
desc_result = storage.get_records_for_run(test_run_id, ascending=False)
assert [r.event_log_entry.user_message for r in desc_result.records] == [
"D",
"C",
"B",
"A",
]

asc_result = storage.get_records_for_run(test_run_id, ascending=True)
assert [r.event_log_entry.user_message for r in asc_result.records] == [
"A",
"B",
"C",
"D",
]

storage_ids = [r.storage_id for r in asc_result.records]
assert len(storage_ids) == 4

def _cursor(storage_id: int):
Expand Down

0 comments on commit 010ab45

Please sign in to comment.