Commit Graph

85 Commits

Author SHA1 Message Date
Jordan Liggitt
3fa8b15636 Revert "Merge pull request 92589 from ii/create-deployment-resource-lifecycle-test" 2020-07-24 00:30:13 -04:00
Kubernetes Prow Robot
8a3fc2d7e2
Merge pull request #92589 from ii/create-deployment-resource-lifecycle-test
Create AppsV1Deployment resource lifecycle test - +6 endpoint coverage
2020-07-23 19:30:23 -07:00
Caleb Woodbine
ee29022ac8 Update test images to use conformance images 2020-07-23 14:07:01 +12:00
Caleb Woodbine
84de375921 Fix error message 2020-07-22 11:17:37 +12:00
Caleb Woodbine
11492f7b91 Add check for Modified after patch; Update checks for scale 2020-07-22 09:57:11 +12:00
Caleb Woodbine
fc8e24c686 Add watchtools.Until for fetching watch events; Remove plain watch 2020-07-22 09:29:09 +12:00
Caleb Woodbine
9c2330db4c Revert ginkgoRecover 2020-07-22 08:48:28 +12:00
Caleb Woodbine
125e839d77 Fix formatting 2020-07-20 13:16:35 +12:00
Caleb Woodbine
b38d7f25fe Remove watch tooling 2020-07-20 11:00:37 +12:00
wawa0210
9d1948a2f5
fix test/e2e/apps staticcheck 2020-07-02 18:14:12 +08:00
Caleb Woodbine
e719b723f7 Update checks and status messages; Remove asserting of status values 2020-06-29 11:08:45 +12:00
Caleb Woodbine
3149247932 Add Deployment resource lifecycle test as-is 2020-06-25 10:29:53 +12:00
Jordan Liggitt
c9638d54d0 Defer ginkgo recovers 2020-06-01 11:02:41 -04:00
Tomas Nozicka
df8994c202 Fix watches in e2e framework 2020-04-23 17:17:26 +02:00
drfish
dfab6b637f Update .import-aliases for e2e test framework 2020-03-25 11:40:02 +08:00
drfish
f4da086cbe Move resource methods from e2e fw to e2e resource fw 2020-03-08 15:27:49 +08:00
Mike Danese
76f8594378 more artisanal fixes
Most of these could have been refactored automatically but it wouldn't
have been uglier. The unsophisticated tooling left lots of unnecessary
struct -> pointer -> struct transitions.
2020-03-05 14:59:47 -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
toyoda
91dca8ff8c Use e2eskipper package in e2e/apps 2020-01-10 15:08:19 +09:00
tanjunchen
2f0e5b262a move functions from e2e/framework/deployment/ to e2e/apps/ and e2e/upgrades 2020-01-02 13:01:09 +08:00
tanjunchen
f19ed6ccfe remove unused code in test/e2e/apps/deployment 2019-12-27 12:57:00 +08:00
danielqsj
6596a14d39 add missing alias of api errors under test 2019-12-26 17:29:38 +08:00
yuxiaobo
4123973726 e2e: move funs of framework/deployment/fixtures.go to e2e/apps/deployment.go
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-12-24 16:23:42 +08:00
Kubernetes Prow Robot
9b840a72c9
Merge pull request #86148 from tanjunchen/use-framework-Equal
test/e2e/: use framework.Equal() replace gomega.Expect(...).To(gomega…
2019-12-17 04:19:59 -08:00
tanjunchen
77a9d4772b move funcs from test/e2e/framework/replicaset to test/e2e/apps 2019-12-13 13:02:02 +08:00
tanjunchen
f786cb07b7 test/e2e/: use framework.Equal() replace gomega.Expect(...).To(gomega.BeTrue()|BeFalse()) 2019-12-13 10:11:47 +08:00
SataQiu
10b173868a move funs of framework/deployment to e2e/apps 2019-12-09 11:30:15 +08:00
wojtekt
5cd06d15d8 Fix deployment e2e test at scale 2019-10-25 12:50:59 +02:00
wojtekt
bf34ba0cdf Fix timeouts for networking tests in large clusters 2019-10-23 14:44:45 +02:00
Dan Winship
52b366457f Add Namespace to e2eservice.TestJig, make all methods use jig namespace and name
Many TestJig methods made the caller pass a serviceName argument, even
though the jig already has a name, and every caller was passing the
same name to each function as they had passed to NewTestJig().

Likewise, many methods made the caller pass a namespace argument, but
only a single test used more than one namespace, and it can easily be
rewritten to use two test jigs as well.
2019-10-18 08:37:19 -04:00
Dan Winship
a0ad420018 Make e2eservice.TestJig methods return errors rather than failing
This is the preferred style for framework methods, and it lets us
write tests to confirm that certain things *don't* work.
2019-10-18 08:36:40 -04:00
Miciah Masters
980b6406b2 Prefer to delete doubled-up pods of a ReplicaSet
When scaling down a ReplicaSet, delete doubled up replicas first, where a
"doubled up replica" is defined as one that is on the same node as an
active replica belonging to a related ReplicaSet.  ReplicaSets are
considered "related" if they have a common controller (typically a
Deployment).

The intention of this change is to make a rolling update of a Deployment
scale down the old ReplicaSet as it scales up the new ReplicaSet by
deleting pods from the old ReplicaSet that are colocated with ready pods of
the new ReplicaSet.  This change in the behavior of rolling updates can be
combined with pod affinity rules to preserve the locality of a Deployment's
pods over rollout.

A specific scenario that benefits from this change is when a Deployment's
pods are exposed by a Service that has type "LoadBalancer" and external
traffic policy "Local".  In this scenario, the load balancer uses health
checks to determine whether it should forward traffic for the Service to a
particular node.  If the node has no local endpoints for the Service, the
health check will fail for that node.  Eventually, the load balancer will
stop forwarding traffic to that node.  In the meantime, the service proxy
drops traffic for that Service.  Thus, in order to reduce risk of dropping
traffic during a rolling update, it is desirable preserve node locality of
endpoints.

* pkg/controller/controller_utils.go (ActivePodsWithRanks): New type to
sort pods using a given ranking.
* pkg/controller/controller_utils_test.go (TestSortingActivePodsWithRanks):
New test for ActivePodsWithRanks.
* pkg/controller/replicaset/replica_set.go
(getReplicaSetsWithSameController): New method.  Given a ReplicaSet, return
all ReplicaSets that have the same owner.
(manageReplicas): Call getIndirectlyRelatedPods, and pass its result to
getPodsToDelete.
(getIndirectlyRelatedPods): New method.  Given a ReplicaSet, return all
pods that are owned by any ReplicaSet with the same owner.
(getPodsToDelete): Add an argument for related pods.  Use related pods and
the new getPodsRankedByRelatedPodsOnSameNode function to take into account
whether a pod is doubled up when sorting pods for deletion.
(getPodsRankedByRelatedPodsOnSameNode): New function.  Return an
ActivePodsWithRanks value that wraps the given slice of pods and computes
ranks where each pod's rank is equal to the number of active related pods
that are colocated on the same node.
* pkg/controller/replicaset/replica_set_test.go (newReplicaSet): Set
OwnerReferences on the ReplicaSet.
(newPod): Set a unique UID on the pod.
(byName): New type to sort pods by name.
(TestGetReplicaSetsWithSameController): New test for
getReplicaSetsWithSameController.
(TestRelatedPodsLookup): New test for getIndirectlyRelatedPods.
(TestGetPodsToDelete): Augment the "various pod phases and conditions, diff
= len(pods)" test case to ensure that scale-down still selects doubled-up
pods if there are not enough other pods to scale down.  Add a "various pod
phases and conditions, diff = len(pods), relatedPods empty" test case to
verify that getPodsToDelete works even if related pods could not be
determined.  Add a "ready and colocated with another ready pod vs not
colocated, diff < len(pods)" test case to verify that a doubled-up pod gets
preferred for deletion.  Augment the "various pod phases and conditions,
diff < len(pods)" test case to ensure that not-ready pods are preferred
over ready but doubled-up pods.
* pkg/controller/replicaset/BUILD: Regenerate.
* test/e2e/apps/deployment.go
(testRollingUpdateDeploymentWithLocalTrafficLoadBalancer): New end-to-end
test.  Create a deployment with a rolling update strategy and affinity
rules and a load balancer with "Local" external traffic policy, and verify
that set of nodes with local endponts for the service remains unchanged
during rollouts.
(setAffinity): New helper, used by
testRollingUpdateDeploymentWithLocalTrafficLoadBalancer.
* test/e2e/framework/service/jig.go (GetEndpointNodes): Factor building the
set of node names out...
(GetEndpointNodeNames): ...into this new method.
2019-10-17 11:52:32 -04:00
Claudiu Belu
b91aa9a5c3 tests: Replaces Redis image with Agnhost
Some tests are using the Redis image, but they do not explicitly need it.
This commit replaces the usage of the Redis image with the Agnhost image
in such test cases.
2019-09-09 00:25:18 -07:00
toyoda
c3fdb5e7d9 Use log functions of core framework on test/e2e/apps 2019-08-26 17:38:11 +09:00
draveness
d3158b2c71 feat: use framework.ExpectNotEqual in e2e test 2019-07-10 21:36:26 +08:00
draveness
0ec95afb76 feat: use framework.ExpectEqual instead of should 2019-07-07 21:07:48 +08:00
Claudiu Belu
c752ea8134 tests: Replaces images used with agnhost (part 3)
Quite a few images are only used a few times in a few tests. Thus,
the images are being centralized into the agnhost image, reducing
the number of images that have to be pulled and used.

This PR replaces the usage of the following images with agnhost:

- audit-proxy
- crd-conversion-webhook
- entrypoint-tester
- inclusterclient
- iperf
- porter
- serve-hostname
2019-06-26 13:33:55 -07:00
Antonio Ojea
410df752cd
Add ipv6 support to [sig-apps] StatefulSet e2e test
Use httpd docker images instead of nginx because they listen
by default both in IPv4 and IPv6
2019-06-23 17:23:28 +02:00
Jordan Liggitt
6ca80760fd Switch test manifests to apps/v1, remove beta workloads calls 2019-06-22 13:58:07 -07: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
2a8bee4b37 add import-alias for k8s.io/api/extensions/v1beta1 2019-06-20 11:40:21 -07:00
Aaron Crickenberger
0aae740ede add import-alias for k8s.io/api/apps/v1 2019-06-20 11:39:40 -07: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
toyoda
4841e5b98c use framework.ExpectNoError() for daemon_set.go and deployment.go in e2e/apps 2019-05-14 08:44:54 +09:00
Kubernetes Prow Robot
389252feae
Merge pull request #77709 from danielqsj/test
replace test error checking with more readable way
2019-05-13 13:15:23 -07:00
danielqsj
f3ea5e5c94 replace test error checking with more readable way 2019-05-10 10:15:45 +08:00
draveness
c045046e5b feat: use framework.ExpectNoError instead in e2e test 2019-05-10 09:53:10 +08:00