Skip to content
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

t0020: simplify peerid check #1625

Merged
merged 1 commit into from
Sep 2, 2015
Merged

t0020: simplify peerid check #1625

merged 1 commit into from
Sep 2, 2015

Conversation

chriscool
Copy link
Contributor

License: MIT
Signed-off-by: Christian Couder chriscool@tuxfamily.org

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
@jbenet jbenet added the status/in-progress In progress label Aug 30, 2015
@@ -58,11 +58,13 @@ test_expect_success "ipfs config succeeds" '
test_cmp expected_config actual_config
'

test_check_peerid() {
Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM

Though this could have been moved to the library, to replace https://github.com/ipfs/go-ipfs/pull/1626/files#diff-21a8cbf17e33b82a8fca825aca160f1dR21

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this could be moved to the library and used in t0062-daemon-api.sh too.
I don't understand why you say that it could replace the changes you link to though.

Copy link
Contributor

Choose a reason for hiding this comment

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

test_check_peerid $(ipfs "$@" id -f="<id>")?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah ok.

But as the output of ipfs "$@" id -f="<id>" is already tested with:

    ipfs "$@" id -f="<id>" >actual &&
    test_cmp expected actual

I think it is better to just use it like this:

test_expect_success "config setup" '
    api_fromcfg=$(ipfs config Addresses.API) &&
    peerid=$(ipfs config Identity.PeerID) &&
    test_check_peerid "$peerid"
'

I plan to do something like that when this PR and PR #1626 are merged.

Copy link
Contributor

Choose a reason for hiding this comment

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

The check needed in t0062 is a generic check on whether the client works.

jbenet added a commit that referenced this pull request Sep 2, 2015
t0020: simplify peerid check
@jbenet jbenet merged commit a3f0a6e into master Sep 2, 2015
@jbenet jbenet removed the status/in-progress In progress label Sep 2, 2015
@jbenet jbenet deleted the check-peerid branch September 2, 2015 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants