Commit Graph

18 Commits

Author SHA1 Message Date
Daniel Helfand 3f146b14db
Return Error Message from Using --untag with Nonexistent Tag (#880)
* return error message from using --untag with nonexistent tag

* improve err message for --untag and add e2e test

* change untagRevision to return bool and add traffic e2e tests

* update changelog
2020-06-10 23:22:23 -07:00
Navid Shaikh e05c33447e
fix(e2e): Refactor e2e utils and resource actions (#832)
* fix(e2e): Refactor e2e utils and resource actions

 brings commonly re-used utilities into lib/test so they can be resused
 and e2e can be run selectively for eventing/serving.

* Refactor service and revision e2e test utils into test lib

* Docstrings for exported e2e test utils
2020-05-11 06:09:46 -07:00
dr.max 395fc6c3b2
fix(#772) refactored / simplified parameters to KnResultCollector (#773)
* fix(#772) refactored / simplified parameters to KnResultCollector

* added Teardown() call in VersionTest
2020-04-08 02:18:01 -07:00
dr.max e524610b65
fix(769): various issues with godoc documents (#771) 2020-04-02 01:39:17 -07:00
dr.max df78b8b40c
(refactor) address the e2e extract / refactor of issue #763 (#765)
* (refactor) address the e2e extract / refactor of issue #763

* various updates to address reviewers feedback

* renamed lib/test/integration to lib/test and package to test
2020-04-01 09:21:18 -07:00
Roland Huß c2dcb6b42d
chore(e2e): Minor cleanup (#670)
* chore(e2e): Minor cleanup

* chore(e2e): Remove t.Parallel() for the revision test

* chore: Some improvements wrt/ testing

* chore: fix formatting
2020-02-17 23:00:58 -08:00
Roland Huß a220a88534
chore(e2e): Refactor to better track errors (#667)
* chore(e2e): Refactor e2e to better track errors

* Collect results from various `kn` calls to
  provide the context
* Changed sub-Run() commands to t.Log() to reduce
  the log noise and get file + line information
  in the log output
* Removed any Fatal() calls to allows the test
  to properly finish
* Only output via t.Log() to get the output at the
  proper places and allow Prow to better pick
  up the test results.
* Most important: EMOJIS !! 🦆🦆🦆🦆🦆

* chore(e2e): Add more dumpers

* Moar debug
2020-02-16 23:52:10 -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 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
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
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
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
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
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