Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

tests: Mount filesystem(s) during detect_fs #2102

Merged
merged 11 commits into from
Jul 28, 2020
Merged

tests: Mount filesystem(s) during detect_fs #2102

merged 11 commits into from
Jul 28, 2020

Conversation

utopiabound
Copy link
Contributor

@utopiabound utopiabound commented Jul 23, 2020

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 Reviewable

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>
johnsonw
johnsonw previously approved these changes Jul 23, 2020
.checked_output()
.await
.map(|o| {
let v: Vec<serde_json::Value> = serde_json::from_slice(&o.stdout).unwrap();
Copy link
Contributor

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>>()

?

Copy link
Contributor Author

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

Copy link
Member

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:

https://docs.serde.rs/serde_json/fn.from_slice.html

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>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Comment on lines +276 to +279
.map(|o| {
let v: Vec<serde_json::Value> = serde_json::from_slice(&o.stdout).unwrap();
v
})
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.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>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
mkpankov
mkpankov previously approved these changes Jul 27, 2020
Copy link
Contributor

@mkpankov mkpankov left a 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>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Copy link
Contributor Author

@utopiabound utopiabound left a 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)

Copy link
Contributor Author

@utopiabound utopiabound left a comment

Choose a reason for hiding this comment

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

:lgtm:

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:

https://docs.serde.rs/serde_json/fn.from_slice.html

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.

Copy link
Contributor

@mkpankov mkpankov left a 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)

@jgrund jgrund merged commit 55ed26e into master Jul 28, 2020
@jgrund jgrund deleted the tests-mounted branch July 28, 2020 13:10
beevans pushed a commit to beevans/integrated-manager-for-lustre that referenced this pull request Aug 6, 2020
* 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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants