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

Enable test-integration-cli for Windows platform #9284

Merged
merged 1 commit into from
Dec 22, 2014

Conversation

icecrime
Copy link
Contributor

This is more steps toward functional test-integration-cli for Windows client-side. How to run under Cygwin:

export CYGWIN=winsymlinks:lnk                          # Use simple .lnk for symlinks
export DOCKER_CLIENTONLY=1
export DOCKER_TEST_HOST=tcp://1.2.3.4:5678
project/make.sh binary test-integration-cli

Known issues:

  • Many tests fail, most likely a majority because of the test implementation itself
  • Coverage is not measured: I'm guessing this is another cygpath issues leading to coverfiles not being produced
  • This doesn't work with git-provided bash.exe: perhaps a bash expert can bring his expertise here

I believe this is worth merging as it provides a reasonable base for people to start fixing individual failing tests.


Update: how to set up a test environment on Windows:

  1. You'll need bash.exe, and unfortunately the one provided with git installer won't work. I chose to use Cygwin out of habit, but there's probably other (and perhaps better) choices out there.
  2. Because Windows doesn't support Docker daemon yet, you'll have to run a daemon somewhere to connect to. Remember to launch with the daemon with the appropriate -H directive allowing your Windows box to access it remotely.
  3. Launch Cygwin (the shell defaults to bash), cd to Docker source directory, and run:
    • export DOCKER_CLIENTONLY=1: indicates to the build scripts that you're running on a "client-only" platform
    • export DOCKER_TEST_HOST=tcp://<docker_host>:<docker_port>: gives the build scripts the address of the remote Docker host
    • project/make.sh binary test-integration-cli

Troubleshooting: the binary target should produce both a docker-$VERSION.exe binary inside ./bundles/$VERSION/binary/ and a docker.exe.lnk next to it. I encountered issues where the docker command was not recognized even though the link was in my path: this was due to Cygwin producing other types of links, and was fixed using export CYGWIN=winsymlinks:lnk.

@unclejack
Copy link
Contributor

@icecrime Is there some documentation on how to set up an environment for testing on Windows? I'm interested in helping out with this. I also need to run tests on Windows.

--pidfile "$DEST/docker.pid" \
&> "$DEST/docker.log"
) &
if [ -z $DOCKER_TEST_HOST ]; then
Copy link
Member

Choose a reason for hiding this comment

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

"$DOCKER_TEST_HOST"

@tianon
Copy link
Member

tianon commented Nov 25, 2014

Other than that one minor quoting nit, project/make/test-integration-cli change LGTM

target = strings.Trim(target, "\n")
target = strings.Trim(target, " ")
return target
return strings.Trim(target, " \r\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like strings.TrimSpace() is better

@johngossman
Copy link
Contributor

Overall this LGTM

@icecrime
Copy link
Contributor Author

@unclejack Indeed there is no documentation. Do you think docs/sources/contributing/devenvironment.md is a good place for this considering it's WIP and not yet an officially supported platform? I can try to write a little paragraph.

Thanks for the reviews, updating with the latest comments.

@icecrime icecrime closed this Nov 26, 2014
@icecrime icecrime reopened this Nov 26, 2014
@unclejack
Copy link
Contributor

@icecrime I think some instructions provided on this PR on how to test such PRs would be enough for now.

@icecrime
Copy link
Contributor Author

Rebased! PTAL

@icecrime
Copy link
Contributor Author

Ping @tianon @tiborvass

@tianon
Copy link
Member

tianon commented Dec 19, 2014

LGTM

@icecrime icecrime force-pushed the client_only_integration_tests branch from 4e84be3 to e7db5ae Compare December 21, 2014 00:39
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
@icecrime icecrime force-pushed the client_only_integration_tests branch from e7db5ae to f3ed422 Compare December 21, 2014 00:40
@icecrime
Copy link
Contributor Author

Rebased again, tibor in holidays: ping @LK4D4 @jfrazelle!

@SvenDowideit
Copy link
Contributor

@icecrime yes please - throw them into the devenv.md you mentioned :)

@icecrime
Copy link
Contributor Author

