Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Integration tests: Initial framework #448

Merged
merged 10 commits into from
Mar 7, 2015

Conversation

aluzzardi
Copy link
Contributor

This is a continuation of the integration tests, related to #376

@aluzzardi
Copy link
Contributor Author

/cc @vieux @chanwit @ehazlett

@chanwit
Copy link
Contributor

chanwit commented Mar 6, 2015

This is fantastic!

@aluzzardi is it possible to have a Markdown describing Swarm's testing plan? Like what you did for the roadmap.

@aluzzardi
Copy link
Contributor Author

@chanwit Yes! I'll be working some more on the framework so it will be possible to write more advanced tests (resources, scheduler policy, constraints, ...) and then I'll put a testing plan somewhere (hopefully sometime next week).

I'm planning to use these for regression tests as well. Right now, the version of docker in declared in DOCKER_VERSION (only 1.5 is available atm). Eventually, I'd like to have all versions of docker available in the registry and run the integration tests against all the supported ones (starting at 1.4 and onwards) and perhaps even include master (so we are sure that swarm works all the time with the latest docker before it's even released).

Hopefully I can get this running on docker's jenkins to run nightly. @jfrazelle?

@chanwit
Copy link
Contributor

chanwit commented Mar 6, 2015

@aluzzardi this is great!
Waiting for this PR to be merged, I'll crafting some tests for basic commands I can think of in the mean time.

@ehazlett
Copy link

ehazlett commented Mar 6, 2015

minions

👍


# Run the swarm binary.
function swarm() {
${SWARM_ROOT}/swarm $@

Choose a reason for hiding this comment

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

Is the bare wordsplitting intended, or should $@ be in double quotes?

@aluzzardi
Copy link
Contributor Author

Thanks @kojiromike, I've made the changes.

PTAL

for ((i=current; i < instances; i++)); do
local port=$(($BASE_PORT + $i))
HOSTS[$i]=127.0.0.1:$port
DOCKER_CONTAINERS[$i]=$(docker run -d --name node-$i -h node-$i --privileged -p 127.0.0.1:$port:$port -it ${DOCKER_IMAGE}:${DOCKER_VERSION} docker -d -H 0.0.0.0:$port $args)

Choose a reason for hiding this comment

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

Sorry I didn't catch this the first time around. Why $args instead of just "$@" at the end of the docker command? Right now you lose the splitting of arguments passed to start_docker.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was just to make it obvious that args don't container the first one (since it's right after shift).

It doesn't really though, I can use "$@" instead

@aluzzardi
Copy link
Contributor Author

@kojiromike PTAL

@vieux
Copy link
Contributor

vieux commented Mar 7, 2015

LGTM

@kojiromike please open another PR if you can to fix stuff.

vieux added a commit that referenced this pull request Mar 7, 2015
Integration tests: Initial framework
@vieux vieux merged commit d708650 into docker-archive:master Mar 7, 2015
@vieux vieux removed the in progress label Mar 7, 2015
@vieux vieux deleted the integration branch March 7, 2015 01:22
@kojiromike
Copy link

Happy to, but I think it's all good now. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants