Commit Graph

392 Commits

Author SHA1 Message Date
Spencer Peterson 154a0848d4 test for FieldError.Also(nil) (#545) 2019-07-28 09:36:04 -07:00
Martin Gencur fe4877abb6 Create reusable ResolveEndpoint function (#543) 2019-07-25 09:59:36 -07:00
Johnu George 86f49e59e0 Implement ClearCondition for ConditionManager (#538)
* Implement RemoveCondition for ConditionManager

This implements RemoveCondition to remove a condition that matches
the condition type. Happy condition is changed appropriately if it
is a terminal and satifies one of the following conditions
1. RemovedCondition is false and happy is false
    Happy can change from false to unknown or true
2. RemovedCondition is unknown and happy is unknown
    Happy can change from unknown to true

* comment edit

* Addresses review comments

* Support only non terminal conditions

* Fix check
2019-07-24 14:22:35 -07:00
Victor Agababov 74c5d67ea0 Fix the issues pointed out by staticcheck (#541)
* Fix the issues pointed out by staticcheck

* review fix
2019-07-23 13:13:36 -07:00
mattmoor-sockpuppet e4bc08cc8d Auto-update dependencies (#537)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-07-19 07:10:30 -07:00
Victor Agababov 8fe96d53cc add Time helper as well (#536) 2019-07-18 20:44:28 -07:00
Zhimin Xiang 83cfa18c15 add OwnerRefableAccessor into kmeta (#535) 2019-07-18 17:15:29 -07:00
Scott Nichols 540853ba6b Adding Duration ptr helper. (#519)
* Adding Time and Duration ptr helpers.

* use do duration.

* nit picky reviwers get nit picky comments.
2019-07-18 16:10:28 -07:00
Victor Agababov a7dbe91220 Move rogpeppe/go-internal to modern version (#534)
License is present in the package now
2019-07-17 18:00:28 -07:00
fatkun a3e4b8d9f7 Improve kmp.ShortDiff when one object is invalid (#528)
* Improve kmp.ShortDiff when one object is invalid

* Both are invalid throw an error

* If x is invalid and y is valid, add '+' prefix and no '-'

* If x is valid and y is invalid, add '-' prefix and not '+'

* * Extract diffString method for reduce duplicated code

* Add a map with missing key test case

* * Direct return diff string

* Map add a key unit test
2019-07-17 14:26:29 -07:00
mattmoor-sockpuppet 2d95785c7b Auto-update dependencies (#533)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-07-17 07:31:29 -07:00
Adriano Cunha 7a85e28f40 Remove Erik and Nikhil from Productivity Reviewers (#532) 2019-07-16 16:11:27 -07:00
mattmoor-sockpuppet 9b327fbdb2 Auto-update dependencies (#531)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-07-16 08:52:27 -07:00
Victor Agababov d5915547d9 Update opencensus to a newer version (#526) 2019-07-12 16:18:48 -07:00
Jean-Rémy Bancel b583d04e47 Remove '-' from suggested component name. (#525) 2019-07-12 12:41:44 -07:00
Jin Chi He 76da19bbc6 add openapi-gen=true for some structs (#510) 2019-07-11 21:17:33 -07:00
Dan Gerdesmeier e2418a08c1 Change 'updater' to 'lastModifier' in webhook (#512)
* Change 'updater' to 'lastModifier' in webhook

Both eventing and serving curretly use lastModifier. Nothing seems to
implement the pkg 'HasSpec' interface yet so this should be a safe
change. This brings the annotation in-line with currentb behavior

Fixes #511

* Remove unnecessary defer

* Change paths in json patches
2019-07-09 17:58:59 -07:00
Annie Fu a68e009041 Add check for nil StatsReporter in webhook package (#518)
* Prevent nil StatsReporter for existing webhook package consumers

* Pass StatsReporter by pointer and have tests test constructor

* Make constructor return error instead of panicking

* Move StatsReporter to ControllerOptions to consolidate constructors
2019-07-09 17:23:58 -07:00
Annie Fu 84d3910c56 Add metrics to webhook package (#503)
* Add metrics to webhook package

Add metricstest package for shared helper functions for testing metrics

* Address PR

* Cleanup

* Fix import paths to fix build issues

* Fix import package path for test file

* Remove unnecessary formatting from error message

* Remove helper function only used once

* Add metric name to all error messages, make checkRowTags testing helper function

* Add common histogram bucket generator function to metrics package

* Fix CheckStatsNotReported check

* Reset metrics before each test so the tests are idempotent

* Make CheckStatsNotReported conditional clearer
2019-07-08 16:00:44 -07:00
mattmoor-sockpuppet c8d9b9691d Auto-update dependencies (#509)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-07-04 15:01:33 -07:00
Jacques Chester c9bcf7e03f Upgrade kubernetes-1.12.6 -> kubernetes-1.12.9 (#508) 2019-07-03 14:42:32 -07:00
Joseph Lewis III db77877519 added limitrange and resourcequota informers (#501) 2019-07-02 22:44:32 -07:00
mattmoor-sockpuppet 07dadbc3ef Auto-update dependencies (#502)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-07-02 15:58:31 -07:00
mattmoor-sockpuppet 7b4cf0bfe5 Auto-update dependencies (#500)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-07-01 10:47:18 -07:00
mattmoor-sockpuppet 1864f499dc golang format tools (#497)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign @mattmoor
2019-06-27 07:37:08 -07:00
mattmoor-sockpuppet 80192aba4e Auto-update dependencies (#498)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-06-27 07:30:12 -07:00
mattmoor-sockpuppet 9c27da795e Format markdown (#496)
Produced via:
  `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)`
/assign @mattmoor
2019-06-27 07:24:10 -07:00
chaodaiG 1104d6c755 update readme with knative.dev/pkg (#495) 2019-06-26 14:56:08 -07:00
mattmoor-sockpuppet 3c6bc12e78 Auto-update dependencies (#494)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-06-26 13:22:06 -07:00
Matt Moore 222dd25986 Migrate pkg to use the knative.dev/pkg import path (#489)
* Manual changes.

* scripted changes.
2019-06-26 13:02:06 -07:00
mattmoor-sockpuppet b30961a891 Auto-update dependencies (#492)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-06-26 07:47:06 -07:00
mattmoor-sockpuppet dfb0c389bd Format markdown (#493)
Produced via:
  `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)`
/assign @mattmoor
2019-06-26 07:35:06 -07:00
mattmoor-sockpuppet a93024b82d Auto-update dependencies (#491)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-06-25 07:34:07 -07:00
mattmoor-sockpuppet 4db7a57379 golang format tools (#490)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign @mattmoor
2019-06-25 07:22:06 -07:00
Matt Moore d618aec6a4 Add a doc on releasing knative/pkg. (#464)
* Add a doc on releasing knative/pkg.

* Incorporate review comments.

* add eventing-contrib, change command to codegen
2019-06-25 07:08:08 -07:00
Ali Ok 9f8e0692b7 #457 Duck type user annotation logic (#467)
* #457 Duck type user annotation logic

* #457 Duck type user annotation logic - tests

* #457 Revert updater annotation key from lastModifier to updater

* #457 Rename HasSpec#GetSpec() to HasSpec#GetUntypedSpec()

* #457 Fix some indentation

* #457 Get group for user info annotations from the request

* #457 Reduce confusuion in webhook testing by using same group
2019-06-24 18:20:05 -07:00
mattmoor-sockpuppet d82505e6c5 Auto-update dependencies (#488)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-06-24 07:16:06 -07:00
Markus Thömmes b3be0a29a2 Add 'error' field to extracted logs, if available. (#487)
In our structured logging we use `logger.Errorw(..., zap.Error(err))` to log errors in a structured way. As such, they are not part of the actual log message. They are however of utmost importance when debugging issues so this adds `err={ERROR}` to the logline if the error key is present and not empty.
2019-06-24 06:53:04 -07:00
Matt Moore 2f853a1fdc Let the stats reporter tests run with -count=N (#486) 2019-06-23 20:12:02 -07:00
Matt Moore 35a6f90d16 Sprinkle more ClearAll around to enabled -count=N (#485) 2019-06-23 19:24:02 -07:00
Matt Moore 01db4ead66 Refactor the tracker testing. (#483)
Stop using `t.Run` to segment things, since they aren't truly independent tests.

Use a longer lease/sleep as I have concerns that slow execution may be a part of the flakiness here.
2019-06-23 17:46:00 -07:00
Matt Moore 7538724784 Stabilize the controller unit tests. (#482) 2019-06-23 17:16:00 -07:00
Markus Thömmes ca175939db Enrich the logs streamed in tests with useful information. (#480)
* Enrich the logs streamed in tests with useful information.

- Level is very useful to spot errors at a glance.
- Time is very helpful to be able to order the statements and notice time gaps.
- Key helps identifying which ressource is being reconciled (could be a child resource).

* Adjust timestamp, reduce level to only the first char.
2019-06-23 13:49:58 -07:00
Markus Thömmes b35531d473 Move ExampleKey constant to 'official' package. (#481) 2019-06-23 08:08:57 -07:00
Yanwei Guo c2cd40c1c2 use cluster-location (#477) 2019-06-21 15:07:22 -07:00
Joseph Lewis III 9c5d970cbc Add injection for rbacv1.role (#479) 2019-06-21 13:09:21 -07:00
mattmoor-sockpuppet 7aee93aa60 Auto-update dependencies (#478)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @mattmoor
2019-06-21 11:34:22 -07:00
Matt Moore d90a9bc97d Upstream the logstream package from knative/serving. (#472)
This also upstreams the utility for generating test resource names upon which it builds.
2019-06-18 20:29:46 -07:00
Victor Agababov 55ded05b4e Upstream ChildName to the pkg (#471) 2019-06-18 18:43:46 -07:00
mattmoor-sockpuppet 0851b95f90 Update github.com/knative/test-infra dependency (#470)
Produced via:
  `dep ensure -update github.com/knative/test-infra`
/assign @adrcunha
2019-06-18 08:25:47 -07:00