Commit Graph

36 Commits

Author SHA1 Message Date
Kenjiro Nakayama 0b0c3390a4
Remove unclear comment for makeSpoofClient() (#2347) 2021-11-11 03:49:38 -08:00
Markus Thömmes 73d4fe679a
Drop Retrying and EventuallyMatchesBody checks (#2278) 2021-09-07 04:23:19 -07:00
Dave Protasowski d9b7180af6
minor bug when passing spoof options (#2194)
The array needed to be spread using the '...' operator
2021-07-15 10:56:32 -07:00
Fabian Leonardo Lopez Bernal 459d3176a7
Add CheckEndpointState method to SpoofingClient (#2166)
* add CheckEndpointState method to SpoofingClient

Signed-off-by: Fabian Lopez <lfabian@vmware.com>
Co-authored-by: Sameer Vohra <vsameer@vmware.com>

* add boolean parameter to control polling behavoir on "EndpointState" checks

Signed-off-by: Fabian Lopez <lfabian@vmware.com>

* add unit test for CheckEndpointState method

Signed-off-by: Fabian Lopez <lfabian@vmware.com>

* move CheckEndpointState test to the spoof package

* add tests for WaitForEndpointState method

Signed-off-by: Fabian Lopez <lfabian@vmware.com>

* simplify Wait/Check unit tests and implementation

Signed-off-by: Fabian Lopez <lfabian@vmware.com>

Co-authored-by: Sameer Vohra <vsameer@vmware.com>
2021-07-13 07:32:51 -07:00
Dave Protasowski 47dfdcfaed
consolidate k8s flags to an environment package (#2133)
* consolidate k8s flags to an environment package

* add copyright

* fix comment style

* use go1.16 in workflows so downstream tests work

* Deprecate GetRESTConfig and do not remove

* update copyright date
2021-05-28 13:30:30 -07:00
Dave Protasowski e1306afead
move some spoof helpers to the spoof package (#1827)
This helps avoid pulling in the pkg/test globals
2020-11-24 10:23:35 -08:00
Dave Protasowski 5c30f4882d
use kubernetes.Interface for some test helpers (#1825)
- NewSpoofingClient
- WaitForEndpointState
- WaitForEndpointStateWithTimeout
2020-10-20 08:28:59 -07:00
Scott Nichols fc447086b7
Remove re-definition of kubeconfig from pkg/test (#1820)
* pull flags from injection

* lint

* trim T interface, use flagset
2020-10-19 16:30:58 -07:00
Victor Agababov 1e373a9e5d
take 2 (#1755) 2020-09-29 14:10:29 -07:00
Victor Agababov c46a186449
Various nits around the pkg (#1721) 2020-09-20 14:04:45 -07:00
Zbynek Roubalik 2d4efecc6b
bump to k8s 1.18 (#1428)
* bump to k8s 1.18.8

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* plumbing ctx through

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* add more ctx plumbing

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* ctx WithCancel()

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2020-09-11 07:54:00 -07:00
Victor Agababov 7dab04a79e
Fix some nits in the test helpers (#1677) 2020-09-01 11:05:15 -07:00
Matt Moore edd1b5e0be
Add a helper for checking for all expected responses. (#1676) 2020-09-01 10:20:15 -07:00
Martin Gencur 1327ff3179
Configurable SpoofRequestInterval and SpoofRequestTimeout (#942) 2020-03-09 09:59:28 -07:00
Jean-Rémy Bancel 2d6c3459ce Use *url.URL instead of string in request.go. (#670) 2019-09-18 11:56:47 -07:00
Jean-Rémy Bancel 75da3911c0 Spoof at the Resolver layer, not the Request layer. (#630) 2019-09-05 07:36:05 -07:00
Jean-Rémy Bancel 5bd67436f6 Revert "Spoof at the Resolver layer, not the Request layer. (#620)" (#629)
This reverts commit 3dd5d66573.
2019-09-03 14:00:01 -07:00
Matt Moore 6c69e99ee3 Report the status text in addition to the code on failure. (#627)
This should surface better info from the 502s we've been seeing (I hope).
2019-09-03 11:52:01 -07:00
Jean-Rémy Bancel 3dd5d66573 Spoof at the Resolver layer, not the Request layer. (#620) 2019-09-03 09:28:00 -07:00
Ajanthan a6e24ef7e5 Fixing ##557 (#558)
Adding ability to pass URL to WaitForEndpointState() in test package.
2019-08-06 08:50:55 -07:00
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -07:00
Dan Gerdesmeier 4ce60b7cde Allow endpoint polling to take request options (#469)
Adds RequestOption and WithHeader functions that allow users to customize
the request options when taking polling actions.

This unblocks Knative Serving to pass user set headers through
in conformance testing.
2019-06-17 18:11:46 -07:00
Markus Thömmes efe322d2ca Remove 'MatchesAny'. (#312) 2019-03-11 05:37:42 -07:00
Markus Thömmes 07cb28db97 Consistently log the full response on errors in tests. (#313)
* Consistently log the full response on errors in tests.

* Remove unnecessary String() call.
2019-03-08 09:50:41 -08:00
Matt Moore cbb16f0f4a Add support for URLs vs. simple domains to WaitForEndpointState* (#308) 2019-03-06 20:29:40 -08:00
srinivashegde86 2a8c1b0e5a Remove baselogger and use FormatLogger everywhere (#296)
* Remove baselogger and use FormatLogger everywhere

* Fix blank spaces in README

* Fix linting issues

* Fix comment to FormatLogger
2019-02-27 11:29:49 -08:00
Markus Thömmes 374dc8c6ce Make it possible to use 'IsStatusOK' without parentheses. (#291) 2019-02-22 10:16:47 -08:00
Victor Agababov 4a1fba4148 Add a variant of wait for status with explicit timeout. (#290)
* Add a variant of wait for status with explicit timeout.

This permits setting higher timeouts in the performance tests,
which it seems take longer to come to life.

* revert the default timeout change
2019-02-21 11:09:47 -08:00
Matt Moore 729d5ada5f Adapt the spoofing client to take a "FormatLogger" instead of a BaseLogger (#285)
This is a breaking change, that can be fixed up by replacing `logger,` with `logger.Infof,` in the argument lists for these functions.

This is part of a larger cleanup to allow us to use alternate log methods like `t.Logf` in place of `BaseLogger`.
2019-02-18 16:57:45 -08:00
Markus Thömmes eac0dd3596 Add 'MatchesAllOf' to make it possible to combine matchers. (#284) 2019-02-18 14:36:45 -08:00
Markus Thömmes 93989176e0 Fix range expression in 'IsOneOfStatusCodes' to actually match the codes. (#283) 2019-02-18 08:48:46 -08:00
dushyanthsc ec1c8ea324 Metrics logging fix in pkg/test: Issue-3150 (#279)
* Metrics logging fix in pkg/test: Issue-3150

https://github.com/knative/serving/issues/3150 describes the issue
that currently exists in our test logging framework. This change
fixes the problem by prefixing metrics that needs to be emited by
a constant which the logging.ExpoxtSpan method then uses to identify
the spans that needs to be emitted as logs

Note this only fixes part of the issue:
https://github.com/knative/serving/issues/3150
this change needs to be ported to knative serving before the issue
can be closed.

* Update test/logging/logging.go

Adding required lines.

Co-Authored-By: dushyanthsc <43390008+dushyanthsc@users.noreply.github.com>
2019-02-15 13:36:44 -08:00
Markus Thömmes f9ede61d88 Add status matchers to help unify test code. (#278)
* Add status matchers to help unify test code.

* Generalize status code matcher to be able to match multiple codes.
2019-02-15 10:38:44 -08:00
srinivashegde86 8c687df30f Update WaitForEndpointState to return response (#51)
* Update WaitForEndpointState to return response

* remove extra vars
2018-08-23 13:42:59 -07:00
srinivashegde86 8f6a3be149 Update knative/pkg/test (#50) 2018-08-23 12:03:59 -07:00
srinivashegde86 8bdbf4eeb9 Add the common test e2e files (#39)
* Add the common test e2e files

* Update deps

* Add the constants and remove serving related methods
2018-08-13 11:28:56 -07:00