Commit Graph

85 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
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
Patrick Ohly
dfdf88d4fa e2e: adapt to moved code
This is the result of automatically editing source files like this:

    go install golang.org/x/tools/cmd/goimports@latest
    find ./test/e2e* -name "*.go" | xargs env PATH=$GOPATH/bin:$PATH ./e2e-framework-sed.sh

with e2e-framework-sed.sh containing this:

sed -i \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.ExecCommandInContainer(/e2epod.ExecCommandInContainer(\1, /" \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.ExecCommandInContainerWithFullOutput(/e2epod.ExecCommandInContainerWithFullOutput(\1, /" \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.ExecShellInContainer(/e2epod.ExecShellInContainer(\1, /" \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.ExecShellInPod(/e2epod.ExecShellInPod(\1, /" \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.ExecShellInPodWithFullOutput(/e2epod.ExecShellInPodWithFullOutput(\1, /" \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.ExecWithOptions(/e2epod.ExecWithOptions(\1, /" \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.MatchContainerOutput(/e2eoutput.MatchContainerOutput(\1, /" \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.PodClient(/e2epod.NewPodClient(\1, /" \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.PodClientNS(/e2epod.PodClientNS(\1, /" \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.TestContainerOutput(/e2eoutput.TestContainerOutput(\1, /" \
    -e "s/\(f\|fr\|\w\w*\.[fF]\w*\)\.TestContainerOutputRegexp(/e2eoutput.TestContainerOutputRegexp(\1, /" \
    -e "s/framework.AddOrUpdateLabelOnNode\b/e2enode.AddOrUpdateLabelOnNode/" \
    -e "s/framework.AllNodes\b/e2edebug.AllNodes/" \
    -e "s/framework.AllNodesReady\b/e2enode.AllNodesReady/" \
    -e "s/framework.ContainerResourceGatherer\b/e2edebug.ContainerResourceGatherer/" \
    -e "s/framework.ContainerResourceUsage\b/e2edebug.ContainerResourceUsage/" \
    -e "s/framework.CreateEmptyFileOnPod\b/e2eoutput.CreateEmptyFileOnPod/" \
    -e "s/framework.DefaultPodDeletionTimeout\b/e2epod.DefaultPodDeletionTimeout/" \
    -e "s/framework.DumpAllNamespaceInfo\b/e2edebug.DumpAllNamespaceInfo/" \
    -e "s/framework.DumpDebugInfo\b/e2eoutput.DumpDebugInfo/" \
    -e "s/framework.DumpNodeDebugInfo\b/e2edebug.DumpNodeDebugInfo/" \
    -e "s/framework.EtcdUpgrade\b/e2eproviders.EtcdUpgrade/" \
    -e "s/framework.EventsLister\b/e2edebug.EventsLister/" \
    -e "s/framework.ExecOptions\b/e2epod.ExecOptions/" \
    -e "s/framework.ExpectNodeHasLabel\b/e2enode.ExpectNodeHasLabel/" \
    -e "s/framework.ExpectNodeHasTaint\b/e2enode.ExpectNodeHasTaint/" \
    -e "s/framework.GCEUpgradeScript\b/e2eproviders.GCEUpgradeScript/" \
    -e "s/framework.ImagePrePullList\b/e2epod.ImagePrePullList/" \
    -e "s/framework.KubectlBuilder\b/e2ekubectl.KubectlBuilder/" \
    -e "s/framework.LocationParamGKE\b/e2eproviders.LocationParamGKE/" \
    -e "s/framework.LogSizeDataTimeseries\b/e2edebug.LogSizeDataTimeseries/" \
    -e "s/framework.LogSizeGatherer\b/e2edebug.LogSizeGatherer/" \
    -e "s/framework.LogsSizeData\b/e2edebug.LogsSizeData/" \
    -e "s/framework.LogsSizeDataSummary\b/e2edebug.LogsSizeDataSummary/" \
    -e "s/framework.LogsSizeVerifier\b/e2edebug.LogsSizeVerifier/" \
    -e "s/framework.LookForStringInLog\b/e2eoutput.LookForStringInLog/" \
    -e "s/framework.LookForStringInPodExec\b/e2eoutput.LookForStringInPodExec/" \
    -e "s/framework.LookForStringInPodExecToContainer\b/e2eoutput.LookForStringInPodExecToContainer/" \
    -e "s/framework.MasterAndDNSNodes\b/e2edebug.MasterAndDNSNodes/" \
    -e "s/framework.MasterNodes\b/e2edebug.MasterNodes/" \
    -e "s/framework.MasterUpgradeGKE\b/e2eproviders.MasterUpgradeGKE/" \
    -e "s/framework.NewKubectlCommand\b/e2ekubectl.NewKubectlCommand/" \
    -e "s/framework.NewLogsVerifier\b/e2edebug.NewLogsVerifier/" \
    -e "s/framework.NewNodeKiller\b/e2enode.NewNodeKiller/" \
    -e "s/framework.NewResourceUsageGatherer\b/e2edebug.NewResourceUsageGatherer/" \
    -e "s/framework.NodeHasTaint\b/e2enode.NodeHasTaint/" \
    -e "s/framework.NodeKiller\b/e2enode.NodeKiller/" \
    -e "s/framework.NodesSet\b/e2edebug.NodesSet/" \
    -e "s/framework.PodClient\b/e2epod.PodClient/" \
    -e "s/framework.RemoveLabelOffNode\b/e2enode.RemoveLabelOffNode/" \
    -e "s/framework.ResourceConstraint\b/e2edebug.ResourceConstraint/" \
    -e "s/framework.ResourceGathererOptions\b/e2edebug.ResourceGathererOptions/" \
    -e "s/framework.ResourceUsagePerContainer\b/e2edebug.ResourceUsagePerContainer/" \
    -e "s/framework.ResourceUsageSummary\b/e2edebug.ResourceUsageSummary/" \
    -e "s/framework.RunHostCmd\b/e2eoutput.RunHostCmd/" \
    -e "s/framework.RunHostCmdOrDie\b/e2eoutput.RunHostCmdOrDie/" \
    -e "s/framework.RunHostCmdWithFullOutput\b/e2eoutput.RunHostCmdWithFullOutput/" \
    -e "s/framework.RunHostCmdWithRetries\b/e2eoutput.RunHostCmdWithRetries/" \
    -e "s/framework.RunKubectl\b/e2ekubectl.RunKubectl/" \
    -e "s/framework.RunKubectlInput\b/e2ekubectl.RunKubectlInput/" \
    -e "s/framework.RunKubectlOrDie\b/e2ekubectl.RunKubectlOrDie/" \
    -e "s/framework.RunKubectlOrDieInput\b/e2ekubectl.RunKubectlOrDieInput/" \
    -e "s/framework.RunKubectlWithFullOutput\b/e2ekubectl.RunKubectlWithFullOutput/" \
    -e "s/framework.RunKubemciCmd\b/e2ekubectl.RunKubemciCmd/" \
    -e "s/framework.RunKubemciWithKubeconfig\b/e2ekubectl.RunKubemciWithKubeconfig/" \
    -e "s/framework.SingleContainerSummary\b/e2edebug.SingleContainerSummary/" \
    -e "s/framework.SingleLogSummary\b/e2edebug.SingleLogSummary/" \
    -e "s/framework.TimestampedSize\b/e2edebug.TimestampedSize/" \
    -e "s/framework.WaitForAllNodesSchedulable\b/e2enode.WaitForAllNodesSchedulable/" \
    -e "s/framework.WaitForSSHTunnels\b/e2enode.WaitForSSHTunnels/" \
    -e "s/framework.WorkItem\b/e2edebug.WorkItem/" \
    "$@"

for i in "$@"; do
    # Import all sub packages and let goimports figure out which of those
    # are redundant (= already imported) or not needed.
    sed -i -e '/"k8s.io.kubernetes.test.e2e.framework"/a e2edebug "k8s.io/kubernetes/test/e2e/framework/debug"' "$i"
    sed -i -e '/"k8s.io.kubernetes.test.e2e.framework"/a e2ekubectl "k8s.io/kubernetes/test/e2e/framework/kubectl"' "$i"
    sed -i -e '/"k8s.io.kubernetes.test.e2e.framework"/a e2enode "k8s.io/kubernetes/test/e2e/framework/node"' "$i"
    sed -i -e '/"k8s.io.kubernetes.test.e2e.framework"/a e2eoutput "k8s.io/kubernetes/test/e2e/framework/pod/output"' "$i"
    sed -i -e '/"k8s.io.kubernetes.test.e2e.framework"/a e2epod "k8s.io/kubernetes/test/e2e/framework/pod"' "$i"
    sed -i -e '/"k8s.io.kubernetes.test.e2e.framework"/a e2eproviders "k8s.io/kubernetes/test/e2e/framework/providers"' "$i"
    goimports -w "$i"
done
2022-10-06 08:19:47 +02: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
ZhangKe10140699
a945b6f066 Fix:[Flaky test] ci-kubernetes-node-kubelet-serial-cri-o job: [sig-node] Density [Serial] [Slow] create a sequence of pods latency/resource should be within limit when create 10 pods with 50 background pods 2022-06-22 08:14:43 +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
Antonio Ojea
5eb584d1cb
Node tests fixes (#106371)
* capture loop variable

* capture the loop variable and don't fail on not found errors

* capture loop variable

* Revert "Mark restart_test as flaky"

This reverts commit 990e9506de.

* skip e2e node restart test with dockershim

* Update test/e2e_node/restart_test.go

Co-authored-by: Mike Miranda <mikemp96@gmail.com>

* capture loop using index

Co-authored-by: Mike Miranda <mikemp96@gmail.com>
2021-11-14 19:54:47 -08:00
Stephen Augustus
481cf6fbe7
generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
wojtekt
a74737eb03 Mark remaining e2e_node tests with [sig-*] label 2021-02-23 20:11:09 +01:00
Marek Siarkowicz
7d309e0104 Move Kubelet Summary API to staging repo 2020-09-22 18:23:28 +02:00
Ed Bartosh
fa31c2c59c e2e_node: fix node-kubelet-benchmark test
e2e_node tests trigger OOM events on COS versions > 73-11636-0-0
possibly because of this change in the COS v.73-11636-0-0:
 Made containerd run as a standalone systemd service

OOM killer usually kills cadvisor and e2e_node.test processes
causing node-kubelet-benchmark failures.

Decreasing amount of pods from 105 to 90 frees enough memory for
the test to succeed.
2020-06-05 12:51:45 +03:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
tanjunchen
fc3b210ad8 if no cycle dependency , use framework in test/e2e_node subpackage 2020-01-02 15:52:05 +08:00
Haosdent Huang
8d3a8d5a6c e2e: move funs of framework/metrics to e2e_node 2019-12-16 00:27:58 +08:00
Kubernetes Prow Robot
b38dfb3ccb
Merge pull request #85522 from YuikoTakada/local-latencies
Fix func VerifyLatencyWithinThreshold() to local
2019-12-11 14:30:32 -08:00
YuikoTakada
cd7859901c Fix func VerifyLatencyWithinThreshold() to local 2019-12-03 06:53:41 +00:00
SataQiu
d2bdf89a8b fix golint issues in test/e2e_node 2019-11-26 16:26:55 +08:00
Kenichi Omichi
7c23ba1b34 Copy PrettyPrintJSON to core framework
PrettyPrintJSON is most used e2emetrics function and that doesn't seem
specific for metrics. The implementation itself is generic, so it is
nice to move it to core framework for avoiding circular dependency.
2019-09-23 18:10:50 +00:00
carlory
d1290ffdef clean up test code 2019-09-05 23:44:19 +08:00
WanLinghao
92b0310cc5 Refactor and clean up e2e framework utils, this patch handles test/e2e/framework/kubelet_stats.go file 2019-08-01 17:40:02 +08:00
SataQiu
641d330f89 e2e_node: clean up non-recommended import 2019-07-28 12:49:36 +08:00
Kubernetes Prow Robot
63a43402a3
Merge pull request #77532 from WanLinghao/perf_refactor
Refactor and clean up e2e framework utils, this patch handles test/e2e/framework/perf_util.go file
2019-07-25 13:02:45 -07:00
WanLinghao
4c394ddf3b Refactor and clean up e2e framework utils, this patch handles test/e2e/framework/perf_util.go 2019-07-25 09:41:00 +08:00
toyoda
799026a7ee use ExpectEqual in density_test.go 2019-07-22 16:11:11 +09:00
alejandrox1
348fd0805e Refactored metrics-related functions from framework/metrics_util.go
This a refactoring of framework/metrics_utils.go into framework/metrics.

Signed-off-by: alejandrox1 <alarcj137@gmail.com>
2019-07-08 19:35:10 -04: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
Kubernetes Prow Robot
465e96535d
Merge pull request #78836 from dims/verify-import-aliases-during-typecheck
Verify import aliases
2019-06-19 21:11:01 -07:00
SataQiu
332be4b1e3 refactor: replace framework.Failf with e2elog.Failf 2019-06-19 17:52:35 +08:00
Davanum Srinivas
a6f8d575ba
Add kubeletstatsv1alpha1 as the preferred alias for k8s.io/kubernetes/pkg/kubelet/apis/stats/v1alpha1
Change-Id: I05a8390a667dba307c09d95f836e08e0759c12ee
2019-06-15 22:31:51 -04:00
Odin Ugedal
6bb8bb0227
Cleanup e2e_node test style
Remove the use of  Except(err).NotTo(HaveOccured()), and switch to using
framework ramework.ExpectNoError(err)
2019-06-14 17:51:48 +02:00
SataQiu
d3a902ff5b e2e refactor: cleanup Logf form framework/util 2019-05-24 16:39:46 +08:00
Kubernetes Prow Robot
535064773a
Merge pull request #73946 from dashpole/prometheus_core_metrics
Add kubelet resource metrics v1alpha1 endpoint
2019-03-07 22:43:28 -08:00
David Ashpole
6051664c0f add kubelet prometheus resource metrics endpoint 2019-03-07 15:39:37 -08:00
Vu Cong Tuan
c747b7f38d Fix many typos in both code and comments
Signed-off-by: Vu Cong Tuan <tuanvc@vn.fujitsu.com>
2019-02-27 14:41:02 +07:00
danielqsj
79a3eb816c rename latency to duration in metrics 2019-02-18 17:40:04 +08:00
anuj
d05b399261 annotate errors in e2e tests
fixed error message

fixed uppercases

fixed typo
2019-01-23 13:10:04 +05:30
Lucas Käldström
7a840cb4c8
automated: Rename all package references 2018-08-29 19:07:52 +03:00
Yu-Ju Hong
ff62f037b8 Re-tag benchmark tests 2018-05-21 17:52:36 -07:00
Manjunath A Kumatagi
1bb810e749 Use pause manifest image 2018-04-06 11:00:50 +05:30
Shyam Jeedigunta
0f0c754eb4 Get rid of duplicate VerifyPodStartupLatency util in node density tests 2018-03-21 16:58:31 +01:00
Shyam Jeedigunta
b0dd166fa3 Capture different parts of pod-startup latency as metrics 2018-03-21 16:58:25 +01:00
Jeremy L. Morris
e724886ad5 Removed newlines from e2e log statements. 2018-02-17 22:25:38 -05:00
jianglingxia
76e90061a2 reopen #58913 Fix TODO move GetPauseImageNameForHostArch func 2018-01-31 15:06:32 +08:00
Lantao Liu
3d51577327 Fix setting qps in density test. 2018-01-29 19:41:31 +00:00
Kevin
4c8539cece use core client with explicit version globally 2017-10-27 15:48:32 +08:00
tanshanshan
f6ea2a61da improve code 2017-09-28 08:47:22 +08:00
Mik Vyatskov
e79a228a78 Move the sig-instrumentation test to a dedicated folder 2017-08-07 10:33:03 +02:00
gmarek
55880e6b4b Move metrics_grabbert to test/e2e 2017-07-07 13:13:44 +02:00
Chao Xu
60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu
f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00