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

Adds a Golang version of e2e Basic workflow that can execute locally #121

Merged
merged 2 commits into from
Jun 12, 2019

Conversation

maximilien
Copy link
Contributor

@maximilien maximilien commented May 17, 2019

  1. creates a namespace ‘kne2etests’ (default name, change setting env in test/e2e-tests-local.sh)
  2. executes kn commands as per Basic workflow doc (in namespace)
  3. verifies each command output
  4. deletes the kne2etests namespace

Finishes #114 for Basic workflow

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 17, 2019
test/e2e-tests-local.sh Show resolved Hide resolved
test/e2e-tests-local.sh Outdated Show resolved Hide resolved
@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-client-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
test/e2e/e2e.go Do not exist 33.3%
test/e2e/env.go Do not exist 87.5%
test/e2e/kn.go Do not exist 64.0%
test/e2e/kubectl.go Do not exist 68.2%

test/e2e/basic_workflow_test.go Outdated Show resolved Hide resolved
test/e2e/kubectl.go Outdated Show resolved Hide resolved
@adrcunha
Copy link
Contributor

Now just replace that call to kn in e2e-tests.sh and your new Go tests will run against the test cluster and report correctly in Gubernator and TestGrid:

go_test_e2e ./test/e2e

test/e2e-tests.sh Outdated Show resolved Hide resolved
@adrcunha
Copy link
Contributor

/lint

Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@adrcunha: 16 warnings.

In response to this:

/lint

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.

test/e2e/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl.go Outdated Show resolved Hide resolved
test/e2e/kubectl.go Outdated Show resolved Hide resolved
test/e2e/basic_workflow_test.go Outdated Show resolved Hide resolved
test/e2e/common.go Outdated Show resolved Hide resolved
test/e2e/env.go Outdated Show resolved Hide resolved
test/e2e/kn.go Outdated Show resolved Hide resolved
test/e2e/kn.go Outdated Show resolved Hide resolved
test/e2e/kn.go Outdated Show resolved Hide resolved
test/e2e/kn.go Outdated Show resolved Hide resolved
@maximilien
Copy link
Contributor Author

/lint

Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@maximilien: 2 unresolved warnings and 2 new warnings.

In response to this:

/lint

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.

test/e2e/e2e.go Outdated Show resolved Hide resolved
test/e2e/env.go Outdated Show resolved Hide resolved
@maximilien maximilien force-pushed the e2e-local-tests branch 2 times, most recently from 590d41b to 2a13b2a Compare May 17, 2019 07:01
@maximilien
Copy link
Contributor Author

/lint

Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@maximilien: 1 unresolved warnings and 3 new warnings.

In response to this:

/lint

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.

test/e2e/e2e.go Outdated Show resolved Hide resolved
test/e2e/e2e.go Outdated Show resolved Hide resolved
test/e2e/env.go Outdated Show resolved Hide resolved
@maximilien
Copy link
Contributor Author

/lint

Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@maximilien: 3 unresolved warnings and 0 new warnings.

In response to this:

/lint

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.

@maximilien
Copy link
Contributor Author

/lint

Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@maximilien: 1 unresolved warning and 0 new warning.

In response to this:

/lint

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.

@maximilien
Copy link
Contributor Author

/lint

