Commit Graph

18 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 9f0b3f5609
bump gotest.tools v3.0.1 for compatibility with Go 1.14
full diff: https://github.com/gotestyourself/gotest.tools/compare/v2.3.0...v3.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-11 00:06:42 +01:00
Kirill Kolyshkin 0a96ee7ff8
Merge pull request #40080 from thaJeztah/client_string_matching
client: reduce string-matching in tests
2019-10-17 11:38:00 -07:00
Sebastiaan van Stijn dabc7cdb56
client: use constants for http methods
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-13 17:30:21 +02:00
Sebastiaan van Stijn de10c7d013
client: reduce string-matching in tests
These checks were redundant, as we were not expecting
a specific string, just that a server-error or authentication
error was returned.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-10-13 17:00:40 +02:00
Sebastiaan van Stijn 07ff4f1de8
goimports: fix imports
Format the source according to latest goimports.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-18 12:56:54 +02:00
Sebastiaan van Stijn 161e0a90a6
Update tests to check returned errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-03-16 00:40:55 +01:00
Vincent Demeester 3845728524
Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-13 09:04:30 +02:00
Kir Kolyshkin 7d62e40f7e Switch from x/net/context -> context
Since Go 1.7, context is a standard package. Since Go 1.9, everything
that is provided by "x/net/context" is a couple of type aliases to
types in "context".

Many vendored packages still use x/net/context, so vendor entry remains
for now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-04-23 13:52:44 -07:00
Daniel Nephin 6be0f70983 Automated migration using
gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-16 11:03:43 -04:00
Daniel Nephin 4f0d95fa6e Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-05 16:51:57 -05:00
Brian Goff 72c3bcf2a5 Make plugin emit strongly typed, consumable events
Enables other subsystems to watch actions for a plugin(s).

This will be used specifically for implementing plugins on swarm where a
swarm controller needs to watch the state of a plugin.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-07-06 14:26:06 -04:00
Sebastiaan van Stijn f3fce00ef3
Make TestServiceCreateCompatiblePlatforms use actual API response
The `TestServiceCreateCompatiblePlatforms()` test was confusing, because it
did not actually use the mocked API response, but used a local
`distributionInspectBody` variable to verify that the `/distribution/` endpoint
was called.

This flow was especially confusing, because a comment in the test describes;

    "check if the /distribution endpoint returned correct output"

If (for whatever reason), the endpoint was not called, the test would panic,
because the `distributionInspectBody` would not be set.

This patch rewrites the test to use the actual API response that is returned
by the mock, and verifies that the information returned by the `/distribution/`
endpoint is properly used in the service's definition.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-13 14:25:50 +02:00
Sebastiaan van Stijn 1401342f46 Add API version checks to client
The Docker CLI already performs version-checks when
running commands, but other clients consuming the API
client may not do so.

This patch adds a version check to various
client functions.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-10 01:57:55 +02:00
Nishant Totla 75c7536d2e
Adding unit tests for pin by digest (client)
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2017-05-19 10:48:12 -07:00
Nishant Totla 7d4b8fb3b5
Updating test for compatible platforms to test unmarshal body
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2017-05-17 17:12:22 -07:00
Nishant Totla 587d07cca8
Adding compatible platforms to service spec
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
2017-05-17 16:20:42 -07:00
Stephen J Day 9a072adff3
client: remove transport package
This package doesn't really seem to do anything of real interest.
Removing it and replacing with a few helper functions. Most of this was
maintaining a fork of ctxhttp to support a mock that was unnecessary.

We could probably do with a further refactor of the client interface.
There is a lot of confusion of between transport, http layer and
application layer that makes for some awkward code. This change
improves the situation to the point where no breaking changes are
introduced.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-09-19 11:19:55 -07:00
Michael Crosby 7c36a1af03 Move engine-api client package
This moves the engine-api client package to `/docker/docker/client`.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-07 11:05:58 -07:00