Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write Pod- & SeviceProxy Test - +12 endpoint coverage #92949

Closed
7 tasks done
riaankleinhans opened this issue Jul 10, 2020 · 13 comments · Fixed by #94786 or #106880
Closed
7 tasks done

Write Pod- & SeviceProxy Test - +12 endpoint coverage #92949

riaankleinhans opened this issue Jul 10, 2020 · 13 comments · Fixed by #94786 or #106880
Assignees
Labels
area/conformance Issues or PRs related to kubernetes conformance tests sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/testing Categorizes an issue or PR as relevant to SIG Testing. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@riaankleinhans
Copy link
Contributor

riaankleinhans commented Jul 10, 2020

Progress [7/7]

Identifying an untested feature Using APISnoop

According to this APIsnoop query, there are still some remaining PodProxyOptions endpoints which are untested.

SELECT
  operation_id,
  -- k8s_action,
  -- path,
  description,
  kind
  FROM untested_stable_core_endpoints
  -- FROM untested_stable_endpoints
  where path not like '%volume%'
  and kind like 'PodProxyOptions'
  and operation_id like '%Proxy'
 ORDER BY kind,operation_id desc
 LIMIT 25
       ;
              operation_id              |               description                |      kind
----------------------------------------|------------------------------------------|-----------------
 connectCoreV1PutNamespacedPodProxy     | connect PUT requests to proxy of Pod     | PodProxyOptions
 connectCoreV1PostNamespacedPodProxy    | connect POST requests to proxy of Pod    | PodProxyOptions
 connectCoreV1PatchNamespacedPodProxy   | connect PATCH requests to proxy of Pod   | PodProxyOptions
 connectCoreV1OptionsNamespacedPodProxy | connect OPTIONS requests to proxy of Pod | PodProxyOptions
 connectCoreV1HeadNamespacedPodProxy    | connect HEAD requests to proxy of Pod    | PodProxyOptions
 connectCoreV1GetNamespacedPodProxy     | connect GET requests to proxy of Pod     | PodProxyOptions
 connectCoreV1DeleteNamespacedPodProxy  | connect DELETE requests to proxy of Pod  | PodProxyOptions
(7 rows)

As the Apiserver proxy requires a trailing slash #4958 these endpoints are redirected to their related PodProxyWithPath endpoints.

API Reference and feature documentation

The mock test

Test outline

  1. Create pod and confirm that the pod is running so that the tested endpoints can be found.

  2. Create a http.Client that checks for a redirect so that status code can be checked

  3. Loop through all http verbs, testing that the pod proxy endpoint returns the required 301 status code.

Test the functionality in Go

Verifying increase in coverage with APISnoop

Discover useragents:

select distinct useragent from audit_event where bucket='apisnoop' and useragent not like 'kube%' and useragent not like 'coredns%' and useragent not like 'kindnetd%' and useragent like 'live%';

List endpoints hit by the test:

select * from endpoints_hit_by_new_test where useragent like 'live%';

Display endpoint coverage change:

select * from projected_change_in_coverage;
   category    | total_endpoints | old_coverage | new_coverage | change_in_number
---------------|-----------------|--------------|--------------|------------------
 test_coverage |             438 |          183 |          183 |                0
(1 row)

Final notes

If a test with these calls gets merged, test coverage will go up by 7 points

This test is also created with the goal of conformance promotion.

After the merger of #95128 the test was updated to cover both the Pod and Service Proxy endpoint. Therefore If a test with these calls gets merged, test coverage will go up by 12 points

connectCoreV1DeleteNamespacedPodProxy
connectCoreV1DeleteNamespacedServiceProxy
connectCoreV1OptionsNamespacedPodProxy
connectCoreV1OptionsNamespacedServiceProxy
connectCoreV1PatchNamespacedPodProxy
connectCoreV1PatchNamespacedServiceProxy
connectCoreV1PostNamespacedPodProxy
connectCoreV1PostNamespacedServiceProxy
connectCoreV1PutNamespacedPodProxy
connectCoreV1PutNamespacedServiceProxy
connectCoreV1HeadNamespacedPodProxy
onnectCoreV1HeadNamespacedServiceProxy


/sig testing
/sig architecture
/area conformance

@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. area/conformance Issues or PRs related to kubernetes conformance tests labels Jul 10, 2020
@riaankleinhans riaankleinhans changed the title Write PodProxyOptions test+promote - +13 endpoint coverage Write PodProxy Redirect Mock Test - +7 endpoint coverage Sep 14, 2020
@riaankleinhans
Copy link
Contributor Author

/assign @heyste

@riaankleinhans riaankleinhans changed the title Write PodProxy Redirect Mock Test - +7 endpoint coverage Write PodProxy Redirect Test - +7 endpoint coverage Sep 21, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 10, 2021
@riaankleinhans
Copy link
Contributor Author

/remove-lifecycle stale
To be revisited in 1.21

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 10, 2021
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 10, 2021
@riaankleinhans
Copy link
Contributor Author

/remove-lifecycle stale
Focus for 1.22

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 11, 2021
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 10, 2021
@riaankleinhans
Copy link
Contributor Author

/remove-lifecycle stale
Focus for 1.23

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 11, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 10, 2021
@riaankleinhans
Copy link
Contributor Author

/remove-lifecycle stale
Focus for 1.23
Will move forward once #95128 merged

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 10, 2021
@riaankleinhans riaankleinhans changed the title Write PodProxy Redirect Test - +7 endpoint coverage Write Pod- & SeviceProxy Redirect Test - +12 endpoint coverage Oct 19, 2021
@riaankleinhans riaankleinhans changed the title Write Pod- & SeviceProxy Redirect Test - +12 endpoint coverage Write Pod- & SeviceProxy Test - +12 endpoint coverage Oct 19, 2021
@riaankleinhans
Copy link
Contributor Author

/open
Waiting for 2 week flake free before promotion

@riaankleinhans
Copy link
Contributor Author

/reopen

@k8s-ci-robot k8s-ci-robot reopened this Oct 25, 2021
@k8s-ci-robot
Copy link
Contributor

@Riaankl: Reopened this issue.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 25, 2021
@riaankleinhans
Copy link
Contributor Author

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/conformance Issues or PRs related to kubernetes conformance tests sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/testing Categorizes an issue or PR as relevant to SIG Testing. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
5 participants