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

Add simple integration test for client with CLI #178

Merged
merged 5 commits into from Feb 27, 2018

Conversation

Projects
None yet
3 participants
@donce
Copy link
Contributor

commented Feb 23, 2018

Test script starts-up docker containers and executes "status" command in CLI. "Status: NotConnected" is expected in output.

Sample integration_tests/test.sh output:

Creating mysterium-broker ... done
Creating mysterium-server-ubuntu ... done
Creating mysterium-client ... done
Creating mysterium-server-ubuntu ...
Creating mysterium-client ...
Full CLI output:
[INFO] Status: NotConnected
[INFO] SID:
Good bye

Status line found:
[INFO] Status: NotConnected
Tests passed

@donce donce requested review from shroomist, tadovas, Waldz and zolia Feb 23, 2018

@donce donce force-pushed the feature/simple-integration-test branch 3 times, most recently from 7032984 to 6ed0d2b Feb 23, 2018

#!/usr/bin/env bash

docker-compose up -d
docker cp integration_tests/data/ mysterium-client:/usr/lib/integration_tests

This comment has been minimized.

Copy link
@Waldz

Waldz Feb 23, 2018

Member

Does it have to be copied into container?

This comment has been minimized.

Copy link
@tadovas

tadovas Feb 23, 2018

Member

That's strange to copy something into running container at all

This comment has been minimized.

Copy link
@donce

donce Feb 23, 2018

Author Contributor

Yes - tequilapi binds on localhost, so it is not reachable from host machine.

This comment has been minimized.

Copy link
@Waldz

Waldz Feb 23, 2018

Member

Yes, it is reachable:

This comment has been minimized.

Copy link
@donce

donce Feb 25, 2018

Author Contributor

It's not reachable, because service itself binds on "localhost", not on "0.0.0.0" to allow public connections.

We can change this to "0.0.0.0" to make this work, but this breaks the initial idea that tequilapi should work only in the same machine.

This comment has been minimized.

Copy link
@tadovas

tadovas Feb 25, 2018

Member

It's ok to change it to "0.0.0.0" for testing purposes. At least that's why this parameter --tequilapi.address "0.0.0.0" was intended for ;)

This comment has been minimized.

Copy link
@donce

donce Feb 26, 2018

Author Contributor

Testing environment should as as close to real as possible, but I can't find any better solution to keep that, so we'll have to make it public in tests :/

@@ -0,0 +1,18 @@
#!/usr/bin/env bash

output=`/usr/bin/mysterium_client --cli < /usr/lib/integration_tests/cli-input`

This comment has been minimized.

Copy link
@Waldz

Waldz Feb 23, 2018

Member

Nicest way would ne to fetch TequilAPI endpoint with curl -X POST ..:4050/...

fi

echo "Tests passed"
exit 0

This comment has been minimized.

Copy link
@tadovas

tadovas Feb 26, 2018

Member

And where is docker-compose down ? I expect tests to cleanup after themselves

@donce donce force-pushed the feature/simple-integration-test branch from 2484f69 to 97a3a95 Feb 27, 2018

@tadovas
Copy link
Member

left a comment

LGTM

@donce donce merged commit 013da86 into master Feb 27, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@donce donce deleted the feature/simple-integration-test branch Feb 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.