Commit Graph

76 Commits

Author SHA1 Message Date
Clayton Coleman
34bfdc3635
wait: ExponentialBackoffWithContext should take context-aware fn
The condition methods will eventually all take a context. Since we
have been provided one, alter the accepted condition type and
change the four references in tree.

Collers of ExponentialBackoffWithContext should use a condition
aware function (ConditionWithContextFunc). If the context can be
ignored the helper ConditionFunc.WithContext can be used to convert
an existing function to the new type.
2023-01-16 14:57:57 -05: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
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
Joe Betz
7be77f9ecc changes code to improve output for files under test/e2e/storage 2022-09-02 17:43:41 +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
Sergiusz Urbaniak
373c08e0c7
test/e2e/framework: configure pod security admission level for e2e tests 2022-03-28 15:42:10 +02:00
Mauricio Poppe
04805ca330 Add status count to the storage_operation_duration_seconds volume metric 2021-12-03 18:49:49 +00:00
Léiyì Zhang
496ccc06ad skip tests that uses default storage class when there is no default storage class installed 2021-11-17 19:14:16 +00:00
Kubernetes Prow Robot
00aab6312f
Merge pull request #105910 from deads2k/retry-pv-create
retry PV create in e2e-test on API quota failure
2021-10-27 15:23:09 -07:00
Patrick Ohly
194b31019d volume e2e: block volume metrics fix, II
Copying from pvcBlock swapped name and namespace (breaking the PVC test case)
and some references to the pvcBlock variable were left unchanged (incorrect
annotations for test failures).
2021-10-26 17:36:02 +02:00
David Eads
c8f87a6a24 retry PV create in e2e-test on API quota failure 2021-10-26 09:47:16 -04:00
Patrick Ohly
4c7a8c494e volume e2e: block volume metrics fix
The same PVC name handling as for non-block volumes is also needed for block
volumes.
2021-10-25 12:44:58 +02:00
Patrick Ohly
d6aa7e321f storage e2e: fix volume metric test for PVC
The fix for the ephemeral volume
case (7538d089d5) broke the other variant with
PVC because pvc.Name is only set *after* creating the PVC.
2021-10-21 17:09:49 +02:00
Patrick Ohly
7538d089d5 storage e2e: fix volume metric test for generic ephemeral volume
This is a fix for the new test case from
https://github.com/kubernetes/kubernetes/pull/105636 which had to be merged
without prior testing due to not having a cluster to test on and no pull job
which runs these
tests. https://testgrid.k8s.io/sig-storage-kubernetes#gce-serial then showed a
failure.

The fix is simple: in the ephemeral case, the PVC name isn't set in advance in
pvc.Name and instead must be computed. The fix now was tested on a kubetest
cluster in GCE.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2021-10-19 14:01:21 +02:00
Patrick Ohly
3df4cc67de storage e2e: check metrics also for generic ephemeral volumes
It shouldn't make any difference, but it's better to actually test that
assumption.

All existing tests which create pods get converted by skipping the explicit PVC
creation for the ephemeral case and instead modifying the test pod so that it
has a volume claim template with the same spec as the PVC.
2021-10-12 20:29:49 +02:00
Patrick Ohly
5e9076da93 e2e: grab controller and scheduler metrics via port forwarding
The previous approach with grabbing via a nginx proxy had some
drawbacks:
- it did not work when the pods only listened on localhost (as
  configured by kubeadm) and the proxy got deployed on a different
  node
- starting the proxy raced with starting the pods, causing
  sporadic test failures because the proxy was not set up
  properly unless it saw all pods when starting the e2e.test
- the proxy was always started, whether it is needed or not
- the proxy was left running after a test and then the next
  test run triggered potentially confusing messages when
  it failed to create objects for the proxy

The new approach is similar to "kubectl port-forward" + "kubectl get
--raw". It uses the port forwarding feature to establish a TCP
connection via a custom dialer, then lets client-go handle TLS and
credentials.

