Commit Graph

312 Commits

Author SHA1 Message Date
Markus Thömmes acbf2af596
Harden logstream against non-object events (#1984) 2021-01-12 06:39:30 -08:00
Markus Thömmes 7226f4f447
Unify usage of YAML libraries (#1971)
* Replace ghodss/yaml with sigs.k8s.io/yaml

* Replace unnecessary usage of gopkg.in/yaml too
2020-12-17 07:24:02 -08:00
knative-automation 95b8793bd6
Format markdown (#1967)
Signed-off-by: Knative Automation <automation@knative.team>
2020-12-15 17:45:58 -08:00
Igor Belianski ef8048c0ba
Enable multi namespace log collection in e2e test (#1959)
* enable multi namespace log collection in e2e test

* Update test/logstream/README.md

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* Update test/logstream/README.md

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* Update test/logstream/interface.go

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* var grouping of global variables

* fix broken build

* Update test/logstream/README.md

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* Update test/logstream/v2/stream_test.go

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* Update test/logstream/v2/stream_test.go

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* Update test/logstream/v2/stream.go

Co-authored-by: Victor Agababov <vagababov@gmail.com>

* minor misc style fixes

* closing brackets spacing

* Update test/logstream/v2/stream.go

Co-authored-by: Victor Agababov <vagababov@gmail.com>

Co-authored-by: Victor Agababov <vagababov@gmail.com>
2020-12-15 12:24:58 -08:00
Antoine Cotten af53027cbd
Format copyright headers to match boilerplate (#1962) 2020-12-15 02:12:43 -08:00
Jean-Rémy Bancel b1ac587fdd
Fix missing 'to'. (#1952) 2020-12-08 17:12:41 -08:00
Victor Agababov 7e918163fc
Fix some nits around logging (#1946) 2020-12-07 14:50:40 -08:00
Victor Agababov c9bac6be76
Log if the deserialized line is semi-normal. (#1939)
Right now they panic and we lose all the context.
2020-12-04 09:55:09 -08:00
Victor Agababov b89ac2a632
Fix the logstream since it's paniciiiiing (#1938)
The thing instroduced here: https://github.com/knative/pkg/pull/1773
2020-12-03 17:32:09 -08:00
Zhongduo Lin (Jimmy) e5346d90e9
feat/perf-test: continue test when fail to get commit id (#1930)
* feat/perf-test: continue test when fail to get commit id

changeset.Get does not work well when the test image is in the
vendor directory because there is no kodata setup. After this
commit, failure to get the commit id will result in a
log entry instead of failing the whole test.

* Update test/mako/sidecar.go

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>

Co-authored-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
2020-11-30 11:24:36 -08:00
Dave Protasowski e1306afead
move some spoof helpers to the spoof package (#1827)
This helps avoid pulling in the pkg/test globals
2020-11-24 10:23:35 -08:00
Chris Suszynski ac327c4338
Skip at BackgroundOperation's verify stage doesn't hang tests (#1912) 2020-11-17 10:07:51 -08:00
Victor Agababov 93fedf1413
Various test improvements in formatting (#1904) 2020-11-12 12:10:59 -08:00
Markus Thömmes d9c4e5c439
Fix a few more occurrences of divisive language (#1902) 2020-11-12 06:41:59 -08:00
Markus Thömmes 7205f2d264
Remove TLogger and relevant interfaces (#1875) 2020-11-04 08:00:04 -08:00
Markus Thömmes 565516e224
Add errorlint and fix all existing issues (#1855) 2020-10-29 01:14:35 -07:00
Dave Protasowski e135a17378
use the default unit test runner (#1871) 2020-10-28 07:28:34 -07:00
Scott Nichols 826303ca06
use new hack repo (#1858) 2020-10-27 15:38:33 -07:00
Matt Moore a37d20384b
Support short suffix in zipkin config (#1840) 2020-10-26 09:28:41 -07:00
Victor Agababov f492d0877a
Improve readability with backtics (#1830) 2020-10-21 13:08:32 -07:00
Victor Agababov 1787376258
More test coverage for logstream (#1826)
- cover the actual log parsing (without verification for now)
- cover errors from starting stream
- other nits
2020-10-20 15:10:17 -07:00
Markus Thömmes 385c8b9c0e
Fix nolint warnings and adhere to best practices (#1823) 2020-10-20 09:33:59 -07:00
Dave Protasowski 5c30f4882d
use kubernetes.Interface for some test helpers (#1825)
- NewSpoofingClient
- WaitForEndpointState
- WaitForEndpointStateWithTimeout
2020-10-20 08:28:59 -07:00
Markus Thömmes bf971ee9f6
Harden logstream test, make it quicker and repeatable (#1824) 2020-10-20 07:56:58 -07:00
Markus Thömmes 19995cd8e1
Simplify defaulting and force-default kubeconfig location in tests (#1822) 2020-10-20 07:37:58 -07:00
Victor Agababov eafc8c6f72
Various stuff around the logstream (#1821)
* Various stuff around the logstream

- handle `event.Object == nil` case. We have reports of this. Strange
  edgecase, but 🤷.
- add tons of tests around various cases, should raise the coverage a
bit (although, we exclude test, still should be better).

* remove chan buf

* fix spelling

* final resolution

* final resolution

* fix lint
2020-10-19 20:36:59 -07:00
Scott Nichols fc447086b7
Remove re-definition of kubeconfig from pkg/test (#1820)
* pull flags from injection

* lint

* trim T interface, use flagset
2020-10-19 16:30:58 -07:00
Markus Thömmes 8010071179
Remove unnecessary override for dependencies (#1816) 2020-10-19 02:39:58 -07:00
Markus Thömmes 57c28d742e
Simplify test helpers for prometheus API (#1815) 2020-10-18 23:07:58 -07:00
Josh Soref b39d5da935
Spelling (#1797)
* spelling: adopted

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: aliased

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: apierrs

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: assignment

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: available

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: coexistence

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: commit

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: conversions

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: creates

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: custom

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: determine

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: different

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: distribution

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: duplicate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: editing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: endpoint

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: environment

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: generate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: implementation

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: identified

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: ignore

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: indicates

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interface

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interleaved

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: labels

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: label

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mimic

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: namespaced

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: necessary

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: organization

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: populatable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: prometheus

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: refer

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: reference

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repetitive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: response

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: something

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: specable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: spoofing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: synchronized

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: this

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: trailing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unsupported

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: validation

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* chore: reviewdog go header boilerplate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-10-18 14:22:57 -07:00
Markus Thömmes 51839ea5e1
Update vegeta to a version supporting go modules (#1811)
This allows us to drop the explicit overrides in downstream repositories and it also looks so much nicer :).

I'd hope the change is non-breaking to downstream repositories, given the interface is strictly widened here.
2020-10-15 07:25:57 -07:00
Scott Nichols 5a5f68637e
use k8s.interface (#1808)
* use k8s.interface

* start to remove test client

* don't use test/KubeClient
2020-10-14 09:51:31 -07:00
Dave Protasowski ad2e1b82ee
fix the logstream v2 flake (#1805)
* fix the logstream v2 flake

* fix comment
2020-10-13 19:29:30 -07:00
Dave Protasowski 54ad6c6d39
logstream v2 (#1793)
* create a log stream that doesn't reach for pkg/test globals

* v1 can now use v2's implementation

* fix godoc

* fix self comments

* fix lints

* fix t.Error message

* guard the buffer to avoid races

* rename file to stream so that logs make more sense
2020-10-12 09:32:17 -07:00
Dave Protasowski 3eb7d13dae
Drop the usage of knative.dev/pkg/test in the helpers package (#1791)
This has the side effects of pulling in a bunch of global variables
2020-10-09 08:37:21 -07:00
Victor Agababov 7bad843466
Enable golint and exclude some other generated or additional dirs (#1783)
* Enable golint and exclude some other generated or additional dirs

Also remove `test` ignore, since it's covered by path ignore rule.

* meh

* fixes

* more

* progressing

* further

* like a boss
2020-10-07 14:58:20 -07:00
Victor Agababov 8922d5c471
Include REST and reorder items to be sorted (#1780)
We're still doing a linear search... but one day may be.
2020-10-06 13:40:20 -07:00
Victor Agababov 247841408e
Apply the cleanup to the pkg (#1776)
* Apply the cleanup to the pkg

This is probably the final iteration of my cleanup application.

* codegen

* one more try
2020-10-05 21:41:20 -07:00
Victor Agababov 29e3385d1b
Fix the resource naming for known terms (#1761)
It's been a longterm pet peeve of mine that we don't name test functions TestAutoTLS etc, because this
function will mutilate the names in to t-l-s, etc.
So collect a list of well known names and catch them separately.

This is not superperformant, some trie would do this job better, but since
this is test name generation, I'll let it slide :-D
2020-09-30 13:15:29 -07:00
Victor Agababov 1e373a9e5d
take 2 (#1755) 2020-09-29 14:10:29 -07:00
Victor Agababov a371418524
v2 (#1754) 2020-09-29 13:18:29 -07:00
Markus Thömmes 5fbbde31b3
Align linters with serving (enables stylecheck and asciicheck) (#1738) 2020-09-23 07:37:40 -07:00
Victor Agababov 58028584ae
Remove apicoverage from pkg (#1728)
and update the deps
2020-09-22 14:49:39 -07:00
Markus Thömmes 754da4653a
Enable unparam linter to catch unused parameters (#1731) 2020-09-22 09:13:40 -07:00
Victor Agababov c46a186449
Various nits around the pkg (#1721) 2020-09-20 14:04:45 -07:00
Victor Agababov ddf2cbe3c1
Various nits around the code (#1719)
* Various nits around the code

* stagger
2020-09-18 16:22:45 -07:00
Chris Suszynski 6ce80a7c27
Suite for running upgrade tests in Knative components (#1652)
* Upgrade suite types and tests

* Naively fixing upgrade suite tests

* Properly implement InstallingBase, and PreUpgradeTests

* Continual tests implemented

* UpgradeWith and PostUpgradeTests implemented

* DowngradeWith and PostDowngradeTests implemented

* zaptest.Buffer race removed

* Remove barely used testify/assert

* Ensure that VerifyContinualTests is always called if continual tests started

* Prepare tests for failure assertions

* Refactor to enable failure testing

* Prepare for failure testing

* Testing suite can fail now

* Prepare a failing test suite

* Mock testing.T implemented

* Failure testing works for single point

* Split testing code to more manageable pieces

* Tests for upgrade suite are working well

* Remove confusion about StopSignal type

A StopSignal has been splitted to 2 separate type private stoppable and
a StopEvent. StopEvent contains only elements that are essential for
implementors to use *testing.T and signalize end of stop & verify
procedure to upgrade suite.

* Introducing NewBackgroundVerification and WaitForStopEvent

Functions NewBackgroundVerification and WaitForStopEvent has
been introduced to ease implementers to write a simple setup &
verify background tests.

* Rework of "Starting continual tests"

* Removal of return value from background handler

* Move stop channel to be closer to background operation

* Remove unneeded Named interface

* Documenting public types

* Fixes to satisfy golangci-lint

* Final linting fixes
2020-09-18 13:05:45 -07:00
Victor Agababov caa3276afd
Remove now unused test helpers (#1716)
They were used in perf tests in serving, but those don't exit anymore either.
2020-09-18 11:12:44 -07:00
Victor Agababov 7c22a6940c
Remove the interface that is no longer required (#1707)
and other nits
2020-09-14 18:52:41 -07:00
Matt Moore 2e7d80578f
Teach the spoofing client to support NodePort. (#1706)
* Teach the spoofing client to support NodePort.

This is loosely based on similar logic that I added to kingress conformance testing here:
611f989aa5/test/conformance/ingress/util.go (L904-L912)

The basic idea is that in our custom dialer we look at the requested port and translate that to the service's NodePort when present.

This is in support of running Serving's e2e testing on top of KinD environments without service `type: LoadBalancer`.

* name the return values
2020-09-14 18:16:41 -07:00