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 CoreV1NamespaceReplace Test +1 Endpoint #111847

Closed
6 tasks done
Riaankl opened this issue Aug 14, 2022 · 3 comments · Fixed by #111848 or #112308
Closed
6 tasks done

Write CoreV1NamespaceReplace Test +1 Endpoint #111847

Riaankl opened this issue Aug 14, 2022 · 3 comments · Fixed by #111848 or #112308
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

@Riaankl
Copy link
Contributor

Riaankl commented Aug 14, 2022

Progress [6/6]

Identifying an untested feature Using APISnoop

According to this APIsnoop query, there are still a remaining Namespace endpoint which is untested.

    SELECT
      endpoint,
      path,
      kind
      FROM testing.untested_stable_endpoint
      where eligible is true
      and endpoint ilike '%Namespace'
      order by kind, endpoint desc
      limit 10;
          endpoint        |           path            |   kind
  ------------------------+---------------------------+-----------
   replaceCoreV1Namespace | /api/v1/namespaces/{name} | Namespace
  (1 row)

API Reference and feature documentation

Test outline

Feature: Test replace Namespace api endpoint
  • replaceCoreV1Namespace
Scenario: confirm that the replace action will apply the changes to a Namespace
  Given the e2e test has created a Namespace
  And a new label has been generated
  When the test updates the Namespace
  Then the requested action is accepted without any error
  And the newly applied label is found

E2E Test

Using a number of existing e2e test practices a new ginkgo test has been created for 1 Namespace endpoint. The e2e logs for this test are listed below.

[It] should apply an update to a Namespace
  /home/heyste/go/src/k8s.io/kubernetes/test/e2e/apimachinery/namespace.go:286
STEP: Updating Namespace "namespaces-3021"
Jun  8 11:58:02.718: INFO: Namespace "namespaces-3021" now has labels, map[string]string{"e2e-framework":"namespaces", "e2e-run":"4d96a478-b803-4cb6-abc6-eb6019b556f7", "kubernetes.io/metadata.name":"namespaces-3021", "namespaces-3021":"updated", "pod-security.kubernetes.io/enforce":"baseline"}

Verifying increase in coverage with APISnoop

Listing endpoints hit by the new e2e test

This query shows the following endpoints are hit within a short period of running this e2e test

select distinct  endpoint, right(useragent,37) AS useragent
from testing.audit_event
where endpoint ilike '%Namespace'
and release_date::BIGINT > round(((EXTRACT(EPOCH FROM NOW()))::numeric)*1000,0) - 60000
and useragent like 'e2e%should%'
order by endpoint
limit 10;
        endpoint        |               useragent
------------------------+---------------------------------------
 createCoreV1Namespace  | should apply an update to a Namespace
 deleteCoreV1Namespace  | should apply an update to a Namespace
 readCoreV1Namespace    | should apply an update to a Namespace
 replaceCoreV1Namespace | should apply an update to a Namespace
(4 rows)

Final notes

If a test with these calls gets merged, test coverage will go up by 1 point

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


/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 needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 14, 2022
@Riaankl
Copy link
Contributor Author

Riaankl commented Aug 14, 2022

/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 Aug 14, 2022
@Riaankl Riaankl added this to In Progress /Active Issues in conformance-definition Aug 15, 2022
conformance-definition automation moved this from In Progress /Active Issues to Done Aug 26, 2022
@Riaankl
Copy link
Contributor Author

Riaankl commented Aug 28, 2022

/reopen

@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 reopened this Aug 28, 2022
conformance-definition automation moved this from Done to Issues To Triage Aug 28, 2022
@Riaankl Riaankl moved this from Issues To Triage to Issue with PR's soaking in conformance-definition Sep 8, 2022
conformance-definition automation moved this from Issue with PR's soaking to Done Sep 8, 2022
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
2 participants