Somehow verifying the server certificate did not work. As this
shouldn't be a big concern for E2E testing, certificate checking gets
disabled on the client side instead of investigating this further.
2021-06-16 12:02:40 +02:00
Kubernetes Prow Robot
f545438bd3
Merge pull request #101587 from nixpanic/in-tree/block-metrics
Fix a panic for in-tree drivers that partialy support Block volume metrics
2021-05-24 16:18:47 -07:00
Grant Griffiths
564e531aa7 Add Snapshot Controller e2e metric tests
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-05-20 23:29:23 -07:00
Niels de Vos
fd3bbf6f9e Add e2e testing for Block volume metrics
The in-tree drivers support gathering the capacity of the Block volume.
Make sure that Kubelet exposes these for the matching PVCs.
2021-05-20 16:37:12 +02:00
Antonio Ojea
fe5eda9a23 increase pod start timeout for storage tests 2021-02-22 20:51:32 +01:00
10177505
0e0e5a09e3 fix Geting -> Getting 2021-01-26 20:17:34 +08:00
pacoxu
f970b2bd41 remove dup key in test
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2020-12-09 13:16:16 +08:00
Fabio Bertinatto
c82626f96f e2e: use custom timeouts in all storage E2E tests 2020-12-02 15:57:58 -03:00
Tomas Smetana
75574401e7 Add e2e test for the newPV Controller metric 2020-10-26 13:05:06 +01:00
Kenichi Omichi
176c8e219f Avoid DeprecatedMightBeMasterNode() in e2e metrics
As its name, DeprecatedMightBeMasterNode is deprecated.
In e2e metrics, the function was used for knowing master node name to
get metrics from kube-scheduler and kube-controller-manager pods.
This make e2e metrics get these metrics directly by getting those pod
names without calling DeprecatedMightBeMasterNode().
2020-06-25 23:08:24 +00:00
lixiaobing1
2d66e7ecd3 another:Replace framework.Failf with ExpectNoError 2020-06-05 16:43:22 +08:00
drfish
dfab6b637f Update .import-aliases for e2e test framework 2020-03-25 11:40:02 +08:00
Kenichi Omichi
2158989d6f Move WaitForPersistentVolumeDeleted() to e2epv
The function is for persistent volumes and it doesn't have any
reason why it stays in core test framework. So this moves the
function into e2epv package for reducing e2e/framework/util.go
code.
2020-03-24 22:54:07 +00:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Kubernetes Prow Robot
c5d75749c8 Merge pull request #85029 from serathius/remove-prometheus-test-e2e
Remove references to prometheus is test/e2e
2020-02-09 01:27:52 -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
Marek Siarkowicz
30989b648d Remove references to prometheus is test/e2e 2020-02-05 15:54:36 +01:00
Kubernetes Prow Robot
14ed35712c
Merge pull request #87168 from misterikkit/timout-err
storage e2e: Add context to timeout errors
2020-01-15 01:22:32 -08:00
Jonathan Basseri
99a015705b storage e2e: Add context to timeout errors
Many times an e2e test fails with an unexpected error,
"timed out waiting for the condition".

Useful information may be in the test logs, but debugging e2e test
failures will be much faster if we add context to errors when they
happen.

This change makes sure we add context to all errors returned from
helpers like wait.Poll().
2020-01-14 11:45:38 -08:00
yuxiaobo
73fb0ab5ec test/e2e/storage:Use e2eskipper package
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2020-01-13 14:04:10 +08:00
SataQiu
27d645dc5b fix staticcheck failures of test/e2e/storage 2019-12-07 21:32:11 +08:00
tanjunchen
9eda99793d use ExpectEqual of framework in test/e2e/storage 2019-12-03 17:41:49 +08:00
Hemant Kumar
59274b56af Use plugin name for filtering metrics 2019-11-25 23:05:09 -05:00
Marek Siarkowicz
09329b5bbc Remove prometheus references in test/integration
This PR does minimal changes to interface to allow removing all
references to prometheus from `test` directory. In future I would expect
wrapping prometheus samples to provide better abstraction. Changes:

Move generic_metrics.go to testutil/metrics.go
Remove etcd.go as it was not called
Move prometheus label consts to testutil.
2019-10-28 11:40:32 +01:00
WanLinghao
a6f5d99409 Refactor and clean up e2e framework utils. This patch handles test/e2e/framework/pv_util.go file 2019-09-18 17:57:13 +08:00
carlory
910bd000ff use log functions of core framework in the 'test/e2e/storage/*' 2019-09-06 10:26:16 +08:00
alejandrox1
7c161d6a5f Refactoring pod related functions from pv_util to pod pkg
Moving pod related functions from e2e/framework/pv_util.go to
e2e/framework/pod in order to allow refactoring of pv_util.go into its
own package.

Signed-off-by: alejandrox1 <alarcj137@gmail.com>
2019-08-27 12:27:45 -04:00
David Zhu
e194cf24cc Dedupe all Make PVC API object functions into the one MakePersistentVolumeClaim to rule them all 2019-07-23 12:59:00 -07:00
Ben Parees
0feca84ea5 fix parameterization of test error message 2019-07-18 18:28:59 -04:00
draveness
d3158b2c71 feat: use framework.ExpectNotEqual in e2e test 2019-07-10 21:36:26 +08:00
draveness
4c2e77a53e feat: use framework.ExpectEqual in storage e2e test 2019-07-04 22:24:29 +08:00
SataQiu
332be4b1e3 refactor: replace framework.Failf with e2elog.Failf 2019-06-19 17:52:35 +08:00
Jorge Alarcon Ochoa
4969a05327 Refactored pod-related functions from framework/util.go
This a refactoring of framework/utils.go into framework/pod.

Signed-off-by: Jorge Alarcon Ochoa <alarcj137@gmail.com>
2019-05-30 09:30:26 -04:00
danielqsj
629ec7e113 replace test error checking with more readable way 2019-05-10 13:58:09 +08:00