Skip to content

Latest commit

 

History

History
119 lines (89 loc) · 4.19 KB

CoreV1NamespaceStatusTest.md

File metadata and controls

119 lines (89 loc) · 4.19 KB

Progress [6/6]

Identifying an untested feature Using APISnoop

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

    SELECT
      endpoint,
      path,
      kind
      FROM testing.untested_stable_endpoint
      where eligible is true
      and endpoint ilike '%NamespaceStatus'
      order by kind, endpoint desc
      limit 10;
             endpoint           |               path               |   kind
  ------------------------------+----------------------------------+-----------
   replaceCoreV1NamespaceStatus | /api/v1/namespaces/{name}/status | Namespace
   readCoreV1NamespaceStatus    | /api/v1/namespaces/{name}/status | Namespace
   patchCoreV1NamespaceStatus   | /api/v1/namespaces/{name}/status | Namespace
  (3 rows)

API Reference and feature documentation

Test Outline

Feature: Test read and patch NamespaceStatus api endpoints
  • readCoreV1NamespaceStatus
Scenario: the test reads a NamespaceStatus
  Given the e2e test has created a namespace
  When the test reads the NamespaceStatus
  Then the requested action is accepted without any error
  And the NamespaceStatus phase is active
  • patchCoreV1NamespaceStatus
Scenario: the test patches a NamespaceStatus
  Given the e2e test has a namespace
  And a patched status condition is created
  When the test patches the NamespaceStatus
  Then the requested action is accepted without any error
  And the newly applied status condition is found

E2E Test

Using a number of existing e2e test practices a new ginkgo test has been created for 2 namespace status endpoints. The e2e logs for this test are listed below.

[It] should apply changes to a namespace status
  /home/ii/go/src/k8s.io/kubernetes/test/e2e/apimachinery/namespace.go:285
STEP: Read namespace status
May  3 09:59:50.308: INFO: status: v1.NamespaceStatus{Phase:"Active", Conditions:[]v1.NamespaceCondition(nil)}
STEP: Patch namespace status
May  3 09:59:50.313: INFO: Status.Condition: v1.NamespaceCondition{Type:"StatusUpdate", Status:"True", LastTransitionTime:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), Reason:"E2E", Message:"Set from an e2e test"}

Verifying increase in coverage with APISnoop

Listing endpoints hit by the new e2e test

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

select distinct  endpoint, right(useragent,42) AS useragent
from testing.audit_event
where endpoint ilike '%NamespaceStatus'
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
----------------------------+--------------------------------------------
 patchCoreV1NamespaceStatus | should apply changes to a namespace status
 readCoreV1NamespaceStatus  | should apply changes to a namespace status
(2 rows)

Final notes

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

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


/sig testing

/sig architecture

/area conformance