Commit Graph

77 Commits

Author SHA1 Message Date
Paulo Gonçalves Lima
d1278a0830 Fix: Improves the log for failing tests in e2e/apps.
Issue #105678
2023-01-28 02:50:32 -03:00
Rafa de Castro
a887a3b4fd
Changed code to improve output messages on error for files under test/e2e/apps (#109944)
* Improving the output of tests in case of error

* Better error message

Also, the condition in the second case was reversed

* Fixing 2 tests whose condition was inverted

* Again I got the conditions wrong

* Sorry for the confusion

* Improved error messages on failures
2023-01-11 02:11:44 -08: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
Aldo Culquicondor
f40debc8c5
Add e2e test to ignore failures with 137 exit code
Change-Id: Iaf71284f34f420f5a30f43aad0bc284c84fc19f9
2022-11-15 14:31:12 -05:00
Michal Wozniak
41285a7c91 Add e2e test for job pod failure policy used to match pod disruption 2022-11-10 15:50:02 +01:00
Michal Wozniak
c803892bd8 Enable the feature into beta 2022-11-09 09:02:40 +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
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
Stephen Heywood
18d33db623 Promote e2e job lifecycle test to Conformance 2022-04-19 09:35:27 +12:00
Stephen Heywood
931ad8944d Fix e2e test, assignment to entry in nil map 2022-04-13 15:24:47 +12:00
Aldo Culquicondor
77d9243623 Retry Job update on conflict
Once JobReadyPods is enabled, the Job status might be updated at a later stage after the pods are running.

Change-Id: I4c13c9e55ab7e11b1f9428d6cf0a560a41be1c6a
2022-04-07 09:38:20 -04:00
Stephen Heywood
c709baa9a0 Promote e2e job status test to Conformance 2022-04-04 13:22:57 +12:00
Sergiusz Urbaniak
373c08e0c7
test/e2e/framework: configure pod security admission level for e2e tests 2022-03-28 15:42:10 +02:00
Stephen Heywood
a1f6b7b7ec Create job lifecycle e2e test
The test validates the following endpoints
- deleteBatchV1CollectionNamespacedJob
- listBatchV1JobForAllNamespaces
- patchBatchV1NamespacedJob
- replaceBatchV1NamespacedJob
2022-03-26 06:58:38 +13:00
Kubernetes Prow Robot
7ae9615760
Merge pull request #108114 from ii/test-job-status
Write Read, Replace, Patch BatchV1NamespacedJobStatus test - +3 endpoint coverage
2022-03-23 22:30:41 -07:00
Kubernetes Prow Robot
f97825e1ce
Merge pull request #107395 from alculquicondor/indexed-job
Graduate IndexedJob to stable
2022-03-23 17:44:41 -07:00
Stephen Heywood
b5edb55bbc Create e2e job status test
e2e test validates the following 3 extra endpoints
- patchBatchV1NamespacedJobStatus
- readBatchV1NamespacedJobStatus
- replaceBatchV1NamespacedJobStatus
2022-03-22 10:26:44 +13:00
David Porter
c70f1955c4
test: Add E2E for job completions with cpu reservation
Create an E2E test that creates a job that spawns a pod that should
succeed. The job reserves a fixed amount of CPU and has a large number
of completions and parallelism. Use to repro github.com/kubernetes/kubernetes/issues/106884

Signed-off-by: David Porter <david@porter.me>
2022-03-16 13:15:03 -04:00
Aldo Culquicondor
2c5d0a273c Graduate IndexedJob to stable
- Lock feature gate to true and schedule for deletion in 1.26
- Remove checks on feature gate
- Graduate E2E test to Conformance

Change-Id: I6814819d318edaed5c86dae4055f4b050a4d39fd
2022-03-15 13:41:06 -04:00
Adhityaa Chandrasekar
ba708e5fc9 graduate SuspendJob to beta
Also adds a label to two existing Job metrics.

Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2021-06-03 18:48:32 +00:00
Aldo Culquicondor
13f10a323c Remove feature label from Indexed Job E2E test 2021-05-20 20:35:32 +00:00
Mengxue Zhang
e64e34e029 specify pod name and hostname in indexed job 2021-05-19 15:30:13 +00:00
Kubernetes Prow Robot
548fb43643
Merge pull request #101292 from AliceZhang2016/job_controller_metrics
Graduate indexed job to beta
2021-05-07 13:31:44 -07:00
Mengxue Zhang
2d2ee6bc3a change default feature gate value of IndexedJob 2021-04-30 14:36:15 +00:00
Kubernetes Prow Robot
3029808c91
Merge pull request #99772 from pacoxu/patch-4
job-e2e: wait exceeds active deadline for 15s
2021-04-23 19:27:35 -07:00
Aldo Culquicondor
e6c3d7b34d Only default Job fields when feature gates are enabled
Also use pointer for completionMode enum
2021-03-12 20:46:52 +00:00
Adhityaa Chandrasekar
a0844da8f7 batch: add suspended job
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2021-03-08 20:08:21 +00:00
Aldo Culquicondor
85448df364 Add E2E test for indexed job 2021-03-04 18:31:35 +00:00
Paco Xu
061579dafc
job-e2e: wait exceeds active deadline for 15s 2021-03-04 18:55:52 +08:00
yodarshafrir1
24010022ef Number of failed jobs should exceed the backoff limit and not big equal.
Remove patch in e2e test of backoff limit due to usage of NumRequeues
2020-08-11 11:06:09 +03:00
Jefftree
ace97738e2 Update formatting of conformance comment 2020-07-29 20:50:44 -07:00
drfish
f4da086cbe Move resource methods from e2e fw to e2e resource fw 2020-03-08 15:27:49 +08:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
toyoda
0c12ae5240 Modify alias of e2e/framework/job to e2ejob 2020-01-17 10:56:05 +09:00
Kubernetes Prow Robot
9d1eb45bc6
Merge pull request #86627 from tnqn/flaky-e2e-job
Fix a flaky e2e test of Job completion
2020-01-11 02:43:36 -08:00
Quan Tian
c84a371f3d Fix a flaky e2e test of Job completion
The test was flaky because it required the job succeeds 3 times with
pseudorandom 50% failure chance within 15 minutes, while there is an
exponential back-off delay (10s, 20s, 40s …) capped at 6 minutes before
recreating failed pods. As 7 consecutive failures (1/128 chance) could
take 20+ minutes, exceeding the timeout, the test failed intermittently
because of "timed out waiting for the condition".

This PR forces the Pods of a Job to be scheduled to a single node and
uses a hostPath volume instead of an emptyDir to persist data across new
Pods.
2020-01-10 16:04:56 +08:00
Kubernetes Prow Robot
de3be348a6
Merge pull request #86640 from tanjunchen/move-code-test/e2e/framework/job
move funcs from test/e2e/framework/job to test/e2e/apps
2019-12-27 19:47:51 -08:00
tanjunchen
794a8668fa move funcs from test/e2e/framework/job to test/e2e/apps 2019-12-27 09:35:30 +08:00
danielqsj
6596a14d39 add missing alias of api errors under test 2019-12-26 17:29:38 +08:00
tanjunchen
f786cb07b7 test/e2e/: use framework.Equal() replace gomega.Expect(...).To(gomega.BeTrue()|BeFalse()) 2019-12-13 10:11:47 +08:00
Benjamin Elder
4967f74599 check that N job pods succceeded instead of exactly N pods existing and succeeding 2019-10-03 11:03:44 -07:00
toyoda
c3fdb5e7d9 Use log functions of core framework on test/e2e/apps 2019-08-26 17:38:11 +09:00
Kubernetes Prow Robot
9e4b126e18
Merge pull request #80550 from spiffxp/promote-jobs-complete-after-restart
Promote job completion after failure e2e test to Conformance
2019-07-25 22:35:58 -07:00
Aaron Crickenberger
e0b9d77609 Promote job completion after failure e2e test to Conformance 2019-07-24 17:17:07 -07:00
Aaron Crickenberger
275b7b2fa0 Promote job pod orphaning/adotion e2e test to Conformance 2019-07-24 16:28:10 -07:00
Kubernetes Prow Robot
de9fb9c61c
Merge pull request #75632 from globervinodhn/correct_testname_backofflimit
Correct test name for existing E2E related to backofflimit in jobs
2019-07-19 12:37:11 -07:00
globervinodhn
c4e324196f correct testname for existing E2E for testing backoff limit for jobs 2019-07-17 21:46:31 +05:30
globervinodhn
7c8b81a30b correct testname for E2E related to active deadline in jobs 2019-07-17 21:42:52 +05:30