Skip to content

Latest commit

 

History

History
120 lines (93 loc) · 4.4 KB

ReplaceCoreV1PodTemplateTest.org

File metadata and controls

120 lines (93 loc) · 4.4 KB

Write ReplaceCoreV1PodTemplate Test - +1

Progress [1/6]

Identifying an untested feature Using APISnoop

According to this APIsnoop query, there is still one remaining PodTemplate endpoint which is untested.

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

API Reference and feature documentation

The mock test

Test outline

Feature: Test one Pod Template api endpoint

Scenario: the test replaces a pod template
  Given the e2e test has a pod template
  And an annotation has been created
  When the test replaces the pod template
  Then the requested action is accepted without any error
  And the applied annotation is found

Test the functionality in Go

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

[It] should replace a pod template
  /home/ii/go/src/k8s.io/kubernetes/test/e2e/common/node/podtemplates.go:167
STEP: Create a pod template
STEP: Replace a pod template
Feb 23 11:24:52.893: INFO: Found updated podtemplate annotation: "true"

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 '%PodTemplate'
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
------------------------------------+--------------------------------------------
 createCoreV1NamespacedPodTemplate  | PodTemplates should replace a pod template
 readCoreV1NamespacedPodTemplate    | PodTemplates should replace a pod template
 replaceCoreV1NamespacedPodTemplate | PodTemplates should replace a pod template
(3 rows)

Final notes

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

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


/sig testing

/sig architecture

/area conformance