Commit Graph

68 Commits

Author SHA1 Message Date
Patrick Ohly
136f89dfc5 e2e: use error wrapping with %w
The recently introduced failure handling in ExpectNoError depends on error
wrapping: if an error prefix gets added with `fmt.Errorf("foo: %v", err)`, then
ExpectNoError cannot detect that the root cause is an assertion failure and
then will add another useless "unexpected error" prefix and will not dump the
additional failure information (currently the backtrace inside the E2E
framework).

Instead of manually deciding on a case-by-case basis where %w is needed, all
error wrapping was updated automatically with

    sed -i "s/fmt.Errorf\(.*\): '*\(%s\|%v\)'*\",\(.* err)\)/fmt.Errorf\1: %w\",\3/" $(git grep -l 'fmt.Errorf' test/e2e*)

This may be unnecessary in some cases, but it's not wrong.
2023-02-06 15:39:13 +01:00
Antonio Ojea
7f5ae1c0c1
Revert "e2e: wait for pods with gomega" 2023-02-06 12:08:22 +01:00
Patrick Ohly
222f655062 e2e: use error wrapping with %w
The recently introduced failure handling in ExpectNoError depends on error
wrapping: if an error prefix gets added with `fmt.Errorf("foo: %v", err)`, then
ExpectNoError cannot detect that the root cause is an assertion failure and
then will add another useless "unexpected error" prefix and will not dump the
additional failure information (currently the backtrace inside the E2E
framework).

Instead of manually deciding on a case-by-case basis where %w is needed, all
error wrapping was updated automatically with

    sed -i "s/fmt.Errorf\(.*\): '*\(%s\|%v\)'*\",\(.* err)\)/fmt.Errorf\1: %w\",\3/" $(git grep -l 'fmt.Errorf' test/e2e*)

This may be unnecessary in some cases, but it's not wrong.
2023-01-31 13:01:39 +01:00
Patrick Ohly
2f6c4f5eab e2e: use Ginkgo context
All code must use the context from Ginkgo when doing API calls or polling for a
change, otherwise the code would not return immediately when the test gets
aborted.
2022-12-16 20:14:04 +01:00
Patrick Ohly
5614a9d064 e2e framework: eliminate interim sub packages
The "todo" packages were necessary while moving code around to avoid hitting
cyclic dependencies. Now that any sub package can depend on the framework, they
are no longer needed and the code can be moved into the normal sub packages.
2022-10-06 08:16:47 +02:00
Patrick Ohly
2c8ef492ae e2e framework: move kubectl and pod helper code 2022-10-06 08:16:47 +02:00
Humble Chirammal
9e9fc2be88 various corrections in test/e2e package
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2022-09-16 18:59:30 +05:30
Dave Chen
857458cfa5 update ginkgo from v1 to v2 and gomega to 1.19.0
- update all the import statements
- run hack/pin-dependency.sh to change pinned dependency versions
- run hack/update-vendor.sh to update go.mod files and the vendor directory
- update the method signatures for custom reporters

Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-07-08 10:44:46 +08:00
Antonio Ojea
3204572f01 replace echoserver image with agnhost
agnhost contains the same features than echoserver.
2022-06-29 09:49:19 +02:00
ahrtr
fe95aa614c io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
Claudiu Belu
76d20c5bce tests: Use E2E framework deployments
Deployments can be created easier with the NewDeployment
found in test/e2e/framework/deployment.
2021-10-09 06:11:07 -07:00
Antonio Ojea
0cd75e8fec run hack/update-netparse-cve.sh 2021-08-20 10:42:09 +02:00
Antonio Ojea
c822a1f2c6 gcp ingress only supports ImplementationSpecific path type 2021-05-19 11:48:01 +02:00
Antonio Ojea
fa56d296e0 e2e ingress don't set class if empty 2021-05-19 10:23:49 +02:00
Antonio Ojea
7d7179ebfd bump e2e test to ingress v1 2021-05-18 21:42:48 +02:00
卢振兴10069964
4d595b9129 log format optimization 2021-03-22 11:15:25 +08:00
David Eads
64c099d670 remove secondary client retries in e2e tests 2020-10-15 08:30:42 -04:00
tanjunchen
818238ae74 test/e2e/framework/:use the term 'Control Plane' in comment 2020-10-02 08:54:29 -07:00
Maciej Szulik
eec4a04c2d
Use namespace flag passed to RunKubectl* methods 2020-09-11 14:51:03 +02:00
Aaron Crickenberger
28768166f5 decouple testfiles from framework
This drops testfiles.ReadOrDie and updated testfiles.Exists to return an
error, forcing the caller to decide whether to call framework.Fail or do
something else.

