Commit Graph

20 Commits

Author SHA1 Message Date
Scott Nichols 2c145de3d5 Creating an Event interface and ReconcilerEvent type to be used in ReconcileKind (#952)
* Adding a base class to use as strong typed reconciler events.

* fmt, rename.

* support wrapped errors.

* make a custom alias for errors.Is and errors.As, use Event as an interaface.

* add context name (event) to is and as

* update based on feedback.

* fix test fail messages.

* feedback updated.

* cleanup test code.
2020-01-07 15:08:51 -08:00
Ignacio (Nacho) Cano d5d6ec4697 setting other test data (#933) 2019-12-10 10:44:47 -08:00
Matt Moore 20ef0b737b This has three small table testing changes. (#911)
I'm splitting this off of another change that needed them, the three changes are:

1. Give the PostConditions callbacks in TableRow access to the Reconciler
  resource.  It turns out this is incredibly useful to have the `TableRow`
  program an admission controller and then test that programming by calling
  `Admit()`.

1. Surface the test resources in our webhook "listers", and add the testing
  scheme.

1. Change the `objKey` to only use reflection as a fallback.  The existing logic
  doesn't work properly when a mix of real resources and unstructured.Unstructured
  is used for the same resource.
2019-11-28 11:10:22 -08:00
Matt Moore a805b647f3 Expand the tracker interface to include a variant with its own type. (#860)
`TrackReference` is the same as `Track`, but takes a `tracker.Reference` instead.  This type has been seeded with the subset of `corev1.ObjectReference` that the tracker currently consumes / supports, but the intention is to expand this type to allow inexact references that (optionally) use label selectors in place of name to reference objects.

See also: https://github.com/knative/pkg/issues/859
2019-11-10 09:04:12 -08:00
Markus Thömmes 9bdf8c1c8f Add Namespace index to listers in tests. (#857)
Not having this causes the listers to log an annoying log message like

W1108 02:48:54.848573  211995 listers.go:77] can not retrieve list of objects using index : Index with name namespace does not exist

That message doesn't cause the tests to fail because the cache logic works around by doing a "slow indexing". I was very confused by this log though and sunk a bit of time into debugging it, so here we go.
2019-11-08 04:23:56 -08:00
Dave Protasowski 613c1d31ee allow for custom assertions to be made in TableTests (#738) 2019-10-02 11:39:09 -07:00
Dave Protasowski 849fcc967b make the NullTracker a fake to capture Track calls (#739) 2019-10-01 22:59:04 -07:00
Dave Protasowski 38b92bcf01 fix typo (#732) 2019-09-30 19:22:06 -07:00
Matt Moore e4ac97c252 Update our dependency on K8s libs to 1.15.3 (#686)
With a minimum K8s version of 1.14 (starting in 0.10), 1.15.3 puts us in the center of the +/-1 version window of support.
2019-09-18 13:36:48 -07:00
Matt Moore 5cdf30f51e Change how we test the generateName reactor. (#688)
The 1.14 K8s test libs introduce changes that broke how we were testing this, but it still works in the cases we care about, so this adjusts the test to more accurately test the reactor in the way we actually care about.
2019-09-16 17:25:45 -07:00
Victor Agababov e9c7aefce0 fix (#631) 2019-09-03 20:41:01 -07:00
Victor Agababov a7924e4fa2 Improve the loggig situation in table tests (#624)
Currently the table tests do not annotate the context logger with the key
which means we puts lots of unnecessary logging in the reconcilers to log the key that is being reconciled.
So this fixes that.
Also precreates some containers to the needed size.

/assign mattmoor
2019-08-30 21:29:53 -07:00
Victor Agababov b83b6a5218 Extend reconciler and controller owners with serving approver people (#625)
Subj
/assign mattmoor
/cc @dgerd
2019-08-30 15:33:51 -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
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
Matt Moore c6f03fa600 Push the event recorder stuff into knative/pkg (#443) 2019-06-06 07:35:40 -07:00
Ville Aikas 15b1aa79be change metav1.Object to runtime.Object so we can test moar objects (#433) 2019-05-28 17:11:30 -07:00
Shashwathi f95c27ee8c Enable fields validation on delete actions (#398) 2019-04-30 17:39:32 -07:00
Victor Agababov 1b67a06e3a Fix the display in the table tests. (#393)
Currently we're collecting and printing extra objects
as VerbActions, which of course is not what's extra, the extra is the
object wrapped around them. So print that insted.
2019-04-19 15:37:27 -07:00
Scott Nichols 418e675f88 Moving reconcile/testing from serving to pkg. (#387)
* Moving reconcile/testing from serving to pkg.

* add clock.

* Update clock cw.

* move testing/configmap.go to configmap/

* wire in a setable context.

* need to export example key.
2019-04-17 08:19:28 -07:00