Commit Graph

201 Commits

Author SHA1 Message Date
Chi Zhang 064b156ab7
Update and fixes to the cluster management lib (#1196)
* fix project in e2e cluster manager

* delete async for boskos

* use the right quota in the GKE requests

* update google cloud api

* update

* fix unit tests

* fix unit tests

* fix unit tests

* acquire always creates new

* support resolving GKE version

* go fmt

* delete version.go

* add more unit tests
2020-04-06 14:52:59 -07:00
Markus Thömmes c09083a601
Fix a few simple linter warnings: unused code, govet warnings etc. (#1191) 2020-04-06 08:21:20 -07:00
Chi Zhang 55250e6aab
move libs from test-infra (#1171) 2020-04-01 11:43:17 -07:00
Scott Nichols 8a6d25b309
Generate reconcilers for resources out of tree. (#1175)
* genreconciler:nonNamespaced

* Adding a force-kinds flag to the reconciler generator to allow us to generate reconcilers for non-owned types.

* force-kinds --> force-genreconciler-kinds

* some minor nits with the generators for non-knative types needed to be removed.

* remove whitespace

Co-authored-by: Nacho Cano <nachoacano@gmail.com>
2020-03-25 11:34:51 -07:00
Chi Zhang 0840da9555
add options for cmd (#1170) 2020-03-23 16:16:09 -07:00
ian-mi 7cbd0bcc1a
Add JSONTracePred to the zipkin testing package (#1157)
Allows the use of an arbitrary predicate when polling a zipkin trace
ID. Enables the creation of tests in which the number of trace spans
may vary.
2020-03-13 17:04:29 -07:00
Chi Zhang a4c6b47c82
Add a function to parse all env config set by Prow (#1147)
* add a function to parse all env config set by Prow

* fix unit tests

* address comments

* address comments again

* address comments2

* address comments
2020-03-13 14:41:30 -07:00
Martin Gencur 1327ff3179
Configurable SpoofRequestInterval and SpoofRequestTimeout (#942) 2020-03-09 09:59:28 -07:00
Victor Agababov 14a424af04
Fix the nits leftover from #1118 review (#1124)
Fix the stuff that was not fixed.
2020-02-24 16:43:08 -08:00
coryrc 60e39237f6
Pass verbosity level on to klog (#1118)
* Pass verbosity level on to klog

This was left out of #1022

* Missed capitalization
2020-02-24 13:37:08 -08:00
Scott Nichols 8dc3f910f5
Delete ./test/testgenclient after presubmit is finished. (#1121)
* An oversight left the gen test client around and it is causing issues with other automation that did not gen the test client because of deps changes.

* new better way to test codegen
2020-02-24 09:13:08 -08:00
Mike Petersen a2e3b66654
Renews a webhook cert before it expires (#1101)
* Renews a webhook cert before it expires

* Moved checks out of webhook and into certificate

* Updated error messages and others from review

* Updated error messages and changed time comparison

* Added two tests cases for checking expiration

* Fixed issue with missing "." in webhook.go
2020-02-22 12:33:08 -08:00
coryrc a81f50a34e
Backend for improving test logging (#1022)
* Create TLogger, bringing leveled logging to tests

Inspired heavily by go-logr, brings leveled logging to tests while
using the highly reliable zap logger backend to fulfill writing to
multiple log files.

Now that metrics logger has been removed, SetupLoggingFlags() is redundant. Moved to test/logging

* Cleanup TLogger and document

Add TLogger.Collect() to support collecting outcomes (either positive
strings or error types) which will be processed in a subtest upon
completion of the currently-running (sub-)test.

StructuredError prints its output in a more-readable form now.

Call-site should now work for .Log/.Logf-using functions.

Use cancel from NewTLogger instead of t.CleanUp()

Use a zapcore SpewEncoder when writing to testing.T

Means even non-json-encodable structs will get printed to the test log
output, while preserving encodable structured output for other log files.

Removed timestamp from printing to t.Log

* Fix the automatically-detected issues

Spelling, codegen, some coverage (coverage of memory_encoder.go should
not be necessary but the coverage tool is broken and needs to be fixed).

* Increase unit test coverage slightly and fix tiny comment

* Set attribute the way the coverage program wants

* Cleanup based on notes

* Comment cleanup and privitize var

* Mistake; left purposely-failing tests enabled

* Reduce long lines

* Consolidate cleanup code; make variable expressive

* Cleanup and bugfix

Failing functions now tested by having an internal constructor
option to skip calls to t.Fail()/t.FailNow().

Fixed some bugs with internal method errorWithRuntimeCheck and added
tests for it.

Address minor typos from comments.

* Tiny name/optimization fixes
2020-02-19 13:57:05 -08:00
Scott Nichols 72f3cd2bbc
[Genreconciler] Fix group names when client groups differ than their directory name. (#1097)
* looking at annotations for group overrides.

* checkpoint.

* checkpoint

* I think it is correct.

* ok

* trim down the files.

* simulate tekton

* working test out of checkin

* remove test client

* update docs

* and test.

* lint

* it ok

* update codegen
2020-02-18 17:14:59 -08:00
Victor Agababov 9072f494c9
add vagababov (#1059) 2020-02-06 11:14:32 -08:00
Victor Agababov 1e31aa840f
Fix the go version tag (#1058)
Per runtime.Version() docs the version might be a commit tag, that is not accepted
by Mako servers.
So fix that to espace more generally.
Period, on the other hand, is now an accepted symbol, so stop translating it.
2020-02-06 10:57:32 -08:00
Doug Davis 79f10450c2
Add support for KUBECONFIG env var in the tests (#1050)
Signed-off-by: Doug Davis <dug@us.ibm.com>
2020-02-05 14:02:32 -08:00
Chi Zhang 84c9a84d38
Add extra flags for cluster creation in test (#1033)
* add extra flags for cluster creation

* move flags out of request.go
2020-02-03 07:38:30 -08:00
Adriano Cunha 446f2e9f2c
Use e2 VMs instead of n1 for test clusters (#1024)
* Use n2 VMs instead of n1 for test clusters

* Update unit tests that use default values
2020-01-30 16:20:28 -08:00
Matt Moore 949fbc99b5 golang format tools (#1016)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)`
  `goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party)`
/assign n3wscott
/cc n3wscott
2020-01-28 07:32:26 -08:00
Chi Zhang b51ee347cb give cloud-platform scope by default (#1015) 2020-01-27 17:39:25 -08:00
Chi Zhang d6f121ffaf Escape test name before matching slack message history (#1011)
* escape test name before matching slack message history

* address comments
2020-01-27 15:03:26 -08:00
chaodaiG d99cc30f66 Add a junithelper for creating a junit result from command (#926)
* Add a junithelper for creating a junit result from command

* Fix typo
2020-01-17 12:57:03 -08:00
Slavomir Kaslev c2a529b1b7 Fix several mishandled errors.Wrap conversions. (#992)
Fixes: e08acb95 (Remove all occurrences of github.com/pkg/errors. (#888))
2020-01-16 08:44:03 -08:00
Matt Moore b8dc5fbc6d golang format tools (#990)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)`
  `goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party)`
/assign n3wscott
/cc n3wscott
2020-01-13 10:25:02 -08:00
Chi Zhang e0330640f0 perf-tests cluster manager supports creating clusters in other environment (#982)
* perf-tests cluster manager supports creating clusters in other environment

* address codereview comments

* address comments
2020-01-10 11:29:57 -08:00
Scott Nichols 14387e78fb Ban importing aliased domains. (#696)
* Ban importing aliased domains,

* move import test.
2020-01-10 10:11:56 -08:00
Joyce Liu 169ef0797c Added GKE release channel support in cluster creation in cluster manager lib (#968)
* Added release channel support in cluster creation in cluster manager lib
* updated k8s beta dependency to pick up release channel API

* added unit test for the missing coverage in request_test.go
2020-01-02 11:27:42 -08:00
Matt Moore ead56ad1f3 Format markdown (#967)
Produced via:
  `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github)`
/assign n3wscott
/cc n3wscott
2019-12-30 10:37:37 -08:00
Lv Jiawei 00c3fda1d6 Update test README.md (#966)
Add flags and its explaination.
2019-12-27 11:11:32 -08:00
Shaoxuan Zhang bb8b596645 Add error checker functions. (#961) 2019-12-26 14:46:30 -08:00
Chi Zhang 84bccfd045 Add fake cred file to make client_test.go independent of gcloud (#963)
* add fake cred file to make the test independent of gcloud

* address comments
2019-12-26 13:16:29 -08:00
Matt Moore a7fa10c6db golang format tools (#960)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)`
  `goimports -w $(find -name '*.go' | grep -v vendor | grep -v third_party)`
/assign n3wscott
/cc n3wscott
2019-12-23 09:40:40 -08:00
Chi Zhang 9fda5bd59a For GKE clusters used in performance tests, always enable Workload Identity (#954)
* always enable workload identity for perf test cluster creation

* fix unit tests

* add comments
2019-12-20 19:25:35 -08:00
Markus Thömmes e08acb9512 Remove all occurrences of github.com/pkg/errors. (#888) 2019-12-17 10:41:03 -08:00
coryrc 9d8b936ca0 Switch *testing.T uses to equivalent interface + structured logging (#935)
Working to introduce structured logging to our tests. See #907

This work allows these test functions to be called by objects other
than *testing.T. The t.Error() calls are made compatible with
structured logging (wrapping Zap sugared logger calls) or code using
testing.T.
2019-12-13 10:22:54 -08:00
Chi Zhang 0c69403587 remove emit metrics flag (#929) 2019-12-09 07:01:45 -08:00
Francesco Guardiani 00cee157bd Added test utilities methods (#902)
* Added WaitForPodState to wait a state of a single pod

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Added WaitForServiceEndpoints

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Changes from review

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Change from review

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2019-11-27 07:13:21 -08:00
Markus Thömmes 47b250654a Add an -imagetemplate option to allow for more flexible test image locations. (#903) 2019-11-26 06:40:22 -08:00
Francesco Guardiani 2ec0f8da50 Mako stub improvements (#868)
* mako-stub now writes columns before the message output
mako-stub now REQUIRES the dev.config in the config-mako ConfigMap
mako-stub waits a configurable time for the stdout flush

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* mako-stub serves results with http AFTER the results are received
Added an handy script to read the results with http

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Trailing new line

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Applied suggested changes + fixed read_results.sh script

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>

* Changes from review

Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
2019-11-22 11:33:09 -08:00
Matt Moore cd063fbc21 golang format tools (#892)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign n3wscott
2019-11-21 11:06:08 -08:00
Chi Zhang 0400231005 Add a command package to run command line (#762)
* add Run and RunBatchSequentially

* add RunBatchParallelly

* minor changes

* parallel

* address feedbacks

* add trailing space

* sort import

* address CR feedbacks

* fix unit test

* change to private

* address comments

* nit
2019-11-20 07:35:08 -08:00
coryrc d9e3e244a6 Allow glog to coexist with klog (#881)
* Allow glog to coexist with klog

glog isn't used in our repos with good reason, but performance tests
use it, for now. This commit removes the ability to set klog flags
that aren't shared with glog, in return for the ability of glog to be imported.

* update-codegen
2019-11-15 10:57:02 -08:00
coryrc 3525756c2a Address serving#5949 by putting flag initialization into pkg. (#870)
Created a unit test for flag setup.
Use Subtests for table-driven tests.

Moved from https://github.com/knative/serving/pull/5984
2019-11-14 16:33:02 -08:00
Matt Moore e96196e347 golang format tools (#876)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
/assign n3wscott
2019-11-13 15:49:28 -08:00
Adriano Cunha 6335100d29 Allow passing options to NewSDKClient() (#864) 2019-11-11 15:00:22 -08:00
Markus Thömmes 56c2594e4f Assorted linting fixes. (#840)
* Remove unused code.

* Remove unneeded loops.

* Remove unneeded Printf calls.

* Use time.Since instead of time.Now().Sub.

* Remove unused values.

* Rename error variable according to conventions.

* Return error last.

* Simplify array allocations.

* Remove leaky ticker.

* Remove Yoda conditions.

* Remove deprecated function to talk to GKE.

* Remove dot import.

* Remove empty critical section and replace with a channel operation.

* Add linter directives to explicitly state wanted weirdness.

* Update deps.

* Fix broken line.
2019-11-01 12:49:12 -07:00
Matt Moore d4ce001394 This refactors our core webhook logic to be reconciler-based. (#833)
This is the culmination of a large number of changes to refactor our webhook logic, and adopt a reconciler-based approach to make it resilient to unexected system events (e.g. rogue GCs!).

For more details on how this is consumed, see the new `webhook/README.md`.

Fixes: https://github.com/knative/pkg/issues/782
Closes: https://github.com/knative/pkg/issues/529
Fixes: https://github.com/knative/pkg/issues/450
Related: https://github.com/knative/pkg/issues/141
2019-10-31 10:17:13 -07:00
Joyce Liu bbe1367911 Moved junit from test-infra to pkg (#834) 2019-10-30 11:44:12 -07:00
Matt Moore 3732de5802 Split secret creation into our reconciler resources style. (#830) 2019-10-29 23:08:11 -07:00