Commit Graph

18 Commits

Author SHA1 Message Date
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 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
Chi Zhang f591fc672a
export Client (#1278) 2020-05-04 00:22:43 -07:00
Victor Agababov 5ba6c1d101
Change %v to %w in errors and other nits (#1252)
* Change %v to %w in errors and other nits
Other are things I noticed when fixing the main %v->%w conversion

* fold
2020-04-27 15:04:51 -07:00
Kenjiro Nakayama f68639f04b
Shorten object name to avoid DNS issue defined (RFC 1035) (#1224)
* Shorten object name to avoid DNS issue defined (RFC 1035)

In serving, when running e2e test after changing the domainTempalte to
`{{.Name}}-{{.Namespace}}.{{Domain}}`, some tests failed with
following error:

```
Retrying for DNS error: Get http://service-to-service-call-via-activator-a-disabled-qgoluwzd-serving-tests.apps.ci-op-y42hx5lj-23b3e.origin-ci-int-aws.dev.rhcloud.com: dial tcp: lookup service-to-service-call-via-activator-a-disabled-qgoluwzd-serving-tests.apps.ci-op-y42hx5lj-23b3e.origin-ci-int-aws.dev.rhcloud.com: no such host
```

This is because DNS
label(`service-to-service-call-via-activator-a-disabled-qgoluwzd-serving-tests`)
became longer than 63 characters (RFC 1035).

To fix it, this patch changes the object name to less than 35
characters.

Note, the `35` is estimated by `Max(63) - (namespace(23) + buffer(5))`.

* Use kmeta.ChildName
2020-04-15 19:14:48 -07:00
Chi Zhang 55250e6aab
move libs from test-infra (#1171) 2020-04-01 11:43:17 -07: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 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
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
Chi Zhang 3f11504864 Some refactors of the pkg/test code (#763)
* some refactors of the pkg/test code

* move clustermanager

* fix unit tests

* address comments

* address feedback

* move clustermanager package

* add comments

* address comment
2019-10-15 23:03:15 -07:00
Chi Zhang d484d03f55 Finish the initial Alerter support for Mako (#645)
* add slack operations and the main alerter

* function renaming

* solve the codereview issues

* address feedbacks

* add unit test and fix some old unit tests
2019-09-11 14:35:31 -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
Chi Zhang d66945c363 Move common helper functions to pkg test (#424)
* move common functions to pkg test

* add unit test cases

* fix CR issues
2019-05-28 11:09:31 -07:00
Victor Agababov 7a5ce38287 Simplify and comment AppenRandomString (#282)
* Simplify and comment AppenRandomString

Port and rewrite the comment from the original.
Remove the sync.Once(). Initializing during package initialization is just as good.
Mutex doesn't have to be a pointer

* remove fancy rnd, remove mutex, add example, which would also check compilation

* actually commit the example

* add licence
2019-02-18 12:26:45 -08:00
mattmoor-sockpuppet d9eb9772e8 golang format tools (#276)
Produced via:
  `gofmt -s -w $(find -path './vendor' -prune -o -type f -name '*.go' -print))`
  `goimports -w $(find -name '*.go' | grep -v vendor)`
2019-02-13 08:29:42 -08:00
Leonardo Rossetti c089ddfc5d test/helpers module to store AppendRandomString helper fn (#256)
* test/helpers module to store AppendRandomString helper fn

* defer unlock
2019-02-12 12:10:43 -08:00