Skip to content

Introduce test-integration target (and deprecate/freeze test-integration-cli)#33344

Closed
vdemeester wants to merge 1 commit intomoby:masterfrom
vdemeester:test-integration-api
Closed

Introduce test-integration target (and deprecate/freeze test-integration-cli)#33344
vdemeester wants to merge 1 commit intomoby:masterfrom
vdemeester:test-integration-api

Conversation

@vdemeester
Copy link
Copy Markdown
Member

@vdemeester vdemeester commented May 22, 2017

This adds a new package integration where moby integration tests
should live. Those integration tests should not depends on any cli
components (except from the dockerd daemon for now — to actually
start a daemon).

This is a simple, naive approach and is a middle ground between current integration-cli and unit test.

The related topics is Evolution of testing @moby, issue #32866.

  • setup/cleanup defer should be extracted in another package
  • same fo createClient
  • should restore the protectXX too
  • integration-cli/environment and /integration-cli/fixtures/load should move to integration package
  • remove docker binary dependency from integration-cli/environment (the cleanup is using docker commands for now)

Signed-off-by: Vincent Demeester vincent@sbr.pm

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

strconv.FormatInt

Copy link
Copy Markdown
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

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

couple of nits

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: can be removed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

😛

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe the reverse? if I specify -test.timeout in my TESTFLAGS it'll be overridden by the script if I'm not mistaken.

Copy link
Copy Markdown
Member Author

@vdemeester vdemeester May 22, 2017

Choose a reason for hiding this comment

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

@mlaventure hum right 👼 I just copied the others bundle_xx but yep, make sense

@mlaventure
Copy link
Copy Markdown
Contributor

22:23:52 ---> Making bundle: test-unit (in bundles/17.06.0-dev/test-unit)
22:23:52 /go/src/github.com/docker/docker/hack/make/test-unit: line 40: syntax error near unexpected token `|'

Janky failure

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

strconv.FormatInt

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do you expect to plumb context through the test cases at some point? Otherwise, I think TODO is not the right context to use here (we should probably have ctx := context.Background() above.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

right :)

@vdemeester vdemeester force-pushed the test-integration-api branch from 0bd4ae1 to 5a90d23 Compare May 22, 2017 22:32
@aaronlehmann
Copy link
Copy Markdown

I'm wondering if it would be simpler to rename integration-cli to integration and gradually migrate existing tests to use the API directly, and/or move them elswhere.

It would be nice to avoid having two packages/targets with similar names that run different sets of tests. I could see confusion coming up between the two, such as people accidentally adding tests to integration-cli, or running only one of the two to validate changes.

@vdemeester vdemeester added status/1-design-review status/failing-ci Indicates that the PR in its current state fails the test suite and removed status/0-triage labels May 23, 2017
@vdemeester vdemeester force-pushed the test-integration-api branch from 5a90d23 to 0635b83 Compare May 23, 2017 00:50
@vdemeester vdemeester mentioned this pull request May 23, 2017
15 tasks
@vdemeester vdemeester force-pushed the test-integration-api branch from 0635b83 to a9524bd Compare May 23, 2017 20:22
@vdemeester
Copy link
Copy Markdown
Member Author

@aaronlehmann

I'm wondering if it would be simpler to rename integration-cli to integration and gradually migrate existing tests to use the API directly, and/or move them elsewhere.

Right, that's more or less what I was going for in #33124. The thing is, rewriting them (and/or extracting them) will take a long time, and depending on where we go with those new tests (i.e. using testing like this PR, or keep using go-check) the way we should run them could be really different.

It would be nice to avoid having two packages/targets with similar names that run different sets of tests. I could see confusion coming up between the two, such as people accidentally adding tests to integration-cli, or running only one of the two to validate changes.

Yeah I can see confusing coming up too. I'm still not 100% sold on having those two separate either, it's just a proposal 👼.

What I would like to be discussed and decided on for this PR are the following :

  • test-integration & test-integration-cli or have only a test-integration package with all of them, but some freezed and being worked on to move elsewhere or rewrote ?
  • testing (like the current proposal, with the use of subtest, etc..) or go-check ?

From there, this PR will be the start of the work and examples 😉

…ration-cli`)

This adds a new package `integration` where `moby` integration tests
should live. Those integration tests should not depends on any `cli`
components (except from the `dockerd` daemon for now — to actually
start a daemon).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
@vdemeester vdemeester force-pushed the test-integration-api branch from a9524bd to d5b3c31 Compare May 23, 2017 20:32
@aaronlehmann
Copy link
Copy Markdown

test-integration & test-integration-cli or have only a test-integration package with all of them, but some freezed and being worked on to move elsewhere or rewrote ?

I prefer to have a single package during the transition.

@dnephin
Copy link
Copy Markdown
Member

dnephin commented May 23, 2017

+1 for testing , go-check doesn't seem to provide much value.

A single package is a problem. It makes running a subset of the tests much slower than it needs to be. We should really have a package for each test suite, and a suite for each component.

A single target for CI SGTM.

@aaronlehmann
Copy link
Copy Markdown

A single package is a problem. It makes running a subset of the tests much slower than it needs to be. We should really have a package for each test suite, and a suite for each component.

A single target for CI SGTM.

That also sounds good to me. What I meant was that I'd like to have a single CI target.

@vdemeester
Copy link
Copy Markdown
Member Author

A single package is a problem. It makes running a subset of the tests much slower than it needs to be. We should really have a package for each test suite, and a suite for each component.

@dnephin Either way, it will be splitted into several packages for sure. A single package is just for the main package, i.e. integration or integration-cli (i.e. any new tests written should target the api and be on sub package of integration).

@vdemeester vdemeester removed the status/failing-ci Indicates that the PR in its current state fails the test suite label May 26, 2017
test-docker-py: build ## run the docker-py tests
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary test-docker-py

# Deprecated: use `test-integration` instead
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add the "deprecation" message in the comment below? the ## run the integration tests comment is also used for outputting the help message (make help)

@thaJeztah
Copy link
Copy Markdown
Member

@dnephin @aaronlehmann what's the status on this one?

@vdemeester
Copy link
Copy Markdown
Member Author

@thaJeztah I need to re-work that one 👼

@vdemeester
Copy link
Copy Markdown
Member Author

Closing this temporarly 👼

@vdemeester vdemeester closed this Jun 19, 2017
@vdemeester vdemeester deleted the test-integration-api branch February 28, 2018 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants