Skip to content

rust: replace static fixture with test helpers #4433

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

Merged
merged 5 commits into from
Dec 9, 2020

Conversation

wchargin
Copy link
Contributor

@wchargin wchargin commented Dec 7, 2020

Summary:
In #4385, @nfelt suggested using test helpers to easily populate a
commit rather than using a single fixture across all test cases. This
patch implements such test helpers and uses them in the server tests.
The net diff to the test code (not the helpers) is −32 lines.

Test Plan:
Existing tests pass. The new test helpers mostly don’t have explicit
tests, but that’s okay since they’re exercised by the main test code.

wchargin-branch: rust-test-data-builders

Summary:
In #4385, @nfelt suggested using test helpers to easily populate a
commit rather than using a single fixture across all test cases. This
patch implements such test helpers and uses them in the server tests.
The net diff to the test code (not the helpers) is −32 lines.

Test Plan:
Existing tests pass. The new test helpers mostly don’t have explicit
tests, but that’s okay since they’re exercised by the main test code.

wchargin-branch: rust-test-data-builders
wchargin-source: 31164b4d2b4a1fb9bbabc584249e1d3715c17a3e
wchargin-branch: rust-test-data-builders
wchargin-source: 1120046a43711e742fd50ff81266a04e45359136
wchargin-branch: rust-test-data-builders
wchargin-source: 1d53aecf45310e9c02513469074c7ee4b6675c74
wchargin added a commit that referenced this pull request Dec 8, 2020
Summary:
Some time between 13:41 and 17:20 Pacific time today, Travis stopped
even pretending to run our builds. Note: #4433 reports a Travis status,
whereas #4434 has no such item, not even “pending”. And our Travis
dashboard shows no builds more recent than #4433, either.

Relevant Hacker News: <https://news.ycombinator.com/item?id=25338983>

Thankfully, we finally landed #2953 on Friday, so we are no longer
dependent on Travis. This patch deletes the Travis configs and excises
all remaining mentions.

Test Plan:
Running `git grep -i travis` now fails.

wchargin-branch: ci-rm-travis
wchargin-source: c61b1e12df8b53e9231bc36f2c99a7bd140843b4
wchargin added a commit that referenced this pull request Dec 8, 2020
Summary:
Some time between 13:41 and 17:20 Pacific time today, Travis stopped
even pretending to run our builds. Note: #4433 reports a Travis status,
whereas #4434 has no such item, not even “pending”. And our Travis
dashboard shows no builds more recent than #4433, either.

Relevant Hacker News: <https://news.ycombinator.com/item?id=25338983>

Thankfully, we finally landed #2953 on Friday, so we are no longer
dependent on Travis. This patch deletes the Travis configs and excises
all remaining mentions.

Test Plan:
Running `git grep -i travis` now fails.

wchargin-branch: ci-rm-travis
@wchargin wchargin requested a review from nfelt December 8, 2020 03:19
Copy link
Contributor

@nfelt nfelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

fn default() -> Self {
ScalarTimeSeriesBuilder {
step_start: Step(0),
wall_time_start: WallTime::new(1235.0).unwrap(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional, but left to my own devices I would probably either omit some of these default values (aka require them to be set on the builder) or at least try to have the defaults be sort of the "minimally arbitrary" values (e.g. start wall time at 0.0 incrementing by 1.0, make len 1, make eval just be 0 always, etc.).

Otherwise we still have test_read_scalars() making assertions like assert_eq!(xent_data.wall_time, vec![1235.0, 1236.0, 1237.0]); that can't be understood to be correct without consulting this default implementation. By contrast, test_list_scalars() is explicit at least about the wall_time_start and len values and thus its assertions are self-contained.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. You have inspired me to be less lazy. Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<meme>what is my purpose?</meme>

wchargin-branch: rust-test-data-builders
wchargin-source: beb88cf56ad51ae6ec2413bb31f741dcf364573e
wchargin-branch: rust-test-data-builders
wchargin-source: beb88cf56ad51ae6ec2413bb31f741dcf364573e
@wchargin wchargin merged commit 4495a03 into master Dec 9, 2020
@wchargin wchargin deleted the wchargin-rust-test-data-builders branch December 9, 2020 02:08
@wchargin wchargin added the core:rustboard //tensorboard/data/server/... label Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes core:rustboard //tensorboard/data/server/... type:cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants