Skip to content

Latest commit

 

History

History
106 lines (68 loc) · 3.9 KB

Appsv1StatefulSetStatusLifecycleTest.md

File metadata and controls

106 lines (68 loc) · 3.9 KB

Progress [1/6]

Identifying an untested feature Using APISnoop

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

    SELECT
      endpoint,
      path,
      kind
      FROM testing.untested_stable_endpoint
      where eligible is true
      and endpoint ilike '%StatefulSetStatus'
      order by kind, endpoint desc
      limit 10;
                   endpoint                 |                              path                               |    kind
  ------------------------------------------+-----------------------------------------------------------------+-------------
   replaceAppsV1NamespacedStatefulSetStatus | /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status | StatefulSet
   readAppsV1NamespacedStatefulSetStatus    | /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status | StatefulSet
   patchAppsV1NamespacedStatefulSetStatus   | /apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status | StatefulSet
  (3 rows)

API Reference and feature documentation

The mock test

Test outline

  1. Create a watch to track stateful set events

  2. Create a stateful set with a static label. Confirm that the pods are running.

  3. Get the stateful set status. Parse the response and confirm that the stateful set status conditions can be listed.

  4. Update the stateful set status. Confirm via the watch that the status has been updated.

  5. Patch the stateful set status. Confirm via the watch that the status has been patched.

Test the functionality in Go

Using an existing status lifecycle test as a template for a new ginkgo test for stateful set lifecycle 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,63) AS useragent
from testing.audit_event
where endpoint ilike '%StatefulSetStatus%'
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
------------------------------------------+-----------------------------------------------------------------
 patchAppsV1NamespacedStatefulSetStatus   | [StatefulSetBasic] should validate Statefulset Status endpoints
 readAppsV1NamespacedStatefulSetStatus    | [StatefulSetBasic] should validate Statefulset Status endpoints
 replaceAppsV1NamespacedStatefulSetStatus | [StatefulSetBasic] should validate Statefulset Status endpoints
(3 rows)

Final notes

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

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


/sig testing

/sig architecture

/area conformance