Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial behavior examples for conformance #85960

Merged
merged 1 commit into from Feb 2, 2020

Conversation

johnbelamaric
Copy link
Member

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
Updates to the conformance tooling as defined in this KEP.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:
This is a work-in-progress, the spec.yaml and readiness-gates.yaml are the furthest along.

The initial files were generated with kubetestgen and from there I re-oraganized and tweaked them. Files in this format will eventually become the standard description of what conformant Kubernetes is, and the tests will just validate these behaviors. Behaviors may be flagged with a Provisional status, to indicate that they are desired behaviors but we do not yet have a test that covers them. This will be helpful during the transition, although it likely will be needed for quite some time as we backfill tests.

The KEP describes linking the tests and the behaviors throught a tests.yaml file, but instead I think it will be easier just to add a section to the conformance test meta-data:

 /*
  Testname: Create and Delete a Pod with a Single Container and Default Values
  Description: This test creates a pod with a single container in and otherwise default PodSpec values, then deletes it. The Pod must be scheduled to a node and the container enter Running state. The Pod must be deleted and the terminationGracePeriod default of 30 seconds respected.
  Behaviors:
   - pods/basic-create
   - pods/basic-delete
*/

The test runner then can emit the covered behaviors, simplifying producing a report of whether a given cluster is conformant. All non-provisional behaviors must be hit in the test run; this avoids "missing" tests going undetected.

We should consider how to divide the meta-data between the YAML and the test comment. For example, "version" in the YAML would apply to what Kubernetes version expects that behavior. Version in the test comment may refer to when the test was added, if we believe we need it at all.

The expectation is that we can define the list of behaviors up front, much more rapidly than we can define and write the tests themselves. We must therefore decide whether clusters that pass all existing tests but demonstrably do not meet Provisional behaviors are conformant. I would suggest they are not.

We still need the manual review process for any tests that claims to be hitting conformance behaviors. The reviewers must be careful to ensure that any implicit behaviors that are relied upon by a conformance test are also conformant. I don't see any way to automate that. However, the pool of reviewers/approvers for those tests can be much wider than the pool of reviewers/approvers for the behaviors themselves.

Does this PR introduce a user-facing change?:

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Dec 5, 2019
@k8s-ci-robot k8s-ci-robot added area/conformance Issues or PRs related to kubernetes conformance tests area/test sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 5, 2019
@johnbelamaric
Copy link
Member Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 5, 2019
@johnbelamaric
Copy link
Member Author

@@ -0,0 +1,205 @@
- suite: pods/affinity
level: ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this field generated? It doesn't seem to be in our yaml spec.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 28, 2020
@johnbelamaric
Copy link
Member Author

/retitle Initial behavior examples for conformance

@k8s-ci-robot k8s-ci-robot changed the title [WIP] PodSpec behaviors Initial behavior examples for conformance Jan 28, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 28, 2020
@johnbelamaric
Copy link
Member Author

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jan 28, 2020
Copy link
Member

@Jefftree Jefftree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't comment on the actual behaviors, but left a few notes for file format and structure.

@@ -35,5 +35,7 @@ type Behavior struct {
APIObject string `json:"apiObject,omitempty"`
APIField string `json:"apiField,omitempty"`
APIType string `json:"apiType,omitempty"`
Version string `json:"version,omitempty"`
Status string `json:"status,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this field for? It doesn't seem to be used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to be able to have provisional behaviors that we know should be part of conformance but that we also know are not covered yet. In order to be conforming, a cluster needs to meet the required behaviors. That is, we want to be able to define the behaviors before the tests are ready.

I can add in a value for this for all the behaviors in this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack. I'm worried this might introduce human error where we forget to remove this even after writing a test. Personally, I feel that the CI tooling should be able to determine this when generating the behavior <> test mapping. At the same time though, if it's defined here, coverage should be extremely easy to compute.

@@ -35,5 +35,7 @@ type Behavior struct {
APIObject string `json:"apiObject,omitempty"`
APIField string `json:"apiField,omitempty"`
APIType string `json:"apiType,omitempty"`
Version string `json:"version,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we prepend v1.18 (or whatever the version should be) to all the behaviors we're adding?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Good question. Most of these behaviors have been around for a long, long time. But once we transition to the behavior model, then it will really only apply to those newer versions. I had put in v1.14 for the readiness gates; that's when it went GA. But it would be easier to just make them all v1.18, since no earlier cluster would be subject to these rules.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I just remove API* fields? They were intended to provide context / help with regeneration when using kubetestgen. But at least for now we're not really re-generating things, but instead just using them for bootstrapping. Different PR though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's helpful in certain situations when we're just enumerating over one field (eg service type)...although we should probably be more explicit in specifying which fields are mandatory vs optional.

Different PR, I agree.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up removing version and status for now, we can deal with that later. I also simplified the initial lists of behaviors.

@@ -0,0 +1,16 @@
- suite: pods/readinessGates
level: ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed

@@ -0,0 +1,45 @@
suite: services/spec
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's be consistent in the file and suite name. Either services-spec.yaml or service/spec for suite name

@@ -0,0 +1,16 @@
- suite: pods/readinessGates
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about consistency in file and suite name.

@@ -0,0 +1,103 @@
suite: pods/spec
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about consistency in file and suite name.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 31, 2020
Organizes the behaviors directory based on SIG, and provides a few
example behavior descriptions for Pods and Services to start. Note
that these are very incomplete lists of behaviors at this point.
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnbelamaric

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@johnbelamaric
Copy link
Member Author

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 31, 2020
@Jefftree
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 31, 2020
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

10 similar comments
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit 2a17cfb into kubernetes:master Feb 2, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/conformance Issues or PRs related to kubernetes conformance tests area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants