Commit Graph

28 Commits

Author SHA1 Message Date
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
d4729008ef e2e: simplify test cleanup
ginkgo.DeferCleanup has multiple advantages:
- The cleanup operation can get registered if and only if needed.
- No need to return a cleanup function that the caller must invoke.
- Automatically determines whether a context is needed, which will
  simplify the introduction of context parameters.
- Ginkgo's timeline shows when it executes the cleanup operation.
2022-12-13 08:09:01 +01:00
Patrick Ohly
df5d84ae81 e2e: accept context from Ginkgo
Every ginkgo callback should return immediately when a timeout occurs or the
test run manually gets aborted with CTRL-C. To do that, they must take a ctx
parameter and pass it through to all code which might block.

This is a first automated step towards that: the additional parameter got added
with

    sed -i 's/\(framework.ConformanceIt\|ginkgo.It\)\(.*\)func() {$/\1\2func(ctx context.Context) {/' \
        $(git grep -l -e framework.ConformanceIt -e ginkgo.It )
    $GOPATH/bin/goimports -w $(git status | grep modified: | sed -e 's/.* //')

log_test.go was left unchanged.
2022-12-10 19:50:18 +01:00
Piotr Nosek
72faedc291 HPA E2E tests: multiple metrics 2022-09-14 11:16:25 +00:00
Piotr Nosek
e252fcc429 HPA E2E Test: Scale to zero, scale custom CRD 2022-08-31 18:34:52 +00: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
Sergiusz Urbaniak
1495c9f2cd
test/e2e/*: default existing tests to privileged pod security policy
This is to ensure that all existing tests don't break when defaulting
the pod security policy to restricted in the e2e test framework.
2022-04-05 08:41:12 +02:00
Kubernetes Prow Robot
858895da81
Merge pull request #103252 from pacoxu/defer-fix
custom-metrics: do cleanup even if the creation is not full succeed
2022-01-06 12:50:00 -08:00
Joseph Burnett
13ea13a57d Use HPA v2 in E2E tests. 2021-11-10 16:06:03 +00:00
pacoxu
be27d71eeb custom-metrics: do cleanup even if the creation is not full succeed
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-06-28 17:09:02 +08:00
Sai Harsha Kottapalli
a2ef69060a
fix staticcheck failures for test/e2e and test/integration 2021-02-07 23:47:23 +05:30
zhouya0
3b8603acbc Fix e2e autoscaling namespace error 2020-09-16 14:01:44 +08:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59: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
YuikoTakada
c402a4bf65 WIP: use e2eskipper package in test/e2e/autoscaling 2020-01-14 06:03:53 +00:00
MorrisLaw
b85adbf1fd moved WriteFileViaContainer and ReadFileViaContainer to kubectl_utils 2019-12-04 20:31:57 +00:00
clarklee92
11ed53fbcb Use log functions of core framework on test/e2e/autoscaling
This makes sub packages of e2e test autoscaling to use log functions
of core framework instead for avoiding circular dependencies.

Signed-off-by: clarklee92 <clarklee1992@hotmail.com>
2019-09-23 15:30:26 +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
b8d0ce4019 add import-alias for k8s.io/api/core/v1 2019-06-20 11:40:15 -07:00
SataQiu
332be4b1e3 refactor: replace framework.Failf with e2elog.Failf 2019-06-19 17:52:35 +08:00
s-ito-ts
c101f40e18 Fix golint failures of test/e2e/autoscaling 2019-05-20 02:20:39 +00:00
John Schnake
2ede81c2a6 Move node, windows, and autoscaling tests to framework/log
This is part of the transition to using framework/log instead
of the Logf inside the framework package. This will help with
import size/cycles when importing the framework or subpackages.
2019-05-03 13:23:57 -05:00
Jordan Liggitt
fd9e9b01b1 Remove uses of extensions/v1beta1 clients 2018-12-19 11:18:53 -05:00
Weibin Lin
842bd1e1ec update deployment, daemonset, replicaset, statefulset to apps/v1 2018-12-19 10:46:45 -05:00
Joachim Bartosik
b0265bed42 Deflake e2e HPA tests
Tests for scaling down based on external metric are flaky. I think this
is because they:
 - Start with 2 replicas,
 - Export metric value == 1/2 target,
 - Expect scale down to 1.

Since the expected recommendation is exactly 1 it might flake (and with
scale down stabilization any recommendations higher than 1 will
persist).

Change expected value of the metric so recommended size will be lower
than 1. This should make those tests less flaky.
2018-11-02 11:32:22 +01:00
Joachim Bartosik
cb6a8a2564 Deflake HPA tests
- Scale down based on custom metric was flaking. Increase target value
of the metric.
- Scale down based on CPU was flaking during stabilization. Increase
tolerance of stabilization (caused by resource consumer using more CPU
than requested).
2018-10-30 19:27:42 +01:00
Beata Skiba
896cf2180e Add e2e test for external metrics with Stackdriver
Rename the file to note that these are Stackdriver tests in anticipation of tests with fake custom metrics apiserver. Refactor the tests to be more structured.
2018-03-29 20:05:55 +02:00