-
Notifications
You must be signed in to change notification settings - Fork 35
tests: Mount filesystem(s) during detect_fs #2102
Conversation
vagrant: Split mount from create for zfs backed fs test: Check that the correct number of filesystems were detected in detect_fs() Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
.checked_output() | ||
.await | ||
.map(|o| { | ||
let v: Vec<serde_json::Value> = serde_json::from_slice(&o.stdout).unwrap(); |
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.
Just curious, could it also be:
serde_json::from_slice(&o.stdout)l.unwrap::<Vec<serde_json::Value>>()
?
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.
I tried cajoling that line to do that, but I couldn't figure it out:
error[E0107]: wrong number of type arguments: expected 0, found 1
--> iml-system-test-utils/src/ssh.rs:279:61
|
279 | .map(|o| serde_json::from_slice(&o.stdout).unwrap::<Vec<serde_json::Value>>())
| ^^^^^^^^^^^^^^^^^^^^^^ unexpected type argument
error: aborting due to previous error
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 reason that doesn't work is unwrap
has no generic parameter to fill in.
The turbofish needs to be on from_slice
which does have a generic parameter:
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
.map(|o| { | ||
let v: Vec<serde_json::Value> = serde_json::from_slice(&o.stdout).unwrap(); | ||
v | ||
}) |
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.
.map(|o| { | |
let v: Vec<serde_json::Value> = serde_json::from_slice(&o.stdout).unwrap(); | |
v | |
}) | |
.map(|o| serde_json::from_slice::<Vec<serde_json::Value>>(&o.stdout).unwrap()) |
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
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.
👍
Reviewed 3 of 6 files at r1, 2 of 4 files at r2, 9 of 9 files at r3, 2 of 2 files at r4.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @johnsonw and @utopiabound)
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
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.
Reviewed 3 of 6 files at r1, 2 of 4 files at r2, 9 of 9 files at r3, 2 of 2 files at r4, 3 of 3 files at r5.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @johnsonw and @utopiabound)
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jgrund and @johnsonw)
iml-system-test-utils/src/ssh.rs, line 277 at r1 (raw file):
Previously, jgrund (Joe Grund) wrote…
The reason that doesn't work is
unwrap
has no generic parameter to fill in.The turbofish needs to be on
from_slice
which does have a generic parameter:
Done.
iml-system-test-utils/src/ssh.rs, line 279 at r1 (raw file):
Previously, jgrund (Joe Grund) wrote…
.map(|o| serde_json::from_slice::<Vec<serde_json::Value>>(&o.stdout).unwrap())
Done.
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.
Reviewed 3 of 3 files at r5.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @jgrund and @johnsonw)
* tests: Mount filesystem(s) during detect_fs vagrant: Split mount from create for zfs backed fs test: Check that the correct number of filesystems were detected in detect_fs() Signed-off-by: Nathaniel Clark <nclark@whamcloud.com> * Make assert more clear Signed-off-by: Nathaniel Clark <nclark@whamcloud.com> * Use match for TestType enum Signed-off-by: Nathaniel Clark <nclark@whamcloud.com> * Fix cli argument Signed-off-by: Nathaniel Clark <nclark@whamcloud.com> * Use TestError and TestError::Assert in stead of assert! Signed-off-by: Nathaniel Clark <nclark@whamcloud.com> * Update error returns Signed-off-by: Nathaniel Clark <nclark@whamcloud.com> * Fix typo Signed-off-by: Nathaniel Clark <nclark@whamcloud.com> * Fixup transitions Signed-off-by: Nathaniel Clark <nclark@whamcloud.com> * Fix typo Signed-off-by: Nathaniel Clark <nclark@whamcloud.com> * Fix snap Signed-off-by: Nathaniel Clark <nclark@whamcloud.com> * Fix other snaps Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
vagrant: Split mount from create for zfs backed fs
test: Check that the correct number of filesystems
were detected in detect_fs()
Signed-off-by: Nathaniel Clark nclark@whamcloud.com
This change is