-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: refactor systests into separate modules w/ pytest fixtures #393
Conversation
Flaky sample error reported as #394. |
b73793c
to
de1f8a0
Compare
serve_nodes, | ||
in_emulator, | ||
): | ||
if not in_emulator: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, maybe a comment explaining the difference in setup for emulated vs non-emulated environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
timestamp_range = row_filters.TimestampRange(start=start, end=end) | ||
timefilter = row_filters.TimestampRangeFilter(timestamp_range) | ||
row_data = data_table.read_rows(filter_=timefilter) | ||
row_data.consume_all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No data written first? No asserts? What is this testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test is added in googleapis/google-cloud-python#5002. It feels like a "smoke test" for the expectation that timestamps passed in as filters get rounded down / up to the nearest millisecond (the back-end would barf when passed microsecond values (googleapis/google-cloud-python#4932).
tests/system/test_data_api.py
Outdated
|
||
data_table.truncate(timeout=200) | ||
|
||
for row in data_table.read_rows(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you expecting there to be rows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That test was originally added in googleapis/google-cloud-python#5360: I just ported it.
Assuming we don't have race conditions with other CI runs, I would expect there to be no rows in the table after a call to truncate
. 4b11ce8 changes the assertion accordingly.
tests/system/test_data_api.py
Outdated
] | ||
|
||
rows = [] | ||
for row_key in row_keys: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is repeated so often, I wonder if a helper function or fixture is in order for DRY reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Closes #391.