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 test cases #52

Merged
merged 1 commit into from Nov 21, 2016
Merged

add test cases #52

merged 1 commit into from Nov 21, 2016

Conversation

gaocegege
Copy link
Contributor

fixes #43

Signed-off-by: Ce Gao ce.gao@outlook.com

@gaocegege gaocegege force-pushed the add-test-cases branch 5 times, most recently from 06c98a1 to c0464e6 Compare November 16, 2016 07:09
@gaocegege gaocegege changed the title [WIP] add test cases add test cases Nov 16, 2016
@gaocegege gaocegege force-pushed the add-test-cases branch 3 times, most recently from d8252cf to c57f09d Compare November 16, 2016 11:08
@gaocegege
Copy link
Contributor Author

I have tried to run e2e tests in travis but fails because of the time limit.

@gaocegege
Copy link
Contributor Author

PTAL @Superxi911

"github.com/caicloud/cyclone/store"
"github.com/emicklei/go-restful"
docker_client "github.com/fsouza/go-dockerclient"
)

const WORKER_NODE_DOCKER_VERSION = "1.10.1"
// WORKER_NODE_DOCKER_VERSION defines the required docker version in worker node.
const WORKER_NODE_DOCKER_VERSION = "WORKER_NODE_DOCKER_VERSION"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should restrict it by code, not by ENV

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For example, if we wanna change the supported docker version in worker node, we have to re-compile the code.

It's not cool.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we wanna change the supported docker version in worker node in future, it means we have update our codes to support more docker version, not just modify a const string.

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 changed here because travis's docker version is 1.12.0, and this version could pass e2e tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And now the default is 1.10.1, I think it would be OK.

We could add some tips in doc, for example "This is just for test."

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, suggest user don't configure this ENV in doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

Client *docker_client.Client
Registry string
AuthConfig *AuthConfig
EndPoint string
Copy link
Contributor

Choose a reason for hiding this comment

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

Why expose these vars? We have functions to get them, such as: GetDockerAuthConfig, GetDockerRegistry. If you expose them, them can be modified

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just for test, we can not mock this manager if we don't expose them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would exposed the vars violate the golang's coding style? if yes, i think can delete the functions, as GetDocker***

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

Signed-off-by: Ce Gao <ce.gao@outlook.com>
@gaocegege
Copy link
Contributor Author

PTAL

@superxi911-zz
Copy link
Contributor

LGTM

@superxi911-zz superxi911-zz merged commit d64bbfe into caicloud:master Nov 21, 2016
@gaocegege gaocegege deleted the add-test-cases branch December 5, 2016 06:00
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.

add more unit test cases
3 participants