I have to figure out how to run this locally :(

Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@maximilien: 0 warnings.

In response to this:

/lint

I have to figure out how to run this locally :(

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.

@maximilien
Copy link
Contributor Author

/retest

@maximilien
Copy link
Contributor Author

/retest

Seems like the built kn is not accessible. Let me add . to the path since current test/e2e-tests.sh refers to the kn executable with ./kn ...

@maximilien maximilien force-pushed the e2e-local-tests branch 3 times, most recently from d86c514 to 7c222b9 Compare June 7, 2019 20:26
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 7, 2019
@maximilien
Copy link
Contributor Author

@sixolet seems like success finally!


dir=$(dirname "${BASH_SOURCE[0]}")
base=$(cd "$dir/.." && pwd)
export PATH=$PATH:$base
Copy link
Contributor

Choose a reason for hiding this comment

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

Just do

export PATH=$PATH:${REPO_ROOT_DIR}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, cool.

test/e2e-tests.sh Show resolved Hide resolved
1. creates a namespace 'kne2etests' (default name, change with env KN_E2E_NAMESPACE)
2. executes kn commands as per Basic workflow doc in said namespace
3. verifies each command's output
4. deletes the 'kne2etests' namespace
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 7, 2019
@rhuss
Copy link
Contributor

rhuss commented Jun 11, 2019

Because I stumbled upon in https://github.com/docker/cli/blob/master/e2e/container/kill_test.go, @maximilien have you considered https://github.com/gotestyourself/gotest.tools which seems to have nice support for executing external commands.

@maximilien
Copy link
Contributor Author

Because I stumbled upon in https://github.com/docker/cli/blob/master/e2e/container/kill_test.go, @maximilien have you considered https://github.com/gotestyourself/gotest.tools which seems to have nice support for executing external commands.

No, I have not. Will take a look. I however, want to address what's holding this PR to being merged and then do any refactoring in future. I believe last feedback is from @cppforlife on unnecessary imports that ./test/presubmit-tests.sh introduced. A problem I thought was fixed. But will attempt to remove the imports, though I believe CI will fail... Anyhow, I will confirm here.

@maximilien
Copy link
Contributor Author

gotest.tools on first glance looks pretty cool @rhuss. I can see some aspect I could use immediately, e.g., the fake FS and env. But it can definitely be added after. So perhaps as I submit future PR I will try to add this to any integration tests and give it a test drive.

cc: @cppforlife since the Fake FS brought back some BOSH utils FakeFS memories :)

@maximilien
Copy link
Contributor Author

/test pull-knative-client-integration-tests

@maximilien
Copy link
Contributor Author

@sixolet @cppforlife this is ready to merge. I will create following issues to look into any refactoring that is needed. I need this to merge to add more integration tests as I prepare to submit first PR on plugins. Let me know your thoughts if not ready for /lgtm label. Thx.

@sixolet
Copy link
Contributor

sixolet commented Jun 12, 2019

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 12, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maximilien, sixolet

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 Jun 12, 2019
@knative-prow-robot knative-prow-robot merged commit 39d9947 into knative:master Jun 12, 2019
maximilien added a commit to maximilien/client that referenced this pull request Jun 17, 2019
…native#121)

1. creates a namespace 'kne2etests' (default name, change with env KN_E2E_NAMESPACE)
2. executes kn commands as per Basic workflow doc in said namespace
3. verifies each command's output
4. deletes the 'kne2etests' namespace
maximilien added a commit to maximilien/client that referenced this pull request Jun 17, 2019
Implements Kn plugins re-using some code from kubectl plugins.
This is WIP to allow concrete discussions and testing and
hopefully also allow sub tasks to be created and worked on
in parallel.

This version contains the following:

1. wraps the main root Kn command to support plugin
2. plugins are any executable in PATH with name kn-*
3. 'kn plugins list' to list found kn plugins
4. skips any kn plugins found with name that match core
   commands, e.g., kn-service would be ignored
5. execute any valid kn plugins found

And is missing:

1. unit and integration tests
2. plugin install command
3. plugin repository command
4. plugin / Knative server version negotiation
5. anything else we agree on in plugin req doc

Adds a Golang version of e2e Basic workflow that can execute locally (knative#121)

1. creates a namespace 'kne2etests' (default name, change with env KN_E2E_NAMESPACE)
2. executes kn commands as per Basic workflow doc in said namespace
3. verifies each command's output
4. deletes the 'kne2etests' namespace

Fix typo in README.md (knative#181)

Renames service 'get' to 'list' (knative#179)

* Renames service 'get' to 'list'

 As per title.

* Renames get references to list in e2e tests

* Replaces get to list in docs

Renames revision 'get' to 'list' (knative#180)

* Renames revision 'get' to 'list'

 As per title.

* Renames revision get references to revision list in docs

feat(build.sh) - Add mandatory license check (knative#187)

We could decide to make that optional, too, if this is coming into the way.

Chore: Fix typos in docs (knative#178)

fix(service update): Print success message after successful update (knative#169)

* fix(service update): Print success message after successful update

* chore(service update): Improve test, revert unneeded changes

[WIP] Kn plugins implementation

Implements Kn plugins re-using some code from kubectl plugins.
This is WIP to allow concrete discussions and testing and
hopefully also allow sub tasks to be created and worked on
in parallel.

This version contains the following:

1. wraps the main root Kn command to support plugin
2. plugins are any executable in PATH with name kn-*
3. 'kn plugins list' to list found kn plugins
4. skips any kn plugins found with name that match core
   commands, e.g., kn-service would be ignored
5. execute any valid kn plugins found
6. started adding UTs for plugin commands and files
7. rebased with latest HEAD

And is missing:

1. integration tests
2. plugin install command
3. plugin repository command
4. plugin / Knative server version negotiation
5. anything else we agree on in plugin req doc
maximilien added a commit to maximilien/client that referenced this pull request Jun 18, 2019
Implements Kn plugins re-using some code from kubectl plugins.
This is WIP to allow concrete discussions and testing and
hopefully also allow sub tasks to be created and worked on
in parallel.

This version contains the following:

1. wraps the main root Kn command to support plugin
2. plugins are any executable in PATH with name kn-*
3. 'kn plugins list' to list found kn plugins
4. skips any kn plugins found with name that match core
   commands, e.g., kn-service would be ignored
5. execute any valid kn plugins found
6. UTs for plugin and plugin list commands

And is missing:

1. integration tests
2. plugin install command
3. plugin repository command
4. plugin / Knative server version negotiation
5. anything else we agree on in plugin req doc

Adds a Golang version of e2e Basic workflow that can execute locally (knative#121)

1. creates a namespace 'kne2etests' (default name, change with env KN_E2E_NAMESPACE)
2. executes kn commands as per Basic workflow doc in said namespace
3. verifies each command's output
4. deletes the 'kne2etests' namespace
@maximilien maximilien deleted the e2e-local-tests branch December 20, 2019 02:18
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. 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.

9 participants