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

Update test/adding_tests.md #6345

Merged
merged 1 commit into from
Jan 7, 2020
Merged

Conversation

MIBc
Copy link
Contributor

@MIBc MIBc commented Dec 27, 2019

Update test/adding_tests.md and test/README.md

Fixes #6239

Proposed Changes

  • update code example
  • update import path

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Dec 27, 2019
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 27, 2019
@knative-prow-robot
Copy link
Contributor

Hi @MIBc. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot knative-prow-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Dec 27, 2019
@knative-prow-robot knative-prow-robot added the area/test-and-release It flags unit/e2e/conformance/perf test issues for product features label Dec 27, 2019
@MIBc
Copy link
Contributor Author

MIBc commented Dec 27, 2019

/assign @adrcunha

Copy link
Contributor

@adrcunha adrcunha left a comment

Choose a reason for hiding this comment

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

Thanks for updating the docs, just a few minor things.

/ok-to-test

test/adding_tests.md Outdated Show resolved Hide resolved
test/adding_tests.md Outdated Show resolved Hide resolved
test/adding_tests.md Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 27, 2019
@@ -49,24 +49,31 @@ See [`knative/pkg/test`](https://github.com/knative/pkg/tree/master/test) to:
These flags are useful for running against an existing cluster, making use of
your existing [environment setup](../DEVELOPMENT.md#setup-your-environment).

By importing `github.com/knative/serving/test` you get access to a global
By importing `knative.dev/pgk/test` you get access to a global
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
By importing `knative.dev/pgk/test` you get access to a global
By importing `knative.dev/pkg/test` you get access to a global

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

- [`--tag`](#using-a-docker-tag)
- [`--ingressendpoint`](#using-a-custom-ingress-endpoint)
- [All flags added by `knative/pkg/test`](https://github.com/knative/pkg/tree/master/test#flags) such as:
- [`--dockerrepo`](#overriding-docker-repo)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these be on the same indentation level as the last three flags?

Copy link
Contributor Author

@MIBc MIBc Jan 3, 2020

Choose a reason for hiding this comment

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

I think knative/pkg/test flag and knative/serving/test flag can be same level.
The --dockerrepo, --tag, --ingressendpoint belong to knative/pkg/test. They are subset of knative/pkg/test flag.
The last three flags are special flag for knative/serving/test.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah got it. Thanks for the clarification!

- `Routes`
- `Configurations`
- `Revisions`
- `Knative ingress`
- `ServerlessServices`
- `Istio objects`

For example, to create a `Route`:

Copy link
Contributor

Choose a reason for hiding this comment

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

This line needs to be updated:

_, err = clients.ServingClient.Routes.Create(test.Route(namespaceName, routeName, configName))

-->

_, err = clients.ServingClient.Routes.Create(v1test.Route(
  test.ResourceNames{
	  	Route:  routeName,
	  	Config: configName,
  	}))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


```go
err = test.WaitForRouteState(clients.ServingClient, routeName, test.AllRouteTrafficAtRevision(routeName, revisionName))
err := v1alpha1testing.WaitForRouteState(clients.ServingClient, routeName, v1alpha1testing.AllRouteTrafficAtRevision(routeName, revisionName))
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be updated because AllRouteTrafficAtRevision takes type ResourceNames as the argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


```go
err := test.WaitForRevisionState(clients.ServingClient, revisionName, test.IsRevisionReady(revisionName))
err := v1alpha1testing.WaitForRevisionState(clients.ServingClient, revisionName, v1alpha1testing.IsRevisionReady(revisionName))
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be updated because IsRevisionReady takes the revision object as the argument, not the name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The WaitForRevisionState also need to be updated.

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 3, 2020
Update test/adding_tests.md and test/README.md

Fixes knative#6239
@MIBc
Copy link
Contributor Author

MIBc commented Jan 5, 2020

Do you have any other comments? @adrcunha

@adrcunha
Copy link
Contributor

adrcunha commented Jan 6, 2020

Do you have any other comments? @adrcunha

I don't, so I'm approving. I'll let @taragu LGTM.

/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrcunha, MIBc

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 6, 2020
@taragu
Copy link
Contributor

taragu commented Jan 7, 2020

/lgtm
Thanks @MIBc for the PR!

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 7, 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/test-and-release It flags unit/e2e/conformance/perf test issues for product features cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test/adding_tests.md is outdated
6 participants