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

Feature/implement e2e client connects to node test #204

Merged
merged 14 commits into from Mar 15, 2018

Conversation

Projects
None yet
3 participants
@tadovas
Copy link
Member

commented Mar 14, 2018

No description provided.

@@ -3,3 +3,4 @@
/vendor
/.env
testdataoutput
e2e_tests.log

This comment has been minimized.

Copy link
@donce

donce Mar 14, 2018

Contributor

newline! :D

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 14, 2018

Author Member

Not again :) fixed.

tadovas added some commits Mar 14, 2018

@@ -13,6 +13,9 @@
# copy update-resolv-conf to myst client current directory
# build/client/ (by default)

#This check helps to avoid running this script in linux (win :)) based environments
[[ $OSTYPE = "darwin"* ]] || exit 0

This comment has been minimized.

Copy link
@Waldz

Waldz Mar 14, 2018

Member

is = valid comparison operator?

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 14, 2018

Author Member

It's a special case when expanding os type and making string match (wildchar at the end) so yes this expression is valid.

@@ -5,10 +5,13 @@ OS_DIR_CONFIG="/etc/mysterium-client"
OS_DIR_DATA="/var/lib/mysterium-client"
OS_DIR_RUN="/var/run/mysterium-client"

mkdir -p $OS_DIR_RUN

This comment has been minimized.

Copy link
@Waldz

Waldz Mar 14, 2018

Member

Server entrypoint has

if [ ! -d "$OS_DIR_RUN" ]; then
    mkdir -p $OS_DIR_RUN
fi

Would be good to unify both places

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 14, 2018

Author Member

Done


var identity client.IdentityDTO
if len(identities) < 1 {
identity, err = tequilApi.NewIdentity("")

This comment has been minimized.

Copy link
@Waldz

Waldz Mar 15, 2018

Member

It's 2nd green path. Should not we have 2 separate tests for that?

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 15, 2018

Author Member

It's not green path. It's ensurement that we have available identity to use for connection - test cannot proceed without that.

cleanup
exit 1
fi

${dockerComposeCmd} build
if [ ! $? -eq 0 ]; then
print_error "Building docker images failed"
exit 1

This comment has been minimized.

Copy link
@donce

donce Mar 15, 2018

Contributor

Cleanup missing.

cleanup
exit 1
fi

${dockerComposeCmd} build

This comment has been minimized.

Copy link
@donce

donce Mar 15, 2018

Contributor

What if images are already built, won't this finish instantly while database is not set-up yet?

if [ ! $? -eq 0 ]; then
print_error "Db migration failed"
cleanup
exit 1

This comment has been minimized.

Copy link
@donce

donce Mar 15, 2018

Contributor

These 3 lines repeats on each step - we can make a function fatal(error_message) to DRY this.

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 15, 2018

Author Member

It's bash - next time

countryString = *country
} else {
countryString = "Unknown"
if len(country) == 0 {

This comment has been minimized.

Copy link
@donce

donce Mar 15, 2018

Contributor

I'm confusied - Isn't countryString left empty if len(country) != 0?

This comment has been minimized.

Copy link
@tadovas

tadovas Mar 15, 2018

Author Member

Fixed

@Waldz

Waldz approved these changes Mar 15, 2018

@donce

donce approved these changes Mar 15, 2018

@@ -25,14 +27,18 @@ type ProposalDTO struct {
ServiceDefinition ServiceDefinitionDTO `json:"serviceDefinition"`
}

func (p ProposalDTO) String() string {
return fmt.Sprintf("Id: %d , Provider: %s, Country: %s", p.ID, p.ProviderID, p.ServiceDefinition.LocationOriginate.Country)

This comment has been minimized.

Copy link
@donce

donce Mar 15, 2018

Contributor
p.ServiceDefinition.LocationOriginate.Country

This is very long call chain and it seems to be repeated everywhere we need country. Perhaps service proposal or service definition could have country shortcut method?

@tadovas tadovas merged commit 26e74bc into master Mar 15, 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

@tadovas tadovas deleted the feature/implement-e2e-client-connects-to-node-test branch Mar 15, 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.