Commit Graph

25 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
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
wojtekt
93ff0e5c68 Cleanup test/e2e/upgrades directory 2021-03-05 18:19:46 +01:00
drfish
dfab6b637f Update .import-aliases for e2e test framework 2020-03-25 11:40:02 +08:00
Kenichi Omichi
75ca65806d Replace ExpectNoError(fmt.Errorf(..)) with funcs
There were framework.ExpectNoError(fmt.Errorf(..)) calls which just
raise an exception without actual value checks, they just raised the
specified error messages. These usages of framework.ExpectNoError()
seemed a little tricky, so this replaces them with corresponding check
functions for the readability.
2020-03-06 22:00:10 +00: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
tanjunchen
2f0e5b262a move functions from e2e/framework/deployment/ to e2e/apps/ and e2e/upgrades 2020-01-02 13:01:09 +08:00
draveness
ff09cc5405 feat: use framework.ExpectEqual in upgrades and windows e2e test 2019-07-04 09:38:38 +08:00
Aaron Crickenberger
0aae740ede add import-alias for k8s.io/api/apps/v1 2019-06-20 11:39:40 -07:00
Vikas Choudhary
cc8facda70 Pass updated deployment for comparison of replica count 2019-06-19 14:21:42 +05:30
Jorge Alarcon Ochoa
dc619067d9 Refeactored framework deployment utils
This is the continuation of the refactoring of framework/deployment_utils.go
into framework/deployment.

Signed-off-by: Jorge Alarcon Ochoa <alarcj137@gmail.com>
2019-05-03 18:00:53 -04:00
Jorge Alarcon Ochoa
8200ae6279 Refeactored framework deployment utils
xref: #76206

Signed-off-by: Jorge Alarcon Ochoa <alarcj137@gmail.com>
2019-04-24 19:28:03 -04:00
danielqsj
8916ccabaf fix golint failures for test/e2e/upgrades/apps 2019-02-25 13:32:15 +08:00
Manjunath A Kumatagi
1f7f33aaa4 Update the nginx image from hub.docker.com 2018-08-04 05:19:53 +05:30
Anthony Yeh
a6a5190494
test/e2e: Use apps/v1 Deployment/ReplicaSet.
This must be done at the same time as the controller update,
since they share code.
2018-05-22 13:43:06 -07:00
Janet Kuo
1ca6120af3 Move deployment e2e test for rollback with no revision to integration 2017-10-23 18:58:05 -07:00
Jun Xiang Tee
dd3b782058 revamp deployment upgrade test 2017-10-19 12:49:08 -07:00
Manjunath A Kumatagi
ee4d54c70c Port e2e tests for multi architecture 2017-09-01 05:40:52 +05:30
Dr. Stefan Schimanski
83895daed1 Fix printer hack to get a versioned client 2017-08-06 15:30:13 +02:00
Dr. Stefan Schimanski
1910b5a1dd Fix code implicitly casting clientsets to getters 2017-08-06 15:30:13 +02:00
Jun Xiang Tee
3b75093e0a move sig-apps upgrade tests to its directory 2017-07-13 13:53:06 -07:00