Skip to content

Latest commit

 

History

History
128 lines (100 loc) · 6.5 KB

Read-Patch-Status-for-APIService-Test.org

File metadata and controls

128 lines (100 loc) · 6.5 KB

Read Status, Patch & List APIService Test

Progress [1/6]

Identifying an untested feature Using APISnoop

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

With this query you can filter untested endpoints by their category and eligiblity for conformance. e.g below shows a query to find all conformance eligible untested,stable,core endpoints

SELECT
  endpoint,
  -- k8s_action,
  path,
  -- description,
  kind
  FROM testing.untested_stable_endpoint
  where eligible is true
  -- and category = 'core'
  and endpoint ilike '%APIService%'
  order by kind, endpoint desc
  limit 10;
                  endpoint                   |                           path                            |    kind
---------------------------------------------+-----------------------------------------------------------+------------
 replaceApiregistrationV1APIServiceStatus    | /apis/apiregistration.k8s.io/v1/apiservices/{name}/status | APIService
 replaceApiregistrationV1APIService          | /apis/apiregistration.k8s.io/v1/apiservices/{name}        | APIService
 readApiregistrationV1APIServiceStatus       | /apis/apiregistration.k8s.io/v1/apiservices/{name}/status | APIService
 patchApiregistrationV1APIServiceStatus      | /apis/apiregistration.k8s.io/v1/apiservices/{name}/status | APIService
 patchApiregistrationV1APIService            | /apis/apiregistration.k8s.io/v1/apiservices/{name}        | APIService
 listApiregistrationV1APIService             | /apis/apiregistration.k8s.io/v1/apiservices               | APIService
 deleteApiregistrationV1CollectionAPIService | /apis/apiregistration.k8s.io/v1/apiservices               | APIService
(7 rows)

Addressing the following endpoints in this document;

API Reference and feature documentation

The test

Test outline

  1. Using the current e2e test as a template, create an APIService for v1beta1.wardle.example.com
  2. Using the REST client, read the APIService status (readApiregistrationV1APIServiceStatus) and confirm the value of Status.Conditions.Message.
  3. Using the REST client, patch the APIService versionPriority (patchApiregistrationV1APIService) before confirming that it has been updated.
  4. Using the REST client, list all APIServices in the cluster (listApiregistrationV1APIService) before confirming that v1beta1.wardle.example.com can be found.
  5. Clean up APIService resources used by the test.

Test the functionality in Go

Due to the complexity of setting up the resources for APIService we have used the current e2e test as template. It has been extended in a new ginkgo test for review.

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,82) AS useragent
from testing.audit_event
where endpoint ilike '%ApiregistrationV1APIService%'
and release_date::BIGINT > round(((EXTRACT(EPOCH FROM NOW()))::numeric)*1000,0) - 60000
and useragent like 'e2e%'
order by endpoint
limit 10;
               endpoint                |                                     useragent
---------------------------------------+------------------------------------------------------------------------------------
 createApiregistrationV1APIService     | Should be able to support the 1.17 Sample API Server using the current Aggregator2
 deleteApiregistrationV1APIService     | Should be able to support the 1.17 Sample API Server using the current Aggregator2
 listApiregistrationV1APIService       | Should be able to support the 1.17 Sample API Server using the current Aggregator2
 patchApiregistrationV1APIService      | Should be able to support the 1.17 Sample API Server using the current Aggregator2
 readApiregistrationV1APIService       | Should be able to support the 1.17 Sample API Server using the current Aggregator2
 readApiregistrationV1APIServiceStatus | Should be able to support the 1.17 Sample API Server using the current Aggregator2
(6 rows)

Endpoint coverage change:

Based on the initial APIsnoop query and the results listed above there are three new endpoints hit.

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