If possible, I'd rather have this merged ASAP because:

  • It's a pain to rebase :-)
  • Has been opened for more than a month
  • I would make it possible for people at MSFT to take on the work of fixing tests.

I can add documentation in a second PR (we'll definitely need some docs updating once Windows becomes a supported client platform anyway).

@jessfraz
Copy link
Contributor

I will take a look today :)

On Monday, December 22, 2014, Arnaud Porterie notifications@github.com
wrote:

If possible, I'd rather have this merged ASAP because:

  • It's a pain to rebase :-)
  • Has been opened for more than a month
  • I would make it possible for people at MSFT to take on the work of
    fixing tests.

I can add documentation in a second PR (we'll definitely need some docs
updating once Windows becomes a supported client platform anyway).


Reply to this email directly or view it on GitHub
#9284 (comment).

@jessfraz
Copy link
Contributor

LGTM

jessfraz pushed a commit that referenced this pull request Dec 22, 2014
Enable test-integration-cli for Windows platform
@jessfraz jessfraz merged commit 4d0fcb6 into moby:master Dec 22, 2014
@johngossman
Copy link
Contributor

Thanks!

&> "$DEST/docker.log"
) &
if [ -z "$DOCKER_TEST_HOST" ]; then
( set -x; exec \
Copy link
Member

Choose a reason for hiding this comment

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

SPACES????

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're so ruining Christmas.

Give me a minute to fix that!

Copy link
Member

Choose a reason for hiding this comment

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

This is merged already -- I'm working up a PR right now, no worries. 😉

Copy link
Member

Choose a reason for hiding this comment

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

Just wanted to bust some stones, especially @jfrazelle's.

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'll do it, no worries it's my fault (didn't pay attention when I moved the lines from integration-cli to the newly introduced files).

Copy link
Member

Choose a reason for hiding this comment

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

set list listchars=tab:»·,nbsp:_,extends:¬

in my .vimrc is basically my favorite line in the entire file ❤️

Copy link
Contributor

Choose a reason for hiding this comment

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

Waaaaahhhhh we need vim headers!

On Tuesday, December 23, 2014, Tianon Gravi notifications@github.com
wrote:

In project/make/.integration-daemon-start
#9284 (diff):

@@ -15,10 +15,14 @@ exec 41>&1 42>&2
DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs}
DOCKER_EXECDRIVER=${DOCKER_EXECDRIVER:-native}

-( set -x; exec \

  • docker --daemon --debug \
  • --storage-driver "$DOCKER_GRAPHDRIVER" \
  • --exec-driver "$DOCKER_EXECDRIVER" \
  • --pidfile "$DEST/docker.pid" \
  •   &> "$DEST/docker.log"
    
    -) &
    +if [ -z "$DOCKER_TEST_HOST" ]; then
  • ( set -x; exec \

set list listchars=tab:»·,nbsp:_,extends:¬

in my .vimrc is basically my favorite line in the entire file [image:
❤️]


Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/9284/files#r22246707.

Copy link
Member

Choose a reason for hiding this comment

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

Just fix your editor config and kwitchyerbellyakin!

Copy link
Contributor

Choose a reason for hiding this comment

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

Bah humbug

On Tuesday, December 23, 2014, Tianon Gravi notifications@github.com
wrote:

In project/make/.integration-daemon-start
#9284 (diff):

@@ -15,10 +15,14 @@ exec 41>&1 42>&2
DOCKER_GRAPHDRIVER=${DOCKER_GRAPHDRIVER:-vfs}
DOCKER_EXECDRIVER=${DOCKER_EXECDRIVER:-native}

-( set -x; exec \

  • docker --daemon --debug \
  • --storage-driver "$DOCKER_GRAPHDRIVER" \
  • --exec-driver "$DOCKER_EXECDRIVER" \
  • --pidfile "$DEST/docker.pid" \
  •   &> "$DEST/docker.log"
    
    -) &
    +if [ -z "$DOCKER_TEST_HOST" ]; then
  • ( set -x; exec \

Just fix your editor config and kwitchyerbellyakin!


Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/9284/files#r22246999.

@icecrime icecrime deleted the client_only_integration_tests branch July 15, 2015 17:49
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.

None yet

6 participants