Commit Graph

138 Commits

Author SHA1 Message Date
Ying Chun Guo e0319177d6
Add E2E tests for trigger (#645)
* add integration test for trigger

* update doc
2020-02-12 06:27:22 -08:00
Navid Shaikh 15dec583ca
Implement human readable output for kn route describe (#643)
* Implement human readable output for kn route describe

 - Keeps the machine readable output
 - Align the command description text, check for single argument, reported error messages and unit tests in service, revision, route, source binding describe commands

* Dont print separate section for owner references

* Print Service heading irrespective of owner.Kind == Service

* Align desc, err msg for trigger, apiserver and cronjob source
2020-02-10 07:46:07 -08:00
David Simansky 8d2ecca7ae
Rename --async to --no-wait and deprecate it (#639)
* Rename --async to --no-wait and deprecate it

* Polish wording of deprecation warning message
2020-02-08 02:52:14 -08:00
Lv Jiawei 16bbfa37ed
Add E2E test for "kn source binding" commands (#634)
Fixes #631

* Add E2E test for "kn source binding" commands.
* Fix typo.
2020-02-07 14:37:14 -08:00
Roland Huß 1b9a76bc31
feature(serving): Update API to serving.knative.dev/v1 (#640)
* feature(serving): Update API to serving.knative.dev/v1

Due to an issue with 0.12.0 (a missing constant) the update also includes an update
to the latest knative-serving  and knative-eventing dependencies from master
(as reflected in version.go)

Signed-off-by: Roland Huß <roland@ro14nd.de>

* fix(serving): Bogus import removed

* fix(serving): Add missing go.sum entry
2020-02-07 02:03:14 -08:00
David Simansky e88a873b27
Add e2e test for cmd and arg options (#637) 2020-02-05 09:50:31 -08:00
Roland Huß 0e5d1a86c8
chore(e2e): Update dependency to eventing v0.12.0 (#628)
* chore(e2e): Update dependency to eventing v0.12.0

* chore: update infa script dependencies

* chore: Update testinfra dep
2020-01-31 02:20:28 -08:00
dr.max 606de80741 fixes(#598): checks for namespace creation instead of waiting (#611) 2020-01-24 13:44:24 -08:00
Navid Shaikh 8c417c1226 Vendor serving v0.12.0 (#618)
- Vendor serving release v0.12.0
 - Update `kn version command` to print serving v0.12.0
 - Update latest release e2e tests script to setup serving v0.12.0

Co-authored-by: Roland Huß <rhuss@redhat.com>
2020-01-22 00:48:23 -08:00
Roland Huß 5001dcdc16 feature(serving): Add --autoscale-window (#614)
* feature(serving): Add --autoscale-window

Fixes #613

* chore: Update help-text for --autoscale-window

* chore: Add missing generated files
2020-01-22 00:18:23 -08:00
Murugappan Chetty de7e3880d4 Fix misleading error message when verb is bad (#589)
* validate sub command verb (#557)

* fix review comments for pr #555

* validate sub commands

* update error message

* use inner args returned by find func

* return appropriate error message for #557

* return appropriate error message for #557

* Revert "fix review comments for pr #555"

This reverts commit 14ea8d2dc6.

* review comments for pr 589

* misleading error message when verb is bad (#557)

* misleading error message when verb is bad (#557)

* misleading error message when verb is bad (#557)
2020-01-19 23:47:04 -08:00
Navid Shaikh 6ab9980e16 chore(e2e): Namespace specific k8s resources for tests (#597)
* chore(e2e): Namespace specific k8s resources for tests

 Completes #576
 - For ApiServer source: ClusteRole and ClusterRoleBinding name(s)
   are now test-namespace specific. They are cleared in test's tearDown method.
 - Use constant prefix as:
  clusterRolePrefix        = "apiserver-role-"
  clusterRoleBindingPrefix = "apiserver-binding-"
 - Use constant ServiceAccountName as:
  testServiceAccount = "apiserver-sa"
 - Rename methods and cleanup.

* Use correct format specifier for error as %v instead of %s
2020-01-10 06:50:56 -08:00
Navid Shaikh b8d571678f chore(e2e): Update tektoncd pipeline release to v0.9.2 (#594)
Fixes #601

 - Also replace deprecated `serviceAccount` with `serviceAccountName`
 - Sync helloworld test image code from https://github.com/knative/docs/tree/master/docs/serving/samples/hello-world/helloworld-go
 - Use local version of buildah task instead of one from catalog, adding `--format=docker` in `buildah bud` command
   - to build and push the image to registry in docker format to match the manifestype `application/vnd.docker.distribution.manifest.v2+json`
 - Update pipeline to add parameter BUILDER_IMAGE and sets it to quay.io/buildah/stable:latest
2020-01-10 03:42:56 -08:00
dr.max a0910db9a9 adds e2e tests for plugins (#591) 2020-01-09 01:25:54 -08:00
Murugappan Chetty 5ecad782d6 review comments for pr 555 (#602) 2020-01-08 15:17:53 -08:00
Martin Gencur 0aa2299818 Remove redundant cleanup in Tekton tests (#600)
* tear down only if the test passes, we want to keep the pods otherwise
so that the dump will show their errors
2020-01-07 10:17:51 -08:00
Lv Jiawei 9de6e612ef Add E2E tests for CronJob source (#599)
Fixes #566
2020-01-07 02:49:51 -08:00
Lv Jiawei e0877da3d6 Delete k8s cluster resource in e2e test (#596)
Fixes #576
2020-01-06 06:59:49 -08:00
Roland Huß b10580ff72 chore(trigger): Cleanup Trigger create API (#561)
* further updates

* chore: Fix calls to apiserver create

* fix namespace issue

* fix
2019-12-17 13:39:04 -08:00
Murugappan Chetty 8a9d8fcc94 Add readme for tests (#554) (#555)
* Add readme for tests (#554)

* add step to run test case selectively

* add step to run test case selectively

* add step to run test case selectively

* add step to run test case selectively

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* review changes for pr #555

* review changes for pr #555

* review changes for pr #555

* review changes for pr #555

* review changes for pr #555

* review changes for pr #555
2019-12-16 23:18:02 -08:00
Navid Shaikh 6ac25cdc00 Add ApiServer source update and describe commands (#556)
* Dont return created ApiServer source object but only error

 - After ApiServer source object is created, we don't need it to pass
   around in caller function.

* Align creating ApiServer source client, removes unit tests

* Add ApiServer source update command

* Rename TestMockKnClient to TestMockKnCronJobSourceClient

* Add mock client for ApiServer Source and its tests

* Add mock unit tests for create, delete and update

* Add e2e tests for apiserver source update

 - Add a test for apiserver source sink update
 - Verify the updated sink name after the apiserver source is created
 - Update resource names in existing tests

* Uses builder pattern for ApiServer source create command

* Update ApiServer source create/update flags and required config

* Uses builder pattern for ApiServer source update command

* Align create/update/delete description and error messages

* Add unit tests for get/create/update/delete in apiserver_client.go

* Update e2e tests expected output per change in commands output

* Golint fixes, Api -> API and add exported method docs

* Rename a test method and source update command description

* Add ApiServer source describe command

 - Add command and unit tests
 - TODO for later: Add 'Controller Selector' section for --verbose
2019-12-16 09:42:01 -08:00
Ying Chun Guo f4b5703972 add apiserver create/delete e2e test (#552) 2019-12-12 09:09:52 -08:00
Navid Shaikh 2c1e5dc88d Selectively run e2e tests for serving, eventing (#547)
- Run only serving specific e2e tests locally
  ```
  E2E_TAGS="serving" ./test/e2e-tests-local.sh
  ```

 - Run only eventing specific e2e tests locally
  ```
  E2E_TAGS="eventing" ./test/e2e-tests-local.sh
  ```

 - Run all e2e tests locally
  ```
  ./test/e2e-tests-local.sh
  ```
2019-12-11 03:58:48 -08:00
Navid Shaikh f0a40d1b4b Vendor eventing v0.11.0 and run tests against it (#546)
- Pin contrib.go.opencensus.io/exporter/stackdriver@59d068f8d8ff5b653916aa30cdc4e13c7f15d56e
 - Pin knative.dev/pkg@release-0.11
 - Move `Destination` from (knative.dev/pkg) v1alpha1 to duckv1beta1
 - Run tests against Eventing v0.11.0
2019-12-11 00:21:48 -08:00
Navid Shaikh 4f0eb99f8e Vendor serving v0.11.0 and run tests against it (#545)
* Vendor serving v0.11.0

* Run tests against serving v0.11.0
2019-12-10 21:14:48 -08:00
Navid Shaikh 7dbb5a5bb0 kn source list-types (builtin types) (#536)
* feat: kn source list-types (builtin types)

 - Only lists the builtin source types
 - Uses client-go dynamic client for listing CRDs
 - Adds DyanmicClient interface to KnParams
 - Adds printing options

* chore(lint): Address golint suggestions

* Rebase and update venodr/modules.txt

* Adds unit tests for DynamicClient in types.go

* Add kn source list-types command in smoke tests

* Constants for the CRD GVR and source identifier label key value

 GVR as:
   - Group: apiextensions.k8s.io
   - Version: v1beta1
   - Resource: customresourcedefinitions
 Label as:
   {"duck.knative.dev/source": "true"}

* Add tests for dynamic client

* Add description about SinkBinding source type

  as - "Binding Pattern for ContainerSource"

* Remove unused imports

* Adds unit tests for list-types command processing

* More unit tests for flags

* Adds e2e tests for kn source list-types

  - also test the YAML output

* Sort the source types while listing them

 - Update the unit tests accordingly

* Add examples

* Add unit tests for CreateDynamicTestKnCommand

* Fix typo in unit tests

* golint fixes

* Updates to vendor/modules.txt after rebase

* Remove the extra lines
2019-12-10 11:20:47 -08:00
Murugappan Chetty 8e010d0cbd service describe command : Move Cluster URL to --verbose from default output (#543)
* move cluster url to verbose in svc desc

* move cluster url to verbose in svc desc
2019-12-09 23:55:46 -08:00
Chi Zhang a8e017b945 remove unused test flag (#540) 2019-12-08 23:16:44 -08:00
Navid Shaikh ed25066cf6 Eventing setup in CI (#538)
* Eventing setup in CI

  - Update test-infra
  - Use library functions for setting up released and latest Eventing
  - Set up Eventing 0.10.2 and nightly release in `latest-release` and default e2e tests CI job respectively

* Fix typo in variable name and update formatting
2019-12-06 10:39:40 -08:00
Martin Gencur 60567a9e37 Integration tests for Tekton (#528)
* Integration tests for Tekton

* Use knative/client instead of fork

* also put back the e2e-tests into its original format where it doesn't
run the tekton tests

* Run ./hack/build.sh with Go 1.12

* Pull buildah and kn tasks directly from catalog

* Revert "Use knative/client instead of fork"

This reverts commit 2ab272f587.

* Revert "Revert "Use knative/client instead of fork""

This reverts commit f14c2105e2.

* Update Tekton to 0.8.0

* Revert "Use knative/client instead of fork"

This reverts commit 2ab272f587.

* Use knative/client instead of fork

This reverts commit 8eb87ada02.

* Export variables after calling initialize

* Run against arbitrary Docker registry

* Conditionally install Tekton

* Use knative/client instead of fork

This reverts commit 3800adbf69.

* Revert "Use knative/client instead of fork"

This reverts commit 71a3d33b5a.

* Simplify passing the flag to test

* Simplify imports
2019-12-06 05:03:39 -08:00
Navid Shaikh 339232b795 fix(e2e): Removes explicit timeout flag in smoke tests (#523)
Fixes #507

 - removes `--wait-timeout` flag, was set to 240 seconds which is lesser than the default timeout (600 seconds)
 - removes duplication of namespace flag in another smoke test command
2019-11-29 04:36:22 -08:00
Navid Shaikh 8de8e58de8 tests: Avoid downloading deps in unit tests (#525)
- Uses custom `unit_tests` function in presubmit-tests.sh to run unit tests
 - Custom function adds a flag `-mod=vendor` in addition to default unit tests runner
 - The deps are already downloaded part of the source repo, mentioned flag uses it (vendor dir)
   and avoids downloading the deps afresh
 - This prevents(in unit tests) the flake we see 'go: error loading module requirements' which occurs
   due to download error
2019-11-29 00:46:23 -08:00
Navid Shaikh 7024933f0a fix(e2e): Removes workaround for ensuring LCR=LRR at client side (#524)
Related to #500

 - The fix for serving#6060 merged (serving#6069), removing the workaround
   at client side e2e tests for additional LCR=LRR check after service update return.
 - Now we expect service status to have LCR=LRR if the service's conditions turned True after last update.
2019-11-28 00:40:22 -08:00
chaodaiG 0efde628cb Remove explicit flag parsing so that it works with go1.13 (#522) 2019-11-27 22:13:22 -08:00
Navid Shaikh 5b7a714021 chore(e2e): Run e2e against latest released serving version v0.10.0 (#501)
- This changeset updates serving version for pull-knative-client-integration-tests-latest-release
 - Serving nightly release is tested in prow job pull-knative-client-integration-tests
2019-11-19 03:52:08 -08:00
Navid Shaikh 35667391ae Verify service status before verifying traffic targets (#508)
- Verify service status LCR=LCR before verifying traffic targets
 - Retry 5 times with 2 seconds delay, else fail the tests
2019-11-19 02:50:07 -08:00
Navid Shaikh 1bcec16b24 Uses BYO revision names for traffic splitting e2e tests (#506)
* Uses BYO revision names for traffic splitting e2e tests

 - Avoid getting the revision name after service create/update using LCR or LRR from service status

* Pauses 3 seconds before verifying actual vs expected traffic targets

 - for traffic splitting e2e tests
 - Check the comment on https://github.com/knative/client/issues/500#issuecomment-554355688
2019-11-15 07:36:02 -08:00
Ying Chun Guo 5fc8197028 Support multiple NAMEs on service delete (#492)
* Support multiple NAMEs on service delete

* add e2e test
2019-11-12 03:02:23 -08:00
Roland Huß e6f15f9b58 fix(service describe): Clarify URL labels (#460)
* fix(service describe): Clarify URL labels

Fixes #459.

* fix: integration test
2019-11-05 21:11:02 -08:00
Naomi Seyfer 4874b9a384 Human-readable revision describe (#475)
* Revision describe rebaseable

* Fix up for rebase

* Some tests

* moretests

* Forgot part of the refactor!

* Fix unit tests

* Change e2e tests and respond to feedback
2019-11-05 17:43:02 -08:00
Gong Zhang f77c034c4a Refine route list output (#407)
- Only show NAME/URL/READY

[issue 350](https://github.com/knative/client/issues/350)
2019-10-22 23:33:27 -07:00
Navid Shaikh df04573590 fix(version): Displays supported APIs and version (#453)
* fix(version): Displays supported APIs and version

 Fixes #404

 ```
  ./kn version
Version:      v20191017-local-6328a73-dirty
Build Date:   2019-10-17 09:55:55
Git Revision: 6328a73
Supported APIs:
- serving.knative.dev/v1alpha1 (knative-serving v0.8.0)
 ```

* Removes ServingVersion feeding from ldflags

 - hardcodes the supported APIs as they're supposed to be updated when we bump deps

* Fixes typo in e2e tests

* Uses array for deterministic order of printing supported APIs
2019-10-18 03:35:18 -07:00
Navid Shaikh 96c8028de1 fix(e2e): Improves the error message upon mismatch of traffic targets (#454)
* fix(e2e): Improves the error message upon mismatch of traffic targets

 Fixes #434
 - The error message now prints the expected/actual length of traffic targets
 - Also prints the actual traffic targets

* Fixes Golint errors

  Golint errors: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...).
2019-10-17 09:32:16 -07:00
Navid Shaikh 039cdfcc09 fix(e2e): Uses serving v0.8.1 in custom prow job (#452)
s/v0.7.1/v0.8.1
2019-10-16 03:16:15 -07:00
Roland Huß a2d1ef7d83 chore(service): Improvements for waiting on service readiness (#431)
* Increased default timeout to 600s. This timeout will be triggered
  only when the Ready condition stays in UNKNOWN for that long. If its
  True or False then the command will return anyway sooner.
  So it makes sense to go for a much longer timeout than 60s
* Enhanced output to indicate the progress

This change needs some updates to the API and introduces a 'MessageCallback'
type which is calle for each intermediate event with the "Ready" condition message.
2019-10-10 06:06:06 -07:00
Navid Shaikh 2f7fa6a7c2 feat(annotations): Adds annotation flag for service create and update (#422)
* feat(annotations): Adds annotation flag for service create and update

  - Adds specified annotations to service object meta and revision template meta
  - Adds --annotation / -a flag to service create and update options
  - User can specify '-' at the end of the annotation key to remove an annotation
  - Adds unit and e2e tests
  - Updates docs and changelog accordingly

* Adds example for service create with annotation

* Adds mock unit tests for service update with annotations

* Removes the short hand -a for annotation flag
2019-10-04 06:40:05 -07:00
Naomi Seyfer b27e366dcb Service describe: information about revision status, tags, latest [created, ready] revisions, and latest traffic (#379)
* Change symbols, add latest and latest ready

* More info on what is latest and tags. Filter annotations and labels.

* Make current tests pass

* More tests

* No longer require Annotations in test

* Add error

* Adjust tests to match adjusted output

* Respond to review comments

* one more

* Fix double printing of revisions + test for it

* Differentiate between latest traffic and latest ready w/o that being reason for traffic

* Re-build with go 1.12

* Rebased

* Limit non-verbose output to error and image

* Fix tests for new format
2019-10-03 11:33:08 -07:00
Naomi Seyfer 0ff537ad98 By default, set `Image` to the image of the prev. revision by digest (#373)
* Option to freeze revision to digest

* Tests pass. Checkpoint.

* Tests for env now check pinning to digest

* Bool flag using convention. Tweak usage.

* Describing the image carefully using the annotation and digest

* lint

* Test matrix of locking to digest behaviors

* Expose both flags, and rewrite help text again

* Unit tests.

* Removed unsed method

* Add tests for getting base revision

* Make tests actually test stuff better

* Make tests actually test stuff better

* A mergeout killed a returning of error. Restore it

* Help text again
2019-08-27 11:42:40 -07:00
Navid Shaikh 10f981ccaa Ensures kn cross platform build works in presubmit tests (#385)
Fixes #364

 - Ensure kn cross platform build works in pre-submit tests
 - Run ./hack/build.sh -x after running existing pre-submit tests
 - defines a function post_build_tests to invoke cross platform builds
 - post_build_tests will be run by test-infra after build tests are compelete
2019-08-26 10:59:17 -07:00
Toshinori Sugita 699ac5e7cb fix lint errors (#388)
* fix typo (misspell)

* ineffectual assignment to err (ineffassign)

* if block ends with a return statement, so drop this else and outdent its block (golint)

* should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)

* struct field LogHttp should be LogHTTP (golint)

* fix last typo
2019-08-24 22:46:13 -07:00
Roland Huß 9625b5f4c5 chore(plugins, services, routes): Aligned "Not found" messages (#359)
For the sake of consistency with out own service commands and for kubectl,

`kn plugin list` should print:

```
No plugins found.
```

`kn service list` should print:

```
No services found.
```

and not `No resources found.` like it does now.

Same for `kn routes list`.
2019-08-22 00:23:32 -07:00
Naomi Seyfer 223ff5316a Pass on args to e2e tests for local script (#382) 2019-08-21 15:46:33 -07:00
Naomi Seyfer 7b90959033 Fix json path to latest revision in e2e tests to something reliable (#376) 2019-08-19 22:31:04 -07:00
Naomi Seyfer 25c726453e Update serving dependency to 0.8; change all import paths (#368)
* Update serving to 0.8. Try building.

* Find the right serving version

* Change our own import path to knative.dev to match

* Remove dependency on old version of client

* Update yaml template

* Add sleep to test to deal with race

* fix merge conflict

* Update vendor modules
2019-08-15 18:09:08 -07:00
Navid Shaikh 746dacc47c feature(service): Implements traffic splitting and tagging targets (#345)
- Add e2e tests
 - Use '=' for traffic and tag assignment instead of ':'
 - Use --tag and --untag flags for tagging traffic targets
 - Use --traffic flag for setting traffic portions
 - Allow --traffic portion to either take revisionName or tagName
 - Uses @latest identifier for referencing latest revision of service
 - Dont throw error if requested revision=tag pair is same
 - Support having multiple tags for a revision
	 - creates a new target in traffic block if revision present in traffic block with new tag requested
	 - creates N new targets in traffic block if revision absent in traffic block with Nxnew tags requested
 - Ensure updating tag of @latest requires --untag flag
	 - streamline updating tag for latestReadyRevision
	 - adds respective tests
	 - adds tests for ensuring given traffic sum to 100 on CLI and fail fast
 - Add note about preference of order in case where tagOfOneRevision == revisionOfAnother,
   first tags are checked and assigned traffic if any, as tags are supposed to be
   unique in traffic block and should be referenced in such scenario.
 - Remove the examples from flag description, moves it to service update command example section
 - Pass only traffic block to compute trffic, makes it better to consume.
 - Cover more error cases for invalid value format for assignments, covers a=b=c, a=, =b, or variants of them
 - Separate and improves the error messages
 - Add unit tests for traffic computing
 - Add sanity checks in dedicated function verifyInputSanity
 	  - traffic perents should sum to 100
          - individual percent should be in 0-100
          - repetition of @latest or tagName or revisionRef is disallowed
 - Verify traffic percents sum to 100 on client side and fail fast
 - Add e2e tests for traffic splitting
	 - create and update service, assign tags and set traffic to make an existing state
	 - run the scenario on existing state of service
	 - form the desired state traffic block
	 - extract the traffic block and form the traffic block struct actual state
	 - assert.DeepEqual actual and desired traffic blocks
 - Use logic to generate service name in the same way as namespace, use different service name per test case
 - Run e2e test for traffic splitting in parallel
 - Use timeout duration of 30m for e2e tests, use timeout parameter for go_test_e2e library function
 - Use tagName in flag description of --untag, avoiding conflict with --tag flag
 - Update CHANGELOG
2019-08-15 10:56:08 -07:00
Roland Huß f7bec15480 fix(test): Give the namespace some time setup (#348)
Supposed to fix #329
2019-08-08 12:10:57 -07:00
Roland Huß b4b254f64c feature(service describe): Output of service details (#252)
* feature(service describe): Output of service details

`kn service show` mimics `kubectl describe <sth>` as that it output detail information in human readable output.

A future extension should add machine readable output with `-o` to export
a single object in json/yaml (that is missing from `kn service list`)

This command shows information about the service itself, but also a summary about the associated revisions.

It also knows about scaling and concurrency options.

Options:

`--details`    : Print more information. By default only are shorter summary is shown

* chore: Cleanup up and refreshed dependencies

* fix(service describe): Integration test fix (revert "show" to "describe")

* fix: go.sum

* fix go.sum

* feature(service describe): Add printing of resources (requests/limits) + machine readable output with -o

* chore(service describe): Simplified digest handling

* chore(service describe): Sort maps by key when printed

* chore: Adapt mock framework

* chore(service describe): Test fixes

* chore: Added some tests

* more tests

* test: Moar tests

* chore: Even moar tests

* more, more tests

* changelog update

* fix(service describe): golint fixes
2019-08-08 08:23:56 -07:00
Tsubasa Nagasawa 8e5302c741 List revisions sorted by configuration generation (#332)
* List revisions sorted by generation order

We use a configuration generation as a sort key, which is obtained from a label on configuration resource.

* Change column name from order to generation

* Fix revision sorting issue

* Fix revision e2e test

* Just sort by name if invalid type of generation found

* Update CHANGELOG
2019-08-06 03:13:54 -07:00
chaodaiG 9f203f2d4d Use knative.dev/test-infra (#319) 2019-07-31 03:20:43 -07:00
Roland Huß f797fba41b chore(tests): Update latest released version of serving to 0.7.1 (#304) 2019-07-29 11:56:05 -07:00
Martin Gencur b98e45e721 Restructure E2E test suite (#307)
* Restructure E2E test suite

* move out more tests from the basic workflow and put them in separate
files, including tests for routes
* rename revision_workflow_test.go to revision_test.go

* Run all tests in parallel
2019-07-29 06:00:05 -07:00
Navid Shaikh df816e63fe test(service): Add e2e tests for min, max scale options (#300)
* test(service): Add e2e tests for min, max scale options

 add e2e tests for min, max scale options for `service create` and
 `service update` operations.

* Provision in tests for jsonpath to lookup old and new fields
2019-07-26 13:02:49 -07:00
Navid Shaikh 152305f334 improves(e2e): Updates concurrency tests (#302)
- updates the validation of concurrency limits/targets with upcoming change to `service describe` output
 - validation commands now returns specific field in output than returning complete output
 - Renames service name used from hello to svc1
 - Provision in tests for jsonpath to lookup old and new fields
 - Consolidate once used helper method into test itself, as its checking for very specific test-case
2019-07-26 12:04:48 -07:00
Martin Gencur 03ecb36440 Add E2E tests for Service, Revision, Route (#291)
* Add E2E tests for Service, revision, route

* service, revision, route describe and describe with print flags
* route list with print flags
* service create for a duplicate service

* Test serviceDeleteNonexistent and fixes
2019-07-25 23:46:43 -07:00
Tsubasa Nagasawa b7808b0fa2 Validate scale and container concurrency options when updating configuration resource (#279)
* Validate invalid container concurrency options

* Use assert package

* Use FlagSet.Changed and don't care about default values

* Update dependency

* Follow e2e test changes

* Return error if invalid value is specified by users

* Fix broken e2e test

* Add more unit tests

* Fix error message

* Fix comment statement

* Revert back unrelated changes

* Fix typo
2019-07-25 02:57:35 -07:00
dr.max 9513dedfba Improves(e2e): imrpoves integration tests and to better run locally (#274)
1. refactors basic workflow (move code to common)
2. use different namespace accross test runs to isolate
3. include wait logic in CreateNamespace to allow multiple runs
4. include wait logic in DeleteNamespace to allow multiple runs

This is important since we need more integration tests and some of
these changes should allow `./test/e2e-tests-local.sh` to run on
local clusters (minikube or something other than test-infra) and
correctly behave during mutiple runs.
2019-07-23 10:13:34 -07:00
Tsubasa Nagasawa fca0a09e86 Clean up e2e test assertion (#264)
* Clean up e2e test assertion

Heavily rely on assert package as well as unit tests

* Iterate over a line for ensuring valid output

* Use subtests for easily spotting the error location
2019-07-15 04:41:26 -07:00
Tsubasa Nagasawa 406ecd182d Add e2e tests for service with concurrency options (#256)
* Add e2e tests for service with concurrency options

Check the behaviour of creating/updating service with concurrency options

* Move tests into separate test file and fix neats

* Use assert package for error check

* Change test function name
2019-07-12 10:24:41 -07:00
Roland Huß 9fb6a436e8 chore(wait): Fixes for Smoke Tests + help messages (#250)
* Increase wait timeout to 240s (to avoid test failures like in https://storage.googleapis.com/knative-prow/pr-logs/pull/knative_client/244/pull-knative-client-integration-tests-latest-release/1148472118510358531/build-log.txt)
* Fixed duplicate default help message for `kn service create --help`
2019-07-10 13:36:12 -07:00
Roland Huß 98184eafbc refactor(serving): KnClient interface for single point of cluster access (#134)
* fix(serving): Remove hardcoded GVK and look it up from schema

Fixes #133.

* chore(serving): Add test for "WaitForService()"

* refactor(service): Add listRoutes() to client + generic way for list options

* chore(serving): Fixing rebase conflicts
2019-07-08 10:08:34 -07:00
Navid Shaikh fc9b24c1e5 Add custom comparison for checking multiple substrings (#227)
* Adds custom comparison for checking multiple substrings

 This changeset introduces custom comparison for checking if a target
 string has given multiple substrings, namely `ContainsMultipleSubstrings`.

 Also removes `commands.TestContains` function and replaces all references
 of `commands.TestContains` with `gotest.tools/assert.Check` function and
 uses `ContainsMultipleSubstrings` as comparison function.

* Renames and makes the compare function variadic

 New name: ContainsAll
 New location: pkg/util/compare.go
 Also the function now takes target string as first arg,
 and accepts any number of substrings to check.
 Removed the message arg, the compare function composes the error message.
 For eg:
```
        Actual output: foo-abcd   foo       <unknown>   0 OK / 0     <unknown>   <unknown>
        Missing strings: foo-abcd1, foo1
```

* Adds tests for compare utility ContainsAll

* Update vendor/modules.txt
2019-07-05 10:07:32 -07:00
Navid Shaikh aac0ec265e Adds kn route list command (#202)
- Accepts an argument name for listing particular route
- Enables the machine readable output flags
- Updates docs for kn route command group
- Adds unit tests for route command group and route list
- Adds integration tests for route list in basic workflow test
- Updates tests and getting namespace
- Adds more unit tests for code in pkg/kn/commands/route/list_flags.go
- Adds route list command in smoke tests
- Updates vendor/modules.txt
- Clean up imports
- Addresses review comments
 - replaces knative to Knative
 - uses reflect.DeepEqual for slice comparison
 - removes few code comments
 - removes irrelevant tests modifications from the PR
2019-07-02 11:25:32 -07:00
Navid Shaikh e431ba2d54 Removes pausing between e2e smoke tests (#220)
* Removes pausing between e2e smoke tests

 Removes time.Sleep as by default service create waits for it to
 become ready. Also adds a command to create service in --async mode.

* Checks if service create in async mode is ready

 also describes the async mode service and finally deletes it
2019-07-02 03:31:31 -07:00
Vincent 663d76a413 Add the support to test against specified release of Knative serving (#170) 2019-06-28 11:30:08 -07:00
savitaashture 4cc5c84264 Added changes to support container port information while creating/updating service (#191) 2019-06-28 10:48:08 -07:00
Navid Shaikh 65f1c081ee Add kn revision delete command (#207)
* Adds kn revision delete command

* Adds unit tests for revision delete command

* Adds integration tests for revision delete command

 Added revision delete command tests in new workflow namely
 TestRevisionWorkflow.

* Removes extra line and renames an import alias

* Adds 10 seconds sleep between service create and revision delete

 Also adds check for 'No resources found' while grabbing revision name.

* Clean up imports

* Removes the pause after service create

* Updates testing output strings in unit and e2e

* Updates post goimports on hack and test dirs
2019-06-28 10:21:08 -07:00
Chi Zhang 483979bba4 Fix the periodic CI flow error in client (#200)
* hack the emitmetrics flag

* update test-infra
2019-06-27 09:53:07 -07:00
dr.max d556df17ac Restores the bash e2e tests as a smoke test (#183) 2019-06-25 10:35:06 -07:00
Navid Shaikh 9c865a6115 List revisions for a given service (#194)
* Lists revisions for a given service

 Fixes #127

* Adds unit tests for listing revisions of a service

* Adds integration tests for listing revisions of a service

* Updates docs for listing revisions of a service

* Updates vendor/modules.txt
2019-06-20 13:29:00 -07:00
Navid Shaikh d25ea5f1e7 Renames service 'get' to 'list' (#179)
* Renames service 'get' to 'list'

 As per title.

* Renames get references to list in e2e tests

* Replaces get to list in docs
2019-06-13 13:56:43 -07:00
dr.max 39d994794b Adds a Golang version of e2e Basic workflow that can execute locally (#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
2019-06-11 19:49:43 -07:00
Roland Huß ecc61d59c1 fix(e2e): Use build.sh for compiling (#175)
* fix(e2e): Use build.sh for compiling

Fixes #174.

* Update test/e2e-tests.sh

Co-Authored-By: Adriano Cunha <35786489+adrcunha@users.noreply.github.com>
2019-06-10 11:30:42 -07:00
Navid Shaikh 1b92b1fb56 Tests running simple workflow in e2e (#112)
* Tests running simple workflow in e2e

 Fixes #104

* Adds e2e test for --force flag while creating service

 also removes http:// before the registry name

* Removes the update command

* Adds the service update command back to e2e tests

 also increases the sleep time between create and get
2019-05-17 16:42:15 -07:00
Adriano Cunha d4d135760c Fix command for "kn service" smoke test (#113)
It's now `get`, not `list` anymore.
2019-05-15 14:31:31 -07:00
Adriano Cunha c33b1de89a License checking works now, enable it (#98)
* License checking now works, enable it

* Update test-infra

* Update vendored test-infra
2019-05-09 14:51:38 -07:00
Ben Browning 585fe80099 Stub in an integration test (#55)
* Stub in an integration test

This just calls `kn service list` and verifies it doesn't have a
non-zero exit status.

* Build the client in pre_integration_tests

* Need to explicitly build the `kn` client

As opposed to just building the entire repo. That didn't actually
stick a `kn` binary in the root.

* Address code review feedback

Build the client in e2e-tests.sh instead of presubmit-tests.sh, fix a
couple copy/paste places that referred to eventing, remove unnecessary
knative_teardown function.

* Don't attempt to build kn twice

* Turns out pre_integration_tests() is the easiest way to build kn

We don't have any other good hooks at the moment to do something in
`e2e-tests.sh` that runs only once before the test cluster gets setup.

* Update test-infra to use the new cluster_setup function

This updates the version of test-infra to use the new cluster_setup
function added in https://github.com/knative/test-infra/pull/667

It simplifies our e2e setup logic into one place instead of being
split over presubmit-tests.sh and e2e-tests.sh

* Update vendored test-infra as well

* We have to explicitly tell CI to use the vendored modules

* Be a bit more descriptive in the stubbed out integration test
2019-04-08 10:50:58 -07:00
Naomi Seyfer ebbd659e69 go.mod and go.sum updates (#46)
* go.mod and go.sum updates

* Set GO111MODULE=on
2019-03-26 12:41:51 -07:00
Naomi Seyfer b5b02f64f3
Incorporate reference to knative/test-infra for setting up automated tests. (#34)
* Set up some test infra

* fix gitignore

* More mod gitignore

* Add dummy file that depends on stuff
2019-03-05 16:31:05 -08:00