Skip to content

Latest commit

 

History

History
148 lines (117 loc) · 6.68 KB

CoreV1ResourceQuotaStatusTest.org

File metadata and controls

148 lines (117 loc) · 6.68 KB

Create CoreV1 ResourceQuota Status Test - +3

Progress [6/6]

Identifying an untested feature Using APISnoop

According to this APIsnoop query, there are still three remaining ResourceQuota status endpoints which are untested.

SELECT
  endpoint,
  path,
  kind
  FROM testing.untested_stable_endpoint
  where eligible is true
  and endpoint ilike '%ResourceQuota%'
  order by kind, endpoint desc
  limit 10;
                  endpoint                  |                            path                             |     kind
--------------------------------------------+-------------------------------------------------------------+---------------
 replaceCoreV1NamespacedResourceQuotaStatus | /api/v1/namespaces/{namespace}/resourcequotas/{name}/status | ResourceQuota
 readCoreV1NamespacedResourceQuotaStatus    | /api/v1/namespaces/{namespace}/resourcequotas/{name}/status | ResourceQuota
 patchCoreV1NamespacedResourceQuotaStatus   | /api/v1/namespaces/{namespace}/resourcequotas/{name}/status | ResourceQuota
(3 rows)

API Reference and feature documentation

Test outline

Feature: Test patch, replace and read ResoureQuota Status api endpoints
  • patchCoreV1NamespacedResourceQuotaStatus
Scenario: the test patches a ResourceQuota Status
  Given the e2e test has created a resource quota with a set of confirmed hard limits (cpu & memory)
  And a patched status with an updated cpu hard limit
  When the test patches the Resource Quota Status
  Then the requested action is accepted without any error
  And the newly applied status hard limit for cpu is found
  • replaceCoreV1NamespacedResourceQuotaStatus
Scenario: confirm that the replace action will apply changes to a ResourceQuota Status
  Given the e2e test has a ResourceQuota after the "patch" scenario
  And a new set of hard limits for cpu and memory have been generated
  When the test updates the ResourceQuota
  Then the requested action is accepted without any error
  And the newly applied status hard limits are both found
  • readCoreV1NamespacedResourceQuotaStatus
Scenario: the test reads a ResourceQuota Status
  Given the e2e test has a ResourceQuota after the "replace" scenario
  When the test reads the ResourceQuota Status
  Then the requested action is accepted without any error
  And the status hard limits are confirmed as unchanged

E2E Test

Using a number of existing e2e test practices a new ginkgo test has been created for 3 ResourceQuota Status endpoints. The e2e logs for this test are listed below.

[It] should apply changes to a resourcequota status
  /home/ii/go/src/k8s.io/kubernetes/test/e2e/apimachinery/resource_quota.go:990
STEP: Creating a ResourceQuota 08/22/22 14:33:27.541
Aug 22 14:33:27.548: INFO: Resource quota "e2e-quotastatus-44qxm" reports a hard cpu limit of 500m
Aug 22 14:33:27.548: INFO: Resource quota "e2e-quotastatus-44qxm" reports a hard memory limit of 500Mi
STEP: patching /status 08/22/22 14:33:27.548
Aug 22 14:33:27.554: INFO: Resource quota "e2e-quotastatus-44qxm" reports a hard cpu status of 750m
STEP: updating /status 08/22/22 14:33:27.554
Aug 22 14:33:27.561: INFO: Resource quota "e2e-quotastatus-44qxm" reports a hard cpu status of 1500m
Aug 22 14:33:27.561: INFO: Resource quota "e2e-quotastatus-44qxm" reports a hard memory status of 1000Mi
STEP: get /status 08/22/22 14:33:27.561
Aug 22 14:33:27.565: INFO: Resource quota "e2e-quotastatus-44qxm" reports a hard cpu status of 1500m
Aug 22 14:33:27.565: INFO: Resource quota "e2e-quotastatus-44qxm" reports a hard memory status of 1000Mi

Verifying increase in coverage with APISnoop

Listing endpoints hit by the new e2e test

This query shows which Resource Status endpoints are hit within a short period of running this e2e test

select distinct  endpoint, right(useragent,46) AS useragent
from testing.audit_event
where endpoint ilike '%ResourceQuotaStatus'
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
--------------------------------------------+------------------------------------------------
 patchCoreV1NamespacedResourceQuotaStatus   | should apply changes to a resourcequota status
 readCoreV1NamespacedResourceQuotaStatus    | should apply changes to a resourcequota status
 replaceCoreV1NamespacedResourceQuotaStatus | should apply changes to a resourcequota status
(3 rows)

Final notes

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

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


/sig testing

/sig architecture

/area conformance