It makes for a slightly less friendly API, but also means the package is
decoupled from framework again, as per the comments at the top of the
file
2020-06-29 14:54:09 -07:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Kenichi Omichi
2f5f16004d Move DescribeIng() into e2eingress
The function is only for e2e ingress test, it is not necessary to
keep the function in e2e test core framework.
2020-04-06 20:01:55 +00:00
wojtekt
268b51d023 Cleanup and fix networking test timeouts for large clusters 2020-04-02 17:19:41 +02:00
drfish
dfab6b637f Update .import-aliases for e2e test framework 2020-03-25 11:40:02 +08:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
tanjunchen
9c8d4bedcc test/e2e/framework:remove TODO and make func private 2020-02-17 22:17:54 +08:00
tanjunchen
efec7e64ce remove TODO and use framework.SingleCallTimeout 2020-02-14 01:12:46 +08:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Kubernetes Prow Robot
04498c5955
Merge pull request #87513 from gavinfish/e2e_ingress_manifest
Move IngressFromManifest/IngressToManifest to ingress e2e fw
2020-02-06 17:45:45 -08:00
drfish
527d60edb7 Move IngressFromManifest/IngressToManifest to ingress e2e fw 2020-01-24 15:28:59 +08:00
drfish
1461d8bd13 Move GetPortURL to ingress e2e fw 2020-01-24 14:17:10 +08:00
danielqsj
fc738cbb1d unify alias of api errors under test 2019-12-26 16:40:45 +08:00
MorrisLaw
b85adbf1fd moved WriteFileViaContainer and ReadFileViaContainer to kubectl_utils 2019-12-04 20:31:57 +00:00
Kenichi Omichi
ca4c349096 Move functions from e2e/framework/util.go
- SimpleGET: Moved to ingress sub package of e2e framework
- PollURL: Moved to ingress sub package of e2e framework
- ProxyMode: Moved to service e2e test package
- ListNamespaceEvents: Moved to e2e_node test package
- NewE2ETestNodePreparer: Removed since 59533f0cd1
2019-11-01 17:39:29 +00:00
wojtekt
bf34ba0cdf Fix timeouts for networking tests in large clusters 2019-10-23 14:44:45 +02:00
Dan Winship
52b366457f Add Namespace to e2eservice.TestJig, make all methods use jig namespace and name
Many TestJig methods made the caller pass a serviceName argument, even
though the jig already has a name, and every caller was passing the
same name to each function as they had passed to NewTestJig().

Likewise, many methods made the caller pass a namespace argument, but
only a single test used more than one namespace, and it can easily be
rewritten to use two test jigs as well.
2019-10-18 08:37:19 -04:00
Dan Winship
a0ad420018 Make e2eservice.TestJig methods return errors rather than failing
This is the preferred style for framework methods, and it lets us
write tests to confirm that certain things *don't* work.
2019-10-18 08:36:40 -04:00
Dan Winship
4dcc6229b1 Call jig.SanityCheckService automatically after changes 2019-10-18 08:35:55 -04:00
John Schnake
2dab911ac2 Use imageutils instead of hardcoded image paths
A number of tests were using hardcoded image paths instead of
going through the imageutils package. The reason for centralizing
the logic there is to keep an eye on what images we use and where
they come from.
2019-09-27 15:01:08 -05:00
Matt Matejczyk
532298c399 Adjust nginx lb timeout in tests
In addition delete the service & lb before ending to test to avoid the case
when deleting the namespace times out due to long LB deletion.

Ref.  https://github.com/kubernetes/kubernetes/issues/82695
2019-09-16 13:07:47 +02:00
Matt Matejczyk
bd0691d159 Create LoadBalancer in nginx ingress tests
This should fix the nginx ingress test in private clusters.
See https://k8s-testgrid.appspot.com/sig-scalability-experiments#gce-private-cluster-correctness

Ref. https://github.com/kubernetes/kubernetes/issues/77538
2019-09-06 15:36:54 +02:00
Kubernetes Prow Robot
518ff2a405
Merge pull request #81811 from oomichi/replace-e2elog-framework-deployment-ingress
Use log functions of core framework on [d-i]
2019-08-23 06:54:17 -07:00
Kubernetes Prow Robot
81c0febcd0
Merge pull request #81715 from SataQiu/fix-test-e2e-framework
Fix static check for test/e2e/framework
2019-08-22 23:27:55 -07:00
Kenichi Omichi
20f507fc6a Use log functions of core framework on [d-i]
This makes sub packages of e2e test framework to use log functions
of core framework instead for avoiding circular dependencies.
2019-08-22 22:12:47 +00:00
SataQiu
c60377c682 fix static check for test/e2e/framework 2019-08-21 17:28:36 +08:00
Kenichi Omichi
cd24b24725 Remove fail argument from ReadOrDie()
Every caller of ReadOrDie() specified ginkgo.Fail as fail argument,
and that was intentional to avoid depending on Ginkgo.
However that just spreaded the dependency on Ginkgo to caller sides.
Especially that was unnecessary e2e test framework "ingress" depended
on Ginkgo only for the above reason.
Now we are cleaning up the dependencies on e2e tests, so let's just
remove such dependencies.
2019-08-14 00:35:51 +00:00
draveness
c38ae01f8e feat: move service_util to separated package 2019-07-19 08:32:39 +08:00
Kubernetes Prow Robot
dc8b928136
Merge pull request #79162 from SataQiu/fix-test-20190619
Refactor: replace framework.Failf with e2elog.Failf
2019-06-21 12:17:04 -07:00
Aaron Crickenberger
0aae740ede add import-alias for k8s.io/api/apps/v1 2019-06-20 11:39:40 -07:00