diff --git a/hack/update-deps.sh b/hack/update-deps.sh index e4ef7ab9542..5d7bd82fc59 100755 --- a/hack/update-deps.sh +++ b/hack/update-deps.sh @@ -28,8 +28,5 @@ dep ensure rm -rf $(find vendor/ -name 'BUILD') rm -rf $(find vendor/ -name 'BUILD.bazel') -# Keep the only dir in knative/test-infra we're interested in -find vendor/github.com/knative/test-infra -mindepth 1 -maxdepth 1 ! -name scripts -exec rm -fr {} \; - update_licenses third_party/VENDOR-LICENSE \ $(find . -name "*.go" | grep -v vendor | xargs grep "package main" | cut -d: -f1 | xargs -n1 dirname | uniq) diff --git a/vendor/github.com/knative/test-infra/.github/pull-request-template.md b/vendor/github.com/knative/test-infra/.github/pull-request-template.md new file mode 100644 index 00000000000..9b2b7820f61 --- /dev/null +++ b/vendor/github.com/knative/test-infra/.github/pull-request-template.md @@ -0,0 +1,7 @@ + + +Fixes # diff --git a/vendor/github.com/knative/test-infra/CONTRIBUTING.md b/vendor/github.com/knative/test-infra/CONTRIBUTING.md new file mode 100644 index 00000000000..bcfe857fda4 --- /dev/null +++ b/vendor/github.com/knative/test-infra/CONTRIBUTING.md @@ -0,0 +1,3 @@ +# Contribution guidelines + +So you want to hack on Knative Test Infrastructure? Yay! Please refer to Knative's overall [contribution guidelines](https://github.com/knative/docs/blob/master/community/CONTRIBUTING.md) to find out how you can help. diff --git a/vendor/github.com/knative/test-infra/Gopkg.lock b/vendor/github.com/knative/test-infra/Gopkg.lock new file mode 100644 index 00000000000..e0347ada5a9 --- /dev/null +++ b/vendor/github.com/knative/test-infra/Gopkg.lock @@ -0,0 +1,28 @@ +# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. + + +[[projects]] + branch = "master" + name = "github.com/google/licenseclassifier" + packages = [ + ".", + "internal/sets", + "stringclassifier", + "stringclassifier/internal/pq", + "stringclassifier/searchset", + "stringclassifier/searchset/tokenizer" + ] + revision = "3c8ad1f0b0644b6646210ee9cf2f34ff907e2e18" + +[[projects]] + name = "github.com/sergi/go-diff" + packages = ["diffmatchpatch"] + revision = "1744e2970ca51c86172c8190fadad617561ed6e7" + version = "v1.0.0" + +[solve-meta] + analyzer-name = "dep" + analyzer-version = 1 + inputs-digest = "aea50f9014005bedc3dc202c5fbf9d2d8c7a6f7beac2337fd863b23f411c4125" + solver-name = "gps-cdcl" + solver-version = 1 diff --git a/vendor/github.com/knative/test-infra/Gopkg.toml b/vendor/github.com/knative/test-infra/Gopkg.toml new file mode 100644 index 00000000000..1a03ba55a89 --- /dev/null +++ b/vendor/github.com/knative/test-infra/Gopkg.toml @@ -0,0 +1,14 @@ +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html +# for detailed Gopkg.toml documentation. + +required = [ + "github.com/google/licenseclassifier/licenses", +] + +# TODO(mattmoor): Find a way to bundle the licenseclassifier's +# license database, so folks don't have to go get it. + +[prune] + go-tests = true + unused-packages = true + non-go = true diff --git a/vendor/github.com/knative/test-infra/LICENSE b/vendor/github.com/knative/test-infra/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/vendor/github.com/knative/test-infra/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/knative/test-infra/OWNERS b/vendor/github.com/knative/test-infra/OWNERS new file mode 100644 index 00000000000..ed8dd603cf2 --- /dev/null +++ b/vendor/github.com/knative/test-infra/OWNERS @@ -0,0 +1,9 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- adrcunha +- dushyanthsc +- ericKlawitter +- jessiezcc +- srinivashegde86 +- steuhs diff --git a/vendor/github.com/knative/test-infra/README.md b/vendor/github.com/knative/test-infra/README.md new file mode 100644 index 00000000000..88f40521e11 --- /dev/null +++ b/vendor/github.com/knative/test-infra/README.md @@ -0,0 +1,17 @@ +# Knative Test Infrastructure + +The `test-infra` repository contains a collection of tools for testing Knative, collecting metrics +and displaying test results. + +## High level architecture + +Knative uses [Prow](https://github.com/kubernetes/test-infra/tree/master/prow) to schedule testing and update issues. + +### Gubernator + +Knative uses [gubernator](https://github.com/kubernetes/test-infra) to provide +a [PR dashboard](https://gubernator.knative.dev/pr) for contributions in the Knative github organization. + +### E2E Testing + +Our E2E testing uses [kubetest](https://github.com/kubernetes/test-infra/blob/master/kubetest) to build/deploy/test Knative clusters. diff --git a/vendor/github.com/knative/test-infra/WORKSPACE b/vendor/github.com/knative/test-infra/WORKSPACE new file mode 100644 index 00000000000..91db673d566 --- /dev/null +++ b/vendor/github.com/knative/test-infra/WORKSPACE @@ -0,0 +1,52 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Required rules for building kubernetes/test-infra +# These all come from http://github.com/kubernetes/test-infra/blob/master/WORKSPACE + +http_archive( + name = "io_bazel_rules_go", + sha256 = "1868ff68d6079e31b2f09b828b58d62e57ca8e9636edff699247c9108518570b", + url = "https://github.com/bazelbuild/rules_go/releases/download/0.11.1/rules_go-0.11.1.tar.gz", +) + +load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains") + +go_rules_dependencies() + +go_register_toolchains( + go_version = "1.10.2", +) + +git_repository( + name = "io_bazel_rules_k8s", + commit = "3756369d4920033c32c12d16207e8ee14fee1b18", + remote = "https://github.com/bazelbuild/rules_k8s.git", +) + +http_archive( + name = "io_bazel_rules_docker", + sha256 = "cef4e7adfc1df999891e086bf42bed9092cfdf374adb902f18de2c1d6e1e0197", + strip_prefix = "rules_docker-198367210c55fba5dded22274adde1a289801dc4", + urls = ["https://github.com/bazelbuild/rules_docker/archive/198367210c55fba5dded22274adde1a289801dc4.tar.gz"], +) + +# External repositories + +git_repository( + name = "k8s", + remote = "http://github.com/kubernetes/test-infra.git", + commit = "dd12621d6178838097847abf5842ad8d08fc9308", # HEAD as of 8/1/2018 +) + diff --git a/vendor/github.com/knative/test-infra/ci/README.md b/vendor/github.com/knative/test-infra/ci/README.md new file mode 100644 index 00000000000..51b28eddac4 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/README.md @@ -0,0 +1,3 @@ +# Continuous Integration / Continuous Deployment system + +This directory contains the configs for all systems related to Knative's CI/CD system. diff --git a/vendor/github.com/knative/test-infra/ci/gubernator/Makefile b/vendor/github.com/knative/test-infra/ci/gubernator/Makefile new file mode 100644 index 00000000000..5307d95d94f --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/gubernator/Makefile @@ -0,0 +1,33 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +SRC := test-infra/gubernator + +deploy: + # Fetch latest source, patch for our instance + rm -fr test-infra + git clone http://github.com/kubernetes/test-infra.git + cp config.yaml $(SRC) + cp redir_github.py $(SRC) + sed -i -e '/^runtime: .*/a service: gubernator' $(SRC)/app.yaml + sed -i -e "/^handlers:/a\- url: /timeline\n script: redir_github.app\n" $(SRC)/app.yaml + sed -i -e 's/user:kubernetes/user:knative/' $(SRC)/view_pr.py + sed -i -e 's/Kubernetes/Knative/' $(SRC)/templates/index.html + sed -i -e 's/k8s-testgrid.appspot.com/testgrid.knative.dev/' $(SRC)/filters.py + sed -i -e 's/k8s-testgrid/knative-testgrid/' $(SRC)/testgrid.py + # Deploy + make -C ../prow get-cluster-credentials + PROJECT=knative-tests make -C $(SRC) deploy + # Cleanup + rm -fr test-infra diff --git a/vendor/github.com/knative/test-infra/ci/gubernator/README.md b/vendor/github.com/knative/test-infra/ci/gubernator/README.md new file mode 100644 index 00000000000..14508c3dfda --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/gubernator/README.md @@ -0,0 +1,7 @@ +# Gubernator config + +This directory contains the config for our [Gubernator](https://github.com/kubernetes/test-infra/tree/master/gubernator) instance, plus a makefile for deploying it. + +* `config.yaml` Gubernator configuration. +* `Makefile` Recipe for deploying a Gubernator instance. +* `redir_github.py` Simple redirection handler to Gubernator's GitHub service. diff --git a/vendor/github.com/knative/test-infra/ci/gubernator/config.yaml b/vendor/github.com/knative/test-infra/ci/gubernator/config.yaml new file mode 100644 index 00000000000..794b4ce2bdd --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/gubernator/config.yaml @@ -0,0 +1,71 @@ + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +default_external_services: + gcs_pull_prefix: knative-prow/pr-logs/pull + prow_url: prow.knative.dev +default_org: knative +default_repo: serving +external_services: + knative: + gcs_bucket: knative-prow/ + gcs_pull_prefix: knative-prow/pr-logs/pull + prow_url: prow.knative.dev +jobs: + knative-prow/pr-logs/directory/: + - pull-knative-serving-build-tests + - pull-knative-serving-integration-tests + - pull-knative-serving-unit-tests + - pull-knative-eventing-build-tests + - pull-knative-eventing-integration-tests + - pull-knative-eventing-unit-tests + - pull-knative-eventing-sources-build-tests + - pull-knative-eventing-sources-integration-tests + - pull-knative-eventing-sources-unit-tests + - pull-knative-docs-build-tests + - pull-knative-docs-unit-tests + - pull-knative-docs-integration-tests + - pull-knative-build-templates-unit-tests + - pull-knative-build-templates-build-tests + - pull-knative-build-templates-integration-tests + - pull-knative-build-pipeline-build-tests + - pull-knative-build-pipeline-unit-tests + - pull-knative-build-build-tests + - pull-knative-build-unit-tests + - pull-knative-build-integration-tests + - pull-knative-pkg-build-tests + - pull-knative-pkg-unit-tests + - pull-knative-pkg-integration-tests + - pull-knative-test-infra-build-tests + - pull-knative-test-infra-unit-tests + - pull-knative-test-infra-integration-tests + - pull-knative-caching-build-tests + - pull-knative-caching-unit-tests + - pull-knative-caching-integration-tests + knative-prow/logs/: + - ci-knative-serving-continuous + - ci-knative-serving-release + - ci-knative-serving-playground + - ci-knative-build-continuous + - ci-knative-build-release + - ci-knative-eventing-continuous + - ci-knative-eventing-release + - ci-knative-eventing-sources-continuous + - ci-knative-eventing-sources-release + - ci-knative-build-templates-continuous + - ci-knative-docs-continuous + - ci-knative-pkg-continuous + - ci-knative-caching-continuous +recursive_artifacts: false diff --git a/vendor/github.com/knative/test-infra/ci/gubernator/redir_github.py b/vendor/github.com/knative/test-infra/ci/gubernator/redir_github.py new file mode 100644 index 00000000000..e168d6adbc5 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/gubernator/redir_github.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Simple redirection handler to Gubernator's GitHub service.""" + +import webapp2 + +class GitHubRedirect(webapp2.RequestHandler): + def get(self): + self.redirect("https://github-dot-knative-tests.appspot.com" + self.request.path_qs) + +app = webapp2.WSGIApplication([(r'/.*', GitHubRedirect),], debug=True, config={}) diff --git a/vendor/github.com/knative/test-infra/ci/prow/Makefile b/vendor/github.com/knative/test-infra/ci/prow/Makefile new file mode 100644 index 00000000000..9b6fcfbea17 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/Makefile @@ -0,0 +1,42 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +CLUSTER ?= prow +PROJECT ?= knative-tests +ZONE ?= us-central1-f +JOB_NAMESPACE ?= test-pods + +PROW_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + +get-cluster-credentials: + gcloud container clusters get-credentials "$(CLUSTER)" --project="$(PROJECT)" --zone="$(ZONE)" + +update-config: get-cluster-credentials + kubectl create configmap config --from-file=config.yaml=config.yaml --dry-run -o yaml | kubectl replace configmap config -f - + +update-plugins: get-cluster-credentials + kubectl create configmap plugins --from-file=plugins.yaml=plugins.yaml --dry-run -o yaml | kubectl replace configmap plugins -f - + +update-boskos: get-cluster-credentials + kubectl apply -f boskos/config.yaml + +update-boskos-config: get-cluster-credentials + kubectl create configmap resources --from-file=config=boskos/resources.yaml --dry-run -o yaml | kubectl --namespace="$(JOB_NAMESPACE)" replace configmap resources -f - + +update-cluster: get-cluster-credentials + kubectl apply -f cluster.yaml + +test: + bazel run @k8s//prow/cmd/config -- --plugin-config=$(PROW_DIR)/plugins.yaml + bazel run @k8s//prow/cmd/config -- --config-path=$(PROW_DIR)/config.yaml diff --git a/vendor/github.com/knative/test-infra/ci/prow/README.md b/vendor/github.com/knative/test-infra/ci/prow/README.md new file mode 100644 index 00000000000..04fd12e6bb2 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/README.md @@ -0,0 +1,10 @@ +# Prow config + +This directory contains the config for our [Prow](https://github.com/kubernetes/test-infra/tree/master/prow) instance. + +* `boskos` Configuration for the Boskos instance. +* `Makefile` Commands to interact with the Prow instance regarding updates. +* `cluster.yaml` Configuration of the Prow cluster. +* `config.yaml` Configuration of the Prow jobs. +* `config_start.yaml` Initial, empty configuration for Prow. +* `plugins.yaml` Configuration of the Prow plugins. diff --git a/vendor/github.com/knative/test-infra/ci/prow/boskos/README.md b/vendor/github.com/knative/test-infra/ci/prow/boskos/README.md new file mode 100644 index 00000000000..8e6e90ab6b1 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/boskos/README.md @@ -0,0 +1,6 @@ +# Boskos config + +This directory contains the config for our [Boskos](https://github.com/kubernetes/test-infra/tree/master/boskos) instance. + +* `config.yaml` Boskos configuration. +* `resources.yaml` Pool of projects used by Boskos. diff --git a/vendor/github.com/knative/test-infra/ci/prow/boskos/config.yaml b/vendor/github.com/knative/test-infra/ci/prow/boskos/config.yaml new file mode 100644 index 00000000000..a444d6cff8b --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/boskos/config.yaml @@ -0,0 +1,152 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Boskos deployment for Knative Prow instance +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + labels: + app: boskos + name: boskos-storage + namespace: test-pods +spec: + claimRef: + name: boskos-volume-boskos-0 + namespace: test-pods + capacity: + storage: 1Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + gcePersistentDisk: + pdName: boskos-storage + fsType: ext4 +--- +# Start of StatefulSet +apiVersion: apps/v1beta1 +kind: StatefulSet +metadata: + name: boskos + namespace: test-pods +spec: + serviceName: "boskos" + replicas: 1 # one canonical source of resources + template: + metadata: + labels: + app: boskos + namespace: test-pods + spec: + serviceAccountName: "boskos" + terminationGracePeriodSeconds: 30 + containers: + - name: boskos + image: gcr.io/k8s-testimages/boskos:v20180405-12e892d69 + args: + - --storage=/store/boskos.json + - --config=/etc/config/config + - --namespace=test-pods + ports: + - containerPort: 8080 + protocol: TCP + volumeMounts: + - name: boskos-volume + mountPath: /store + - name: boskos-config + mountPath: /etc/config + readOnly: true + volumes: + - name: boskos-config + configMap: + name: resources + volumeClaimTemplates: + - metadata: + name: boskos-volume + spec: + accessModes: [ "ReadWriteOnce" ] + storageClassName: boskos + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: Service +metadata: + name: boskos + namespace: test-pods +spec: + selector: + app: boskos + ports: + - name: default + protocol: TCP + port: 80 + targetPort: 8080 +--- +# Janitor +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: boskos-janitor + labels: + app: boskos-janitor + namespace: test-pods +spec: + replicas: 3 # 3 distributed janitor instances + template: + metadata: + labels: + app: boskos-janitor + spec: + serviceAccountName: "boskos" + terminationGracePeriodSeconds: 300 + containers: + - name: boskos-janitor + image: gcr.io/k8s-testimages/janitor:v20180619-83c62c891 + args: + - --service-account=/etc/service-account/service-account.json + - --resource-type=gke-project + - --pool-size=10 + volumeMounts: + - mountPath: /etc/service-account + name: service + readOnly: true + volumes: + - name: service + secret: + secretName: service-account +--- +# Reaper +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: boskos-reaper + labels: + app: boskos-reaper + namespace: test-pods +spec: + replicas: 1 # one canonical source of resources + template: + metadata: + labels: + app: boskos-reaper + spec: + serviceAccountName: "boskos" + terminationGracePeriodSeconds: 30 + containers: + - name: boskos-reaper + image: gcr.io/k8s-testimages/reaper:v20180402-43203f868 + args: + - --resource-type=gke-project diff --git a/vendor/github.com/knative/test-infra/ci/prow/boskos/config_start.yaml b/vendor/github.com/knative/test-infra/ci/prow/boskos/config_start.yaml new file mode 100644 index 00000000000..dc8d66b6295 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/boskos/config_start.yaml @@ -0,0 +1,23 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Initial configuration of Boskos + +apiVersion: v1 +kind: ConfigMap +metadata: + name: resources + namespace: test-pods +data: + resources: "" diff --git a/vendor/github.com/knative/test-infra/ci/prow/boskos/resources.yaml b/vendor/github.com/knative/test-infra/ci/prow/boskos/resources.yaml new file mode 100644 index 00000000000..58f734358f6 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/boskos/resources.yaml @@ -0,0 +1,38 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +resources: +- names: + - knative-boskos-01 + - knative-boskos-02 + - knative-boskos-03 + - knative-boskos-04 + - knative-boskos-05 + - knative-boskos-06 + - knative-boskos-07 + - knative-boskos-08 + - knative-boskos-09 + - knative-boskos-10 + - knative-boskos-11 + - knative-boskos-12 + - knative-boskos-13 + - knative-boskos-14 + - knative-boskos-15 + - knative-boskos-16 + - knative-boskos-17 + - knative-boskos-18 + - knative-boskos-19 + - knative-boskos-20 + state: dirty + type: gke-project diff --git a/vendor/github.com/knative/test-infra/ci/prow/cluster.yaml b/vendor/github.com/knative/test-infra/ci/prow/cluster.yaml new file mode 100644 index 00000000000..5031611756f --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/cluster.yaml @@ -0,0 +1,350 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This file contains Kubernetes YAML files for the most important prow components. +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + name: prowjobs.prow.k8s.io +spec: + group: prow.k8s.io + version: v1 + names: + kind: ProwJob + singular: prowjob + plural: prowjobs + scope: Namespaced + validation: + openAPIV3Schema: + properties: + spec: + properties: + max_concurrency: + type: integer + minimum: 0 + type: + type: string + enum: + - "presubmit" + - "postsubmit" + - "periodic" + - "batch" + status: + properties: + state: + type: string + enum: + - "triggered" + - "pending" + - "success" + - "failure" + - "aborted" + - "error" + anyOf: + - not: + properties: + state: + type: string + enum: + - "success" + - "failure" + - "error" + - "aborted" + - required: + - completionTime +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: hook + labels: + app: hook +spec: + replicas: 2 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + template: + metadata: + labels: + app: hook + spec: + serviceAccountName: "hook" + terminationGracePeriodSeconds: 180 + containers: + - name: hook + image: gcr.io/k8s-prow/hook:v20181023-ca14137 + imagePullPolicy: Always + args: + - --dry-run=false + ports: + - name: http + containerPort: 8888 + volumeMounts: + - name: hmac + mountPath: /etc/webhook + readOnly: true + - name: oauth + mountPath: /etc/github + readOnly: true + - name: config + mountPath: /etc/config + readOnly: true + - name: plugins + mountPath: /etc/plugins + readOnly: true + volumes: + - name: hmac + secret: + secretName: hmac-token + - name: oauth + secret: + secretName: oauth-token + - name: config + configMap: + name: config + - name: plugins + configMap: + name: plugins +--- +apiVersion: v1 +kind: Service +metadata: + name: hook +spec: + selector: + app: hook + ports: + - port: 8888 + type: NodePort +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: plank + labels: + app: plank +spec: + replicas: 1 # Do not scale up. + template: + metadata: + labels: + app: plank + spec: + serviceAccountName: "plank" + containers: + - name: plank + image: gcr.io/k8s-prow/plank:v20180709-7109caeb1 + args: + - --dry-run=false + volumeMounts: + - name: oauth + mountPath: /etc/github + readOnly: true + - name: config + mountPath: /etc/config + readOnly: true + volumes: + - name: oauth + secret: + secretName: oauth-token + - name: config + configMap: + name: config +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: sinker + labels: + app: sinker +spec: + replicas: 1 + template: + metadata: + labels: + app: sinker + spec: + serviceAccountName: "sinker" + containers: + - name: sinker + image: gcr.io/k8s-prow/sinker:v20180709-7109caeb1 + volumeMounts: + - name: config + mountPath: /etc/config + readOnly: true + volumes: + - name: config + configMap: + name: config +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: deck + labels: + app: deck +spec: + replicas: 2 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + template: + metadata: + labels: + app: deck + spec: + serviceAccountName: "deck" + terminationGracePeriodSeconds: 30 + containers: + - name: deck + image: gcr.io/k8s-prow/deck:v20180709-7109caeb1 + args: + - --hook-url=http://hook:8888/plugin-help + - --tide-url=http://tide/ + ports: + - name: http + containerPort: 8080 + volumeMounts: + - name: config + mountPath: /etc/config + readOnly: true + volumes: + - name: config + configMap: + name: config +--- +apiVersion: v1 +kind: Service +metadata: + name: deck +spec: + selector: + app: deck + ports: + - port: 80 + targetPort: 8080 + type: NodePort +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: horologium + labels: + app: horologium +spec: + replicas: 1 + template: + metadata: + labels: + app: horologium + spec: + serviceAccountName: "horologium" + terminationGracePeriodSeconds: 30 + containers: + - name: horologium + image: gcr.io/k8s-prow/horologium:v20180709-7109caeb1 + volumeMounts: + - name: config + mountPath: /etc/config + readOnly: true + volumes: + - name: config + configMap: + name: config + +# Ingresses + +--- +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: deck-ing + annotations: + kubernetes.io/ingress.class: "gce" + kubernetes.io/ingress.global-static-ip-name: prow-ingress +spec: + tls: + - secretName: tls-secret + hosts: + - prow.knative.dev + rules: + - host: prow.knative.dev + http: + paths: + - path: /* + backend: + serviceName: deck + servicePort: 80 + - path: /hook + backend: + serviceName: hook + servicePort: 8888 + +# Tide + +apiVersion: v1 +kind: Service +metadata: + name: tide +spec: + selector: + app: tide + ports: + - port: 80 + targetPort: 8888 + type: NodePort +--- +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: tide + labels: + app: tide +spec: + replicas: 1 # Do not scale up. + template: + metadata: + labels: + app: tide + spec: + serviceAccountName: "tide" + containers: + - name: tide + image: gcr.io/k8s-prow/tide:v20180808-68cee5a41 + args: + - --dry-run=false + ports: + - name: http + containerPort: 8888 + volumeMounts: + - name: oauth + mountPath: /etc/github + readOnly: true + - name: config + mountPath: /etc/config + readOnly: true + volumes: + - name: oauth + secret: + secretName: oauth-token + - name: config + configMap: + name: config + diff --git a/vendor/github.com/knative/test-infra/ci/prow/config.yaml b/vendor/github.com/knative/test-infra/ci/prow/config.yaml new file mode 100644 index 00000000000..c88098662a1 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/config.yaml @@ -0,0 +1,2250 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +plank: + job_url_template: 'https://gubernator.knative.dev/build/knative-prow/{{if or (eq .Spec.Type "presubmit") (eq .Spec.Type "batch")}}pr-logs/pull{{with .Spec.Refs}}/{{.Org}}_{{.Repo}}{{end}}{{else}}logs{{end}}{{if eq .Spec.Type "presubmit"}}/{{with index .Spec.Refs.Pulls 0}}{{.Number}}{{end}}{{else if eq .Spec.Type "batch"}}/batch{{end}}/{{.Spec.Job}}/{{.Status.BuildID}}/' + report_template: '[Full PR test history](https://gubernator.knative.dev/pr/{{.Spec.Refs.Org}}_{{.Spec.Refs.Repo}}/{{with index .Spec.Refs.Pulls 0}}{{.Number}}{{end}}). [Your PR dashboard](https://gubernator.knative.dev/pr/{{with index .Spec.Refs.Pulls 0}}{{.Author}}{{end}}).' + pod_pending_timeout: 60m + default_decoration_config: + timeout: 7200000000000 # 2h + grace_period: 15000000000 # 15s + utility_images: + clonerefs: "gcr.io/k8s-prow/clonerefs@sha256:b62ba1f379ac19c5ec9ee7bcab14d3f0b3c31cea9cdd4bc491e98e2c5f346c07" + initupload: "gcr.io/k8s-prow/initupload@sha256:58f89f2aae68f7dc46aaf05c7e8204c4f26b53ec9ce30353d1c27ce44a60d121" + entrypoint: "gcr.io/k8s-prow/entrypoint:v20180512-0255926d1" + sidecar: "gcr.io/k8s-prow/sidecar@sha256:8807b2565f4d2699920542fcf890878824b1ede4198d7ff46bca53feb064ed44" + gcs_configuration: + bucket: "knative-prow" + path_strategy: "explicit" + gcs_credentials_secret: "service-account" + +prowjob_namespace: default +pod_namespace: test-pods +log_level: info + +branch-protection: + orgs: + knative: + # Protect all branches in knative + # This means all prow jobs with "always_run" set are required + # to pass before tide can merge the PR. + # Currently this is manually enabled by the knative org admins, + # but it's stated here for documentation and reference purposes. + protect: true + # Admins can overrule checks + enforce_admins: false + +tide: + queries: + - repos: + - knative/build + - knative/build-pipeline + - knative/build-templates + - knative/serving + - knative/eventing + - knative/eventing-sources + - knative/docs + - knative/test-infra + - knative/pkg + - knative/caching + labels: + - lgtm + - approved + missingLabels: + - do-not-merge/hold + - do-not-merge/work-in-progress + merge_method: + knative: squash + knative/build-pipeline: rebase + target_url: https://prow.knative.dev/tide.html + +presets: +- labels: + preset-service-account: "true" + env: + - name: GOOGLE_APPLICATION_CREDENTIALS + value: /etc/service-account/service-account.json + volumes: + - name: service + secret: + secretName: service-account + volumeMounts: + - name: service + mountPath: /etc/service-account + readOnly: true +# storage / caching presets +- labels: + preset-bazel-scratch-dir: "true" + env: + - name: TEST_TMPDIR + value: /bazel-scratch/.cache/bazel + volumes: + - name: bazel-scratch + emptyDir: {} + volumeMounts: + - name: bazel-scratch + mountPath: /bazel-scratch/.cache +- labels: + preset-bazel-remote-cache-enabled: "false" + env: + - name: BAZEL_REMOTE_CACHE_ENABLED + value: "false" +# docker-in-docker presets +- labels: + preset-dind-enabled: "true" + env: + - name: DOCKER_IN_DOCKER_ENABLED + value: "true" + volumes: + - name: docker-graph + emptyDir: {} + volumeMounts: + - name: docker-graph + mountPath: /docker-graph + +presubmits: + knative/serving: + - name: pull-knative-serving-build-tests + agent: kubernetes + context: pull-knative-serving-build-tests + always_run: true + rerun_command: "/test pull-knative-serving-build-tests" + trigger: "(?m)^/test (all|pull-knative-serving-build-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--build-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-serving-unit-tests + agent: kubernetes + context: pull-knative-serving-unit-tests + always_run: true + rerun_command: "/test pull-knative-serving-unit-tests" + trigger: "(?m)^/test (all|pull-knative-serving-unit-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--unit-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-serving-integration-tests + agent: kubernetes + context: pull-knative-serving-integration-tests + always_run: true + rerun_command: "/test pull-knative-serving-integration-tests" + trigger: "(?m)^/test (all|pull-knative-serving-integration-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--integration-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-serving-go-coverage + labels: + preset-service-account: "true" + agent: kubernetes + context: pull-knative-serving-go-coverage + always_run: true + rerun_command: "/test pull-knative-serving-go-coverage" + trigger: "(?m)^/test (all|pull-knative-serving-go-coverage),?(\\s+|$)" + optional: true + decorate: true + clone_uri: "https://github.com/knative/serving.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--postsubmit-gcs-bucket=knative-prow" + - "--postsubmit-job-name=post-knative-serving-go-coverage" + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=50" + - "--github-token=/etc/github-token/token" + volumeMounts: + - name: github-token + mountPath: /etc/github-token + readOnly: true + volumes: + - name: github-token + secret: + secretName: covbot-token + + - name: pull-knative-serving-go-coverage-dev + labels: + preset-service-account: "true" + agent: kubernetes + context: pull-knative-serving-go-coverage-dev + always_run: false + rerun_command: "/test pull-knative-serving-go-coverage-dev" + trigger: "(?m)^/test (pull-knative-serving-go-coverage-dev),?(\\s+|$)" + optional: true + decorate: true + clone_uri: "https://github.com/knative/serving.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage-dev:latest-dev + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--postsubmit-gcs-bucket=knative-prow" + - "--postsubmit-job-name=post-knative-serving-go-coverage" + - "--profile-name=coverage_profile.txt" + - "--artifacts=$(ARTIFACTS)" + - "--cov-target=." + - "--cov-threshold-percentage=81" + - "--github-token=/etc/github-token/token" + volumeMounts: + - name: github-token + mountPath: /etc/github-token + readOnly: true + volumes: + - name: github-token + secret: + secretName: covbot-token + + knative/build: + - name: pull-knative-build-build-tests + agent: kubernetes + context: pull-knative-build-build-tests + always_run: true + rerun_command: "/test pull-knative-build-build-tests" + trigger: "(?m)^/test (all|pull-knative-build-build-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--build-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-build-unit-tests + agent: kubernetes + context: pull-knative-build-unit-tests + always_run: true + rerun_command: "/test pull-knative-build-unit-tests" + trigger: "(?m)^/test (all|pull-knative-build-unit-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--unit-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-build-integration-tests + agent: kubernetes + context: pull-knative-build-integration-tests + always_run: true + rerun_command: "/test pull-knative-build-integration-tests" + trigger: "(?m)^/test (all|pull-knative-build-integration-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + preset-dind-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--integration-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-build-go-coverage + labels: + preset-service-account: "true" + agent: kubernetes + context: pull-knative-build-go-coverage + always_run: true + rerun_command: "/test pull-knative-build-go-coverage" + trigger: "(?m)^/test (all|pull-knative-build-go-coverage),?(\\s+|$)" + optional: true + decorate: true + clone_uri: "https://github.com/knative/build.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--postsubmit-gcs-bucket=knative-prow" + - "--postsubmit-job-name=post-knative-build-go-coverage" + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=50" + - "--github-token=/etc/github-token/token" + volumeMounts: + - name: github-token + mountPath: /etc/github-token + readOnly: true + volumes: + - name: github-token + secret: + secretName: covbot-token + + knative/build-pipeline: + - name: pull-knative-build-pipeline-build-tests + agent: kubernetes + context: pull-knative-build-pipeline-build-tests + always_run: true + rerun_command: "/test pull-knative-build-pipeline-build-tests" + trigger: "(?m)^/test (all|pull-knative-build-pipeline-build-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--build-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-build-pipeline-unit-tests + agent: kubernetes + context: pull-knative-build-pipeline-unit-tests + always_run: true + rerun_command: "/test pull-knative-build-pipeline-unit-tests" + trigger: "(?m)^/test (all|pull-knative-build-pipeline-unit-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--unit-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-build-pipeline-integration-tests + agent: kubernetes + context: pull-knative-build-pipeline-integration-tests + always_run: true + rerun_command: "/test pull-knative-build-pipeline-integration-tests" + trigger: "(?m)^/test (all|pull-knative-build-pipeline-integration-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--integration-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-build-pipeline-go-coverage + labels: + preset-service-account: "true" + agent: kubernetes + context: pull-knative-build-pipeline-go-coverage + always_run: true + rerun_command: "/test pull-knative-build-pipeline-go-coverage" + trigger: "(?m)^/test (all|pull-knative-build-pipeline-go-coverage),?(\\s+|$)" + optional: true + decorate: true + clone_uri: "https://github.com/knative/build-pipeline.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--postsubmit-gcs-bucket=knative-prow" + - "--postsubmit-job-name=post-knative-build-pipeline-go-coverage" + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=50" + - "--github-token=/etc/github-token/token" + volumeMounts: + - name: github-token + mountPath: /etc/github-token + readOnly: true + volumes: + - name: github-token + secret: + secretName: covbot-token + + knative/eventing: + - name: pull-knative-eventing-build-tests + agent: kubernetes + context: pull-knative-eventing-build-tests + always_run: true + rerun_command: "/test pull-knative-eventing-build-tests" + trigger: "(?m)^/test (all|pull-knative-eventing-build-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--build-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-eventing-unit-tests + agent: kubernetes + context: pull-knative-eventing-unit-tests + always_run: true + rerun_command: "/test pull-knative-eventing-unit-tests" + trigger: "(?m)^/test (all|pull-knative-eventing-unit-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--unit-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-eventing-integration-tests + agent: kubernetes + context: pull-knative-eventing-integration-tests + always_run: true + rerun_command: "/test pull-knative-eventing-integration-tests" + trigger: "(?m)^/test (all|pull-knative-eventing-integration-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--integration-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-eventing-go-coverage + labels: + preset-service-account: "true" + agent: kubernetes + context: pull-knative-eventing-go-coverage + always_run: true + rerun_command: "/test pull-knative-eventing-go-coverage" + trigger: "(?m)^/test (all|pull-knative-eventing-go-coverage),?(\\s+|$)" + optional: true + decorate: true + clone_uri: "https://github.com/knative/eventing.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--postsubmit-gcs-bucket=knative-prow" + - "--postsubmit-job-name=post-knative-eventing-go-coverage" + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=50" + - "--github-token=/etc/github-token/token" + volumeMounts: + - name: github-token + mountPath: /etc/github-token + readOnly: true + volumes: + - name: github-token + secret: + secretName: covbot-token + + knative/eventing-sources: + - name: pull-knative-eventing-sources-build-tests + agent: kubernetes + context: pull-knative-eventing-sources-build-tests + always_run: true + rerun_command: "/test pull-knative-eventing-sources-build-tests" + trigger: "(?m)^/test (all|pull-knative-eventing-sources-build-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--build-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-eventing-sources-unit-tests + agent: kubernetes + context: pull-knative-eventing-sources-unit-tests + always_run: true + rerun_command: "/test pull-knative-eventing-sources-unit-tests" + trigger: "(?m)^/test (all|pull-knative-eventing-sources-unit-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--unit-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-eventing-sources-integration-tests + agent: kubernetes + context: pull-knative-eventing-sources-integration-tests + always_run: true + rerun_command: "/test pull-knative-eventing-sources-integration-tests" + trigger: "(?m)^/test (all|pull-knative-eventing-sources-integration-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--integration-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-eventing-sources-go-coverage + labels: + preset-service-account: "true" + agent: kubernetes + context: pull-knative-eventing-sources-go-coverage + always_run: true + rerun_command: "/test pull-knative-eventing-sources-go-coverage" + trigger: "(?m)^/test (all|pull-knative-eventing-sources-go-coverage),?(\\s+|$)" + optional: true + decorate: true + clone_uri: "https://github.com/knative/eventing-sources.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--postsubmit-gcs-bucket=knative-prow" + - "--postsubmit-job-name=post-knative-eventing-sources-go-coverage" + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=50" + - "--github-token=/etc/github-token/token" + volumeMounts: + - name: github-token + mountPath: /etc/github-token + readOnly: true + volumes: + - name: github-token + secret: + secretName: covbot-token + + knative/docs: + - name: pull-knative-docs-build-tests + agent: kubernetes + context: pull-knative-docs-build-tests + always_run: true + rerun_command: "/test pull-knative-docs-build-tests" + trigger: "(?m)^/test (all|pull-knative-docs-build-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--build-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-docs-unit-tests + agent: kubernetes + context: pull-knative-docs-unit-tests + always_run: true + rerun_command: "/test pull-knative-docs-unit-tests" + trigger: "(?m)^/test (all|pull-knative-docs-unit-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--unit-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-docs-integration-tests + agent: kubernetes + context: pull-knative-docs-integration-tests + always_run: true + rerun_command: "/test pull-knative-docs-integration-tests" + trigger: "(?m)^/test (all|pull-knative-docs-integration-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--integration-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-docs-go-coverage + labels: + preset-service-account: "true" + agent: kubernetes + context: pull-knative-docs-go-coverage + always_run: true + rerun_command: "/test pull-knative-docs-go-coverage" + trigger: "(?m)^/test (all|pull-knative-docs-go-coverage),?(\\s+|$)" + optional: true + decorate: true + clone_uri: "https://github.com/knative/docs.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--postsubmit-gcs-bucket=knative-prow" + - "--postsubmit-job-name=post-knative-docs-go-coverage" + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=50" + - "--github-token=/etc/github-token/token" + volumeMounts: + - name: github-token + mountPath: /etc/github-token + readOnly: true + volumes: + - name: github-token + secret: + secretName: covbot-token + + knative/build-templates: + - name: pull-knative-build-templates-build-tests + agent: kubernetes + context: pull-knative-build-templates-build-tests + always_run: true + rerun_command: "/test pull-knative-build-templates-build-tests" + trigger: "(?m)^/test (all|pull-knative-build-templates-build-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--build-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-build-templates-unit-tests + agent: kubernetes + context: pull-knative-build-templates-unit-tests + always_run: true + rerun_command: "/test pull-knative-build-templates-unit-tests" + trigger: "(?m)^/test (all|pull-knative-build-templates-unit-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--unit-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-build-templates-integration-tests + agent: kubernetes + context: pull-knative-build-templates-integration-tests + always_run: true + rerun_command: "/test pull-knative-build-templates-integration-tests" + trigger: "(?m)^/test (all|pull-knative-build-templates-integration-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--integration-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + knative/pkg: + - name: pull-knative-pkg-build-tests + agent: kubernetes + context: pull-knative-pkg-build-tests + always_run: true + rerun_command: "/test pull-knative-pkg-build-tests" + trigger: "(?m)^/test (all|pull-knative-pkg-build-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--build-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-pkg-unit-tests + agent: kubernetes + context: pull-knative-pkg-unit-tests + always_run: true + rerun_command: "/test pull-knative-pkg-unit-tests" + trigger: "(?m)^/test (all|pull-knative-pkg-unit-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--unit-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-pkg-integration-tests + agent: kubernetes + context: pull-knative-pkg-integration-tests + always_run: true + rerun_command: "/test pull-knative-pkg-integration-tests" + trigger: "(?m)^/test (all|pull-knative-pkg-integration-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--integration-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-pkg-go-coverage + labels: + preset-service-account: "true" + agent: kubernetes + context: pull-knative-pkg-go-coverage + always_run: true + rerun_command: "/test pull-knative-pkg-go-coverage" + trigger: "(?m)^/test (all|pull-knative-pkg-go-coverage),?(\\s+|$)" + optional: true + decorate: true + clone_uri: "https://github.com/knative/pkg.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--postsubmit-gcs-bucket=knative-prow" + - "--postsubmit-job-name=post-knative-pkg-go-coverage" + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=50" + - "--github-token=/etc/github-token/token" + volumeMounts: + - name: github-token + mountPath: /etc/github-token + readOnly: true + volumes: + - name: github-token + secret: + secretName: covbot-token + + knative/test-infra: + - name: pull-knative-test-infra-build-tests + agent: kubernetes + context: pull-knative-test-infra-build-tests + always_run: true + rerun_command: "/test pull-knative-test-infra-build-tests" + trigger: "(?m)^/test (all|pull-knative-test-infra-build-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--build-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-test-infra-unit-tests + agent: kubernetes + context: pull-knative-test-infra-unit-tests + always_run: true + rerun_command: "/test pull-knative-test-infra-unit-tests" + trigger: "(?m)^/test (all|pull-knative-test-infra-unit-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--unit-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-test-infra-integration-tests + agent: kubernetes + context: pull-knative-test-infra-integration-tests + always_run: true + rerun_command: "/test pull-knative-test-infra-integration-tests" + trigger: "(?m)^/test (all|pull-knative-test-infra-integration-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--integration-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + knative/caching: + - name: pull-knative-caching-build-tests + agent: kubernetes + context: pull-knative-caching-build-tests + always_run: true + rerun_command: "/test pull-knative-caching-build-tests" + trigger: "(?m)^/test (all|pull-knative-caching-build-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--build-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-caching-unit-tests + agent: kubernetes + context: pull-knative-caching-unit-tests + always_run: true + rerun_command: "/test pull-knative-caching-unit-tests" + trigger: "(?m)^/test (all|pull-knative-caching-unit-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--unit-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-caching-integration-tests + agent: kubernetes + context: pull-knative-caching-integration-tests + always_run: true + rerun_command: "/test pull-knative-caching-integration-tests" + trigger: "(?m)^/test (all|pull-knative-caching-integration-tests),?(\\s+|$)" + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/$(REPO_OWNER)/$(REPO_NAME)=$(PULL_REFS)" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/pr-logs" + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--integration-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + + - name: pull-knative-caching-go-coverage + labels: + preset-service-account: "true" + agent: kubernetes + context: pull-knative-caching-go-coverage + always_run: true + rerun_command: "/test pull-knative-caching-go-coverage" + trigger: "(?m)^/test (all|pull-knative-caching-go-coverage),?(\\s+|$)" + optional: true + decorate: true + clone_uri: "https://github.com/knative/caching.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--postsubmit-gcs-bucket=knative-prow" + - "--postsubmit-job-name=post-knative-caching-go-coverage" + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=50" + - "--github-token=/etc/github-token/token" + volumeMounts: + - name: github-token + mountPath: /etc/github-token + readOnly: true + volumes: + - name: github-token + secret: + secretName: covbot-token + +periodics: +- cron: "1 * * * *" # Run every hour and one minute + name: ci-knative-serving-continuous + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/serving" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=50" # Avoid overrun + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--all-tests" + - "--emit-metrics" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "1 8 * * *" # Run at 01:01PST every day (08:01 UTC) + name: ci-knative-serving-release + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/serving" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=90" # 1.5h + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./hack/release.sh" + - "--publish" + - "--tag-release" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "1 9 * * 6" # Run at 02:01PST every Saturday (09:01 UTC) + name: ci-knative-serving-playground + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/serving" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=90" # 1.5h + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./hack/deploy.sh" + - "knative-playground" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "5 8 * * *" # Run at 01:05PST every day (08:05 UTC) + name: ci-knative-serving-latency + agent: kubernetes + labels: + preset-service-account: "true" + decorate: true + extra_refs: + - org: knative + repo: serving + base_ref: master + clone_uri: "https://github.com/knative/serving.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/metrics:latest + imagePullPolicy: Always + command: + - "/metrics" + args: + - "--source-directory=ci-knative-serving-continuous" + - "--artifacts-dir=$(ARTIFACTS)" + - "--service-account=/etc/service-account/service-account.json" +- cron: "5 8 * * *" # Run at 01:05PST every day (08:05 UTC) + name: ci-knative-serving-api-coverage + agent: kubernetes + labels: + preset-service-account: "true" + decorate: true + extra_refs: + - org: knative + repo: serving + base_ref: master + clone_uri: "https://github.com/knative/serving.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/apicoverage:latest + imagePullPolicy: Always + command: + - "/apicoverage" + args: + - "--artifacts-dir=$(ARTIFACTS)" + - "--service-account=/etc/service-account/service-account.json" +- cron: "0 1 * * *" # Run at 01:00 every day + name: ci-knative-serving-go-coverage + agent: kubernetes + decorate: true + extra_refs: + - org: knative + repo: serving + base_ref: master + clone_uri: "https://github.com/knative/serving.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=80" +- cron: "0 1 * * *" # Run at 01:00 every day + name: ci-knative-serving-performance + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/serving" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=50" # Avoid overrun + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/performance-tests.sh" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + +- cron: "15 * * * *" # Run every hour and 15 minutes + name: ci-knative-build-continuous + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/build" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=50" # Avoid overrun + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--all-tests" + - "--emit-metrics" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "31 8 * * *" # Run at 01:31PST every day (08:31 UTC) + name: ci-knative-build-release + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + preset-dind-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/build" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=90" # 1.5h + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./hack/release.sh" + - "--publish" + - "--tag-release" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "5 8 * * *" # Run at 01:05PST every day (08:05 UTC) + name: ci-knative-build-latency + agent: kubernetes + labels: + preset-service-account: "true" + decorate: true + extra_refs: + - org: knative + repo: build + base_ref: master + clone_uri: "https://github.com/knative/build.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/metrics:latest + imagePullPolicy: Always + command: + - "/metrics" + args: + - "--source-directory=ci-knative-build-continuous" + - "--artifacts-dir=$(ARTIFACTS)" + - "--service-account=/etc/service-account/service-account.json" +- cron: "0 1 * * *" # Run at 01:00 every day + name: ci-knative-build-go-coverage + agent: kubernetes + decorate: true + extra_refs: + - org: knative + repo: build + base_ref: master + clone_uri: "https://github.com/knative/build.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=80" + +- cron: "0 1 * * *" # Run at 01:00 every day + name: ci-knative-build-pipeline-go-coverage + agent: kubernetes + decorate: true + extra_refs: + - org: knative + repo: build + base_ref: master + clone_uri: "https://github.com/knative/build-pipeline.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=80" + +- cron: "50 * * * *" # Run every hour and 50 minutes + name: ci-knative-docs-continuous + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/docs" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=50" # Avoid overrun + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--all-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "0 1 * * *" # Run at 01:00 every day + name: ci-knative-docs-go-coverage + agent: kubernetes + decorate: true + extra_refs: + - org: knative + repo: docs + base_ref: master + clone_uri: "https://github.com/knative/docs.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=80" + +- cron: "30 * * * *" # Run every hour and 30 minutes + name: ci-knative-eventing-continuous + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/eventing" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=50" # Avoid overrun + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--all-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "16 9 * * *" # Run at 02:16PST every day (09:16 UTC) + name: ci-knative-eventing-release + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/eventing" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=90" # 1.5h + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./hack/release.sh" + - "--publish" + - "--tag-release" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "0 1 * * *" # Run at 01:00 every day + name: ci-knative-eventing-go-coverage + agent: kubernetes + decorate: true + extra_refs: + - org: knative + repo: eventing + base_ref: master + clone_uri: "https://github.com/knative/eventing.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=80" + +- cron: "30 * * * *" # Run every hour and 30 minutes + name: ci-knative-eventing-sources-continuous + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/eventing-sources" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=50" # Avoid overrun + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--all-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "16 9 * * *" # Run at 02:16PST every day (09:16 UTC) + name: ci-knative-eventing-sources-release + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/eventing-sources" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=90" # 1.5h + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./hack/release.sh" + - "--publish" + - "--tag-release" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "0 1 * * *" # Run at 01:00 every day + name: ci-knative-eventing-sources-go-coverage + agent: kubernetes + decorate: true + extra_refs: + - org: knative + repo: eventing-sources + base_ref: master + clone_uri: "https://github.com/knative/eventing-sources.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=80" + +- cron: "40 * * * *" # Run every hour and 40 minutes + name: ci-knative-build-templates-continuous + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/build-templates" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=50" # Avoid overrun + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--all-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" + +- cron: "45 * * * *" # Run every hour and 45 minutes + name: ci-knative-pkg-continuous + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/pkg" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=50" # Avoid overrun + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--all-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "0 1 * * *" # Run at 01:00 every day + name: ci-knative-pkg-go-coverage + agent: kubernetes + decorate: true + extra_refs: + - org: knative + repo: pkg + base_ref: master + clone_uri: "https://github.com/knative/pkg.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=80" + +- cron: "30 * * * *" # Run every hour and 30 minutes + name: ci-knative-caching-continuous + agent: kubernetes + labels: + preset-service-account: "true" + preset-bazel-scratch-dir: "true" + preset-bazel-remote-cache-enabled: "true" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/prow-tests:latest + imagePullPolicy: Always + args: + - "--scenario=kubernetes_execute_bazel" + - "--clean" + - "--job=$(JOB_NAME)" + - "--repo=github.com/knative/caching" + - "--root=/go/src" + - "--service-account=/etc/service-account/service-account.json" + - "--upload=gs://knative-prow/logs" + - "--timeout=50" # Avoid overrun + - "--" # end bootstrap args, scenario args below + - "--" # end kubernetes_execute_bazel flags (consider following flags as text) + - "./test/presubmit-tests.sh" + - "--all-tests" + # Bazel needs privileged mode in order to sandbox builds. + securityContext: + privileged: true + resources: + requests: + memory: "1Gi" +- cron: "0 1 * * *" # Run at 01:00 every day + name: ci-knative-caching-go-coverage + agent: kubernetes + decorate: true + extra_refs: + - org: knative + repo: caching + base_ref: master + clone_uri: "https://github.com/knative/caching.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=80" + +postsubmits: + knative/serving: + - name: post-knative-serving-go-coverage + branches: + - master + agent: kubernetes + decorate: true + clone_uri: "https://github.com/knative/serving.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=0" + - name: post-knative-serving-go-coverage-dev + branches: + - master + agent: kubernetes + decorate: true + clone_uri: "https://github.com/knative/serving.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage-dev:latest-dev + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=0" + + knative/build: + - name: post-knative-build-go-coverage + branches: + - master + agent: kubernetes + decorate: true + clone_uri: "https://github.com/knative/build.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=0" + + knative/build-pipeline: + - name: post-knative-build-pipeline-go-coverage + branches: + - master + agent: kubernetes + decorate: true + clone_uri: "https://github.com/knative/build-pipeline.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=0" + + knative/docs: + - name: post-knative-docs-go-coverage + branches: + - master + agent: kubernetes + decorate: true + clone_uri: "https://github.com/knative/docs.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=0" + + knative/eventing: + - name: post-knative-eventing-go-coverage + branches: + - master + agent: kubernetes + decorate: true + clone_uri: "https://github.com/knative/eventing.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=0" + + knative/eventing-sources: + - name: post-knative-eventing-sources-go-coverage + branches: + - master + agent: kubernetes + decorate: true + clone_uri: "https://github.com/knative/eventing-sources.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=0" + + knative/pkg: + - name: post-knative-pkg-go-coverage + branches: + - master + agent: kubernetes + decorate: true + clone_uri: "https://github.com/knative/pkg.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=0" + + knative/caching: + - name: post-knative-caching-go-coverage + branches: + - master + agent: kubernetes + decorate: true + clone_uri: "https://github.com/knative/caching.git" + spec: + containers: + - image: gcr.io/knative-tests/test-infra/coverage:latest + imagePullPolicy: Always + command: + - "/coverage" + args: + - "--artifacts=$(ARTIFACTS)" + - "--profile-name=coverage_profile.txt" + - "--cov-target=." + - "--cov-threshold-percentage=0" diff --git a/vendor/github.com/knative/test-infra/ci/prow/config_start.yaml b/vendor/github.com/knative/test-infra/ci/prow/config_start.yaml new file mode 100644 index 00000000000..ada1a3e62fa --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/config_start.yaml @@ -0,0 +1,339 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Initial configuration of prow cluster + +# Configs + +apiVersion: v1 +kind: ConfigMap +metadata: + name: plugins +data: + plugins: "" +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: config +data: + config: "" +--- + +# Namespaces + +apiVersion: v1 +kind: Namespace +metadata: + name: prow +--- +apiVersion: v1 +kind: Namespace +metadata: + name: test-pods +--- + +# Service accounts, roles and bindings + +kind: ServiceAccount +apiVersion: v1 +metadata: + name: "boskos" + namespace: test-pods +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "boskos" + namespace: test-pods +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: boskos +subjects: +- kind: ServiceAccount + name: "boskos" + namespace: test-pods +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "boskos" + namespace: test-pods +rules: + - apiGroups: + - apiextensions.k8s.io + resources: + - customresourcedefinitions + verbs: + - create + - apiGroups: + - boskos.k8s.io + resources: + - resources + verbs: + - "*" +--- +kind: ServiceAccount +apiVersion: v1 +metadata: + name: "default" + namespace: test-pods +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "test-pods-default" + namespace: test-pods +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: "test-pods-default" +subjects: +- kind: ServiceAccount + name: "default" + namespace: test-pods +--- +kind: Role +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "test-pods-default" + namespace: test-pods +rules: + - apiGroups: + - "" + resources: + - pods + verbs: + - get +--- +kind: ServiceAccount +apiVersion: v1 +metadata: + name: "deck" +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "deck" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: "deck" +subjects: +- kind: ServiceAccount + name: "deck" + namespace: default +--- +kind: Role +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "deck" +rules: + - apiGroups: + - "" + resources: + - pods/log + verbs: + - get + - apiGroups: + - "prow.k8s.io" + resources: + - prowjobs + verbs: + - get + - list +--- +kind: ServiceAccount +apiVersion: v1 +metadata: + name: "horologium" +--- +kind: Role +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "horologium" +rules: + - apiGroups: + - "prow.k8s.io" + resources: + - prowjobs + verbs: + - create + - list +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "horologium" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: "horologium" +subjects: +- kind: ServiceAccount + name: "horologium" + namespace: default +--- +kind: ServiceAccount +apiVersion: v1 +metadata: + name: "plank" +--- +kind: Role +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "plank" +rules: + - apiGroups: + - "" + resources: + - pods + verbs: + - create + - delete + - list + - apiGroups: + - "prow.k8s.io" + resources: + - prowjobs + verbs: + - create + - list + - update +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "plank" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: "plank" +subjects: +- kind: ServiceAccount + name: "plank" + namespace: default +--- +kind: ServiceAccount +apiVersion: v1 +metadata: + name: "sinker" +--- +kind: Role +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "sinker" +rules: + - apiGroups: + - "" + resources: + - pods + verbs: + - delete + - list + - apiGroups: + - "prow.k8s.io" + resources: + - prowjobs + verbs: + - delete + - list +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "sinker" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: "sinker" +subjects: +- kind: ServiceAccount + name: "sinker" + namespace: default +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: "hook" +--- +kind: Role +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "hook" +rules: + - apiGroups: + - "prow.k8s.io" + resources: + - prowjobs + verbs: + - create + - get + - apiGroups: + - "" + resources: + - configmaps + verbs: + - update +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "hook" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: "hook" +subjects: +- kind: ServiceAccount + name: "hook" +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: "tide" +--- +kind: Role +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "tide" +rules: + - apiGroups: + - "prow.k8s.io" + resources: + - prowjobs + verbs: + - create + - get + - list + - apiGroups: + - "" + resources: + - configmaps + verbs: + - update +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1beta1 +metadata: + name: "tide" +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: "tide" +subjects: +- kind: ServiceAccount + name: "tide" + namespace: default diff --git a/vendor/github.com/knative/test-infra/ci/prow/plugins.yaml b/vendor/github.com/knative/test-infra/ci/prow/plugins.yaml new file mode 100644 index 00000000000..57c8b2f4079 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/plugins.yaml @@ -0,0 +1,41 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +approve: +- repos: + - knative + implicit_self_approve: true + review_acts_as_approve: true + +plugins: + knative: + - approve + - assign + - blunderbuss + - buildifier + - cat + - dog + - golint + - heart + - help + - hold + - label + - lgtm + - lifecycle + - shrug + - size + - skip + - trigger + - wip + - yuks diff --git a/vendor/github.com/knative/test-infra/ci/prow/prow_setup.md b/vendor/github.com/knative/test-infra/ci/prow/prow_setup.md new file mode 100644 index 00000000000..3f04729dfb5 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/prow/prow_setup.md @@ -0,0 +1,71 @@ +# Prow setup + +## Creating the cluster + +1. Create the GKE cluster, the role bindings and the GitHub secrets. You might need to update [Makefile](./Makefile). For details, see https://github.com/kubernetes/test-infra/blob/master/prow/getting_started.md. + +1. Ensure the GCP projects listed in [resources.yaml](./boskos/resources.yaml) are created. + +1. Apply [config_start.yaml](./config_start.yaml) to the cluster. + +1. Apply Boskos [config_start.yaml](./boskos/config_start.yaml) to the cluster. + +1. Run `make update-cluster`, `make update-boskos`, `make update-config`, `make update-plugins` and `make update-boskos-config`. + +1. If SSL needs to be reconfigured, promote your ingress IP to static in Cloud Console, and [create the TLS secret](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls). + +## Expanding Boskos pool + +1. Create a new GCP project and add it to [resources.yaml](./boskos/resources.yaml). + +1. Make `knative-tests@appspot.gserviceaccount.com` an editor of the project. + +1. Enable the Compute Engine API for the project (e.g., by visiting https://console.developers.google.com/apis/api/compute.googleapis.com/overview?project=XXXXXXXX). + +1. Enable the Kubernetes Engine API for the project (e.g., by visiting https://console.cloud.google.com/apis/api/container.googleapis.com/overview?project=XXXXXXXX). + +1. Run `make update-boskos-config`. + +## Setting up Prow for a new repo + +1. Create the appropriate `OWNERS` files (at least one for the root dir). + +1. Make sure that *Knative Robots* is an Admin of the repo. + +1. Update the tide section in the Prow config file and run `make update-config` (ask one of the owners of knative/test-infra). + +1. Wait a few minutes, check that Prow is working by entering `/woof` as a comment in any PR in the new repo. + +1. Set **tide** as a required status check for the master branch. + +### Setting up jobs for a new repo + +1. Have the test infrastructure in place (usually this means having at least `//test/presubmit-tests.sh` working, and optionally `//hack/release.sh` working for automated nightly releases). + +1. Merge a pull request (e.g., https://github.com/knative/test-infra/pull/203) that: + + 1. Updates the Prow config file (usually, copy and update existing jobs from another repository). + + 1. For the presubmit tests, setup the *pull-knative-**repo**-**(build|unit|integration)**-tests* jobs. + + 1. For go test coverage, setup the ***(pull|post|ci)**-knative-**repo**-go-coverage* jobs. + + 1. For the continuous integration tests, setup the *ci-knative-**repo**-continuous* job. + + 1. For automated nightly releases, setup the *ci-knative-**repo**-release* job. + + 1. Updates the Gubernator config with the new log dirs. + + 1. Updates the Testgrid config with the new buckets, tabs and dashboard. + +1. Ask one of the owners of *knative/test-infra* to: + + 1. Run `make update-config` in `ci/prow`. + + 1. Run `make deploy` in `ci/gubernator`. + + 1. Run `make update-config` in `ci/testgrid`. + +1. Wait a few minutes, enter `/retest` as a comment in any PR in the repo and ensure the test jobs are executed. + +1. Set the new test jobs as required status checks for the master branch. diff --git a/vendor/github.com/knative/test-infra/ci/testgrid/Makefile b/vendor/github.com/knative/test-infra/ci/testgrid/Makefile new file mode 100644 index 00000000000..5cf42d995b9 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/testgrid/Makefile @@ -0,0 +1,29 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +TESTGRID_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) + +test: + bazel run @k8s//testgrid/cmd/configurator -- \ + --yaml=$(TESTGRID_DIR)/config.yaml \ + --validate-config-file + +update-config: +ifndef GOOGLE_APPLICATION_CREDENTIALS + $(error GOOGLE_APPLICATION_CREDENTIALS not set) +endif + bazel run @k8s//testgrid/cmd/configurator -- \ + --yaml=$(TESTGRID_DIR)/config.yaml \ + --output=gs://knative-testgrid/config \ + --oneshot diff --git a/vendor/github.com/knative/test-infra/ci/testgrid/README.md b/vendor/github.com/knative/test-infra/ci/testgrid/README.md new file mode 100644 index 00000000000..7b028e040f3 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/testgrid/README.md @@ -0,0 +1,6 @@ +# Testgrid config + +This directory contains the config for our [Testgrid](https://github.com/kubernetes/test-infra/tree/master/testgrid) instance. + +* `Makefile` Commands to interact with the Testgrid instance regarding updates. +* `config.yaml` Testgrid configuration. diff --git a/vendor/github.com/knative/test-infra/ci/testgrid/config.yaml b/vendor/github.com/knative/test-infra/ci/testgrid/config.yaml new file mode 100644 index 00000000000..9af7ce15425 --- /dev/null +++ b/vendor/github.com/knative/test-infra/ci/testgrid/config.yaml @@ -0,0 +1,216 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Default testgroup and dashboardtab, please do not change them +default_test_group: + days_of_results: 14 # Number of days of test results to gather and serve + tests_name_policy: 2 # Replace the name of the test + ignore_pending: false # Show in-progress tests + column_header: + - configuration_value: Commit # Shows the commit number on column header + - configuration_value: infra-commit + num_columns_recent: 10 # The number of columns to consider "recent" for a variety of purposes + use_kubernetes_client: true # ** This field is deprecated and should always be true ** + is_external: true # ** This field is deprecated and should always be true ** + alert_stale_results_hours: 0 # Don't alert for staleness by default + num_failures_to_alert: 3 # Consider a test failed if it has 3 or more consecutive failures + num_passes_to_disable_alert: 1 # Consider a failing test passing if it has 1 or more consecutive passes + +default_dashboard_tab: + open_test_template: # The URL template to visit after clicking on a cell + url: https://gubernator.knative.dev/build// + file_bug_template: # The URL template to visit when filing a bug + url: https://github.com/knative/serving/issues/new + options: + - key: title + value: 'Test "" failed' + - key: body + value: + attach_bug_template: # The URL template to visit when attaching a bug + url: # Empty + options: # Empty + # Text to show in the about menu as a link to another view of the results + results_text: See these results in Gubernator + results_url_template: # The URL template to visit after clicking + url: https://gubernator.knative.dev/builds/ + # URL for regression search links. + code_search_path: github.com/knative/serving/search + num_columns_recent: 10 + code_search_url_template: # The URL template to visit when searching for changelists + url: https://github.com/knative/serving/compare/... + +# Test groups + +test_groups: +- name: ci-knative-serving-continuous + gcs_prefix: knative-prow/logs/ci-knative-serving-continuous +- name: ci-knative-serving-release + gcs_prefix: knative-prow/logs/ci-knative-serving-release +- name: ci-knative-serving-playground + gcs_prefix: knative-prow/logs/ci-knative-serving-playground +- name: pull-knative-serving-test-coverage + gcs_prefix: knative-prow/logs/ci-knative-serving-go-coverage + short_text_metric: coverage +- name: ci-knative-serving-latency + gcs_prefix: knative-prow/logs/ci-knative-serving-latency + short_text_metric: latency +- name: ci-knative-serving-api-coverage + gcs_prefix: knative-prow/logs/ci-knative-serving-api-coverage + short_text_metric: api_coverage +- name: ci-knative-build-continuous + gcs_prefix: knative-prow/logs/ci-knative-build-continuous +- name: ci-knative-build-release + gcs_prefix: knative-prow/logs/ci-knative-build-release +- name: pull-knative-build-test-coverage + gcs_prefix: knative-prow/logs/ci-knative-build-go-coverage + short_text_metric: coverage +- name: ci-knative-build-latency + gcs_prefix: knative-prow/logs/ci-knative-build-latency + short_text_metric: latency +- name: ci-knative-build-templates-continuous + gcs_prefix: knative-prow/logs/ci-knative-build-templates-continuous +- name: pull-knative-build-pipeline-test-coverage + gcs_prefix: knative-prow/logs/ci-knative-build-pipeline-go-coverage + short_text_metric: coverage +- name: ci-knative-eventing-continuous + gcs_prefix: knative-prow/logs/ci-knative-eventing-continuous +- name: ci-knative-eventing-release + gcs_prefix: knative-prow/logs/ci-knative-eventing-release +- name: pull-knative-eventing-test-coverage + gcs_prefix: knative-prow/logs/ci-knative-eventing-go-coverage + short_text_metric: coverage +- name: ci-knative-eventing-sources-continuous + gcs_prefix: knative-prow/logs/ci-knative-eventing-sources-continuous +- name: ci-knative-eventing-sources-release + gcs_prefix: knative-prow/logs/ci-knative-eventing-sources-release +- name: pull-knative-eventing-sources-test-coverage + gcs_prefix: knative-prow/logs/ci-knative-eventing-sources-go-coverage + short_text_metric: coverage +- name: ci-knative-docs-continuous + gcs_prefix: knative-prow/logs/ci-knative-docs-continuous +- name: pull-knative-docs-test-coverage + gcs_prefix: knative-prow/logs/ci-knative-docs-go-coverage + short_text_metric: coverage +- name: ci-knative-pkg-continuous + gcs_prefix: knative-prow/logs/ci-knative-pkg-continuous +- name: pull-knative-pkg-test-coverage + gcs_prefix: knative-prow/logs/ci-knative-pkg-go-coverage + short_text_metric: coverage +- name: ci-knative-caching-continuous + gcs_prefix: knative-prow/logs/ci-knative-caching-continuous +- name: pull-knative-caching-test-coverage + gcs_prefix: knative-prow/logs/ci-knative-caching-go-coverage + short_text_metric: coverage + +# Dashboards + +dashboards: +- name: knative-serving + dashboard_tab: + - name: continuous + test_group_name: ci-knative-serving-continuous + - name: release + test_group_name: ci-knative-serving-release + - name: playground + test_group_name: ci-knative-serving-playground + - name: coverage + test_group_name: pull-knative-serving-test-coverage + base_options: 'exclude-filter-by-regex=Overall&group-by-directory=&expand-groups=&sort-by-name=' + - name: latency + test_group_name: ci-knative-serving-latency + description: '95% latency in ms' + base_options: 'exclude-filter-by-regex=Overall&group-by-directory=&expand-groups=&sort-by-name=' + - name: api-coverage + test_group_name: ci-knative-serving-api-coverage + description: 'Conformance tests API coverage.' + base_options: 'exclude-filter-by-regex=Overall$&group-by-directory=&expand-groups=&sort-by-name=' + - name: conformance-tests + test_group_name: ci-knative-serving-continuous + base_options: 'include-filter-by-regex=//knative/serving/test/conformance:&sort-by-name=' +- name: knative-build + dashboard_tab: + - name: continuous + test_group_name: ci-knative-build-continuous + - name: release + test_group_name: ci-knative-build-release + - name: coverage + test_group_name: pull-knative-build-test-coverage + base_options: 'exclude-filter-by-regex=Overall&group-by-directory=&expand-groups=&sort-by-name=' + - name: latency + test_group_name: ci-knative-build-latency + description: '95% latency in ms' + base_options: 'exclude-filter-by-regex=Overall&group-by-directory=&expand-groups=&sort-by-name=' +- name: knative-build-templates + dashboard_tab: + - name: continuous + test_group_name: ci-knative-build-templates-continuous +- name: knative-build-pipeline + dashboard_tab: + - name: coverage + test_group_name: pull-knative-build-pipeline-test-coverage + base_options: 'exclude-filter-by-regex=Overall&group-by-directory=&expand-groups=&sort-by-name=' +- name: knative-eventing + dashboard_tab: + - name: continuous + test_group_name: ci-knative-eventing-continuous + - name: release + test_group_name: ci-knative-eventing-release + - name: coverage + test_group_name: pull-knative-eventing-test-coverage + base_options: 'exclude-filter-by-regex=Overall&group-by-directory=&expand-groups=&sort-by-name=' +- name: knative-eventing-sources + dashboard_tab: + - name: continuous + test_group_name: ci-knative-eventing-sources-continuous + - name: release + test_group_name: ci-knative-eventing-sources-release + - name: coverage + test_group_name: pull-knative-eventing-sources-test-coverage + base_options: 'exclude-filter-by-regex=Overall&group-by-directory=&expand-groups=&sort-by-name=' +- name: knative-docs + dashboard_tab: + - name: continuous + test_group_name: ci-knative-docs-continuous + - name: coverage + test_group_name: pull-knative-docs-test-coverage + base_options: 'exclude-filter-by-regex=Overall&group-by-directory=&expand-groups=&sort-by-name=' +- name: knative-pkg + dashboard_tab: + - name: continuous + test_group_name: ci-knative-pkg-continuous + - name: coverage + test_group_name: pull-knative-pkg-test-coverage + base_options: 'exclude-filter-by-regex=Overall&group-by-directory=&expand-groups=&sort-by-name=' +- name: knative-caching + dashboard_tab: + - name: continuous + test_group_name: ci-knative-caching-continuous + - name: coverage + test_group_name: pull-knative-caching-test-coverage + base_options: 'exclude-filter-by-regex=Overall&group-by-directory=&expand-groups=&sort-by-name=' + +# Dashboard groups + +dashboard_groups: +- name: knative + dashboard_names: + - knative-serving + - knative-build + - knative-build-templates + - knative-build-pipeline + - knative-eventing + - knative-eventing-sources + - knative-docs + - knative-pkg + - knative-caching diff --git a/vendor/github.com/knative/test-infra/dummy.go b/vendor/github.com/knative/test-infra/dummy.go new file mode 100644 index 00000000000..40028c14ec7 --- /dev/null +++ b/vendor/github.com/knative/test-infra/dummy.go @@ -0,0 +1,27 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "fmt" +) + +func main() { + fmt.Println("This is a dummy go file so `go dep` can be used with knative/test-infra repo") + fmt.Println("This file can be removed once the repo contains real, useful go code in the root dir") +} + diff --git a/vendor/github.com/knative/test-infra/images/README.md b/vendor/github.com/knative/test-infra/images/README.md new file mode 100644 index 00000000000..22b9b16edd0 --- /dev/null +++ b/vendor/github.com/knative/test-infra/images/README.md @@ -0,0 +1,3 @@ +# Prow Job Images + +This directory contains custom Docker images used by our Prow jobs. diff --git a/vendor/github.com/knative/test-infra/images/apicoverage/Dockerfile b/vendor/github.com/knative/test-infra/images/apicoverage/Dockerfile new file mode 100644 index 00000000000..897ec7d82ef --- /dev/null +++ b/vendor/github.com/knative/test-infra/images/apicoverage/Dockerfile @@ -0,0 +1,20 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:1.10.2 +LABEL maintainer "Srinivas Hegde " +RUN apt-get update && apt-get install -y --no-install-recommends + +COPY apicoverage /apicoverage +ENTRYPOINT ["/apicoverage"] diff --git a/vendor/github.com/knative/test-infra/images/apicoverage/Makefile b/vendor/github.com/knative/test-infra/images/apicoverage/Makefile new file mode 100644 index 00000000000..b5a87ca546c --- /dev/null +++ b/vendor/github.com/knative/test-infra/images/apicoverage/Makefile @@ -0,0 +1,23 @@ + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +REGISTRY ?= gcr.io +PROJECT ?= knative-tests/test-infra +PUSH ?= docker push + +apicoverage-image: + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ../../tools/apicoverage + docker build -t "$(REGISTRY)/$(PROJECT)/apicoverage:latest" . + $(PUSH) "$(REGISTRY)/$(PROJECT)/apicoverage:latest" diff --git a/vendor/github.com/knative/test-infra/images/apicoverage/README.md b/vendor/github.com/knative/test-infra/images/apicoverage/README.md new file mode 100644 index 00000000000..b855777358b --- /dev/null +++ b/vendor/github.com/knative/test-infra/images/apicoverage/README.md @@ -0,0 +1,3 @@ +# API coverage tool Image + +This directory contains the custom docker image used for calculating the API coverage by the conformance tests. diff --git a/vendor/github.com/knative/test-infra/images/prow-tests/Dockerfile b/vendor/github.com/knative/test-infra/images/prow-tests/Dockerfile new file mode 100644 index 00000000000..7baf483481e --- /dev/null +++ b/vendor/github.com/knative/test-infra/images/prow-tests/Dockerfile @@ -0,0 +1,56 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM gcr.io/k8s-testimages/kubekins-e2e:v20181001-df2f5324a-master +LABEL maintainer "Adriano Cunha " + +# Install extras on top of base image + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update +RUN gcloud components update + +# Docker +RUN gcloud components install docker-credential-gcr +RUN docker-credential-gcr configure-docker + +# Extra tools through apt-get +RUN apt-get install -y uuid-runtime # for uuidgen +RUN apt-get install -y npm # for markdown-link-check +RUN apt-get install -y rubygems # for mdl +RUN apt-get install -y build-essential libssl-dev # for wrk +RUN apt-get install -y netbase # sets up /etc/services needed for wrk + +# Extra tools through go get +RUN go get -u github.com/google/go-containerregistry/cmd/ko +RUN go get -u github.com/golang/dep/cmd/dep +RUN go get -u github.com/google/licenseclassifier + +# Extra tools through npm +RUN npm install -g markdown-link-check + +# Extra tools through gem +RUN gem install mixlib-config -v 2.2.4 # required because ruby is 2.1 +RUN gem install mdl + +# Install wrk +RUN git clone https://github.com/wg/wrk.git wrk +RUN make -C wrk/ +RUN cp wrk/wrk /usr/local/bin + +ADD . /go/src/github.com/knative/test-infra + +# Extra custom tools +RUN cp /go/src/github.com/knative/test-infra/tools/githubhelper/githubhelper . +RUN go install github.com/knative/test-infra/tools/dep-collector diff --git a/vendor/github.com/knative/test-infra/images/prow-tests/Makefile b/vendor/github.com/knative/test-infra/images/prow-tests/Makefile new file mode 100644 index 00000000000..6e1ce3c08ca --- /dev/null +++ b/vendor/github.com/knative/test-infra/images/prow-tests/Makefile @@ -0,0 +1,34 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +IMG = gcr.io/knative-tests/test-infra/prow-tests +TAG := $(shell date +v%Y%m%d)-$(shell git describe --tags --always --dirty) + +all: build + +build: + make -C ../../tools/githubhelper + docker build -t $(IMG):$(TAG) -f Dockerfile ../.. + docker tag $(IMG):$(TAG) $(IMG):latest + +push_versioned: build + docker push $(IMG):$(TAG) + +push_latest: build + docker push $(IMG):latest + +clean: + rm -fr githubhelper dep-collector + +push: push_versioned push_latest clean diff --git a/vendor/github.com/knative/test-infra/images/prow-tests/README.md b/vendor/github.com/knative/test-infra/images/prow-tests/README.md new file mode 100644 index 00000000000..d1b904427e4 --- /dev/null +++ b/vendor/github.com/knative/test-infra/images/prow-tests/README.md @@ -0,0 +1,13 @@ +# Prow Test Job Image + +This directory contains the custom Docker image used by our Prow test jobs. + +## Building and publishing a new image + +To build and push a new image, just run `make push`. + +For testing purposes you can build an image but not push it; to do so, run `make build`. + +Note that you must have proper permission in the `knative-tests` project to push new images to the GCR. + +The `prow-tests` image is pinned on a specific `kubekins` image; update `Dockerfile` if you need to use a newer/different image. This will basically define the versions of `bazel`, `go`, `kubectl` and other build tools. diff --git a/vendor/github.com/knative/test-infra/test/e2e-tests.sh b/vendor/github.com/knative/test-infra/test/e2e-tests.sh new file mode 100755 index 00000000000..128733ce38d --- /dev/null +++ b/vendor/github.com/knative/test-infra/test/e2e-tests.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script runs the end-to-end tests. + +# If you already have a Knative cluster setup and kubectl pointing +# to it, call this script with the --run-tests arguments and it will use +# the cluster and run the tests. + +# Calling this script without arguments will create a new cluster in +# project $PROJECT_ID, run the tests and delete the cluster. + +source $(dirname $0)/../scripts/e2e-tests.sh + +function parse_flags() { + if [[ "$1" == "--smoke-test-custom-flag" ]]; then + echo "--smoke-test-custom-flag passed" + exit 0 + fi + return 0 +} + +# Script entry point. + +initialize $@ + +if (( USING_EXISTING_CLUSTER )); then + echo "ERROR: this test isn't intended to run against an existing cluster" + fail_test +fi + +start_latest_knative_serving || fail_test "Knative Serving is not up" + +# This is actually a unit test, but it does exercise the necessary helper functions. +go_test_e2e -run TestE2ESucceeds ./test || fail_test + +success diff --git a/vendor/github.com/knative/test-infra/test/presubmit-tests.sh b/vendor/github.com/knative/test-infra/test/presubmit-tests.sh new file mode 100755 index 00000000000..ae0e0cc42ee --- /dev/null +++ b/vendor/github.com/knative/test-infra/test/presubmit-tests.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script runs the presubmit tests; it is started by prow for each PR. +# For convenience, it can also be executed manually. +# Running the script without parameters, or with the --all-tests +# flag, causes all tests to be executed, in the right order. +# Use the flags --build-tests, --unit-tests and --integration-tests +# to run a specific set of tests. + +source $(dirname $0)/../scripts/presubmit-tests.sh + +function build_tests() { + header "Running build tests" + local failed=0 + make -C ci/prow test || failed=1 + make -C ci/testgrid test || failed=1 + for script in scripts/*.sh; do + subheader "Checking integrity of ${script}" + bash -c "source ${script}" || failed=1 + done + return ${failed} +} + +function unit_tests() { + header "Running unit tests" + local failed=0 + for test in ./test/unit/*-tests.sh; do + subheader "Running tests in ${test}" + ${test} || failed=1 + done + return ${failed} +} + +# We use the default integration test runner. + +main $@ diff --git a/vendor/github.com/knative/test-infra/test/unit/e2e-custom-flag-tests.sh b/vendor/github.com/knative/test-infra/test/unit/e2e-custom-flag-tests.sh new file mode 100755 index 00000000000..b5528861752 --- /dev/null +++ b/vendor/github.com/knative/test-infra/test/unit/e2e-custom-flag-tests.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script runs the end-to-end tests. + +# If you already have a Knative cluster setup and kubectl pointing +# to it, call this script with the --run-tests arguments and it will use +# the cluster and run the tests. + +# Calling this script without arguments will create a new cluster in +# project $PROJECT_ID, run the tests and delete the cluster. + +source $(dirname $0)/../../scripts/e2e-tests.sh + +function parse_flags() { + if [[ "$1" == "--smoke-test-custom-flag" ]]; then + echo "OK: --smoke-test-custom-flag passed" + exit 0 + fi + fail_test "Unexpected flag $1 passed" +} + +# Script entry point. + +initialize --smoke-test-custom-flag diff --git a/vendor/github.com/knative/test-infra/test/unit/library-tests.sh b/vendor/github.com/knative/test-infra/test/unit/library-tests.sh new file mode 100755 index 00000000000..a8be4415fcd --- /dev/null +++ b/vendor/github.com/knative/test-infra/test/unit/library-tests.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Fake we're in a Prow job, if running locally. +[[ -z "${PROW_JOB_ID:-}" ]] && PROW_JOB_ID=123 + +source $(dirname $0)/../../scripts/library.sh + +set -e + +function test_report() { + local REPORT="$(mktemp)" + report_go_test -run $1 ./test > ${REPORT} || true + cat ${REPORT} + grep "$2" ${REPORT} > /dev/null + grep "Done parsing 1 tests" ${REPORT} > /dev/null +} + +# Cleanup bazel stuff to avoid confusing Prow +function cleanup_bazel() { + bazel clean +} + +trap cleanup_bazel EXIT + +echo "Testing report_go_test" + +echo "Test pass" +test_report TestSucceeds "^- TestSucceeds :PASS:" + +echo "Test fails with fatal" +test_report TestFailsWithFatal "^- TestFailsWithFatal :FAIL:" + +echo "Test fails with SIGQUIT" +test_report TestFailsWithSigQuit "^- TestFailsWithSigQuit :FAIL:" + +echo "All tests passed" diff --git a/vendor/github.com/knative/test-infra/test/unit/presubmit-full-custom-integration-tests.sh b/vendor/github.com/knative/test-infra/test/unit/presubmit-full-custom-integration-tests.sh new file mode 100755 index 00000000000..d22b66e32dc --- /dev/null +++ b/vendor/github.com/knative/test-infra/test/unit/presubmit-full-custom-integration-tests.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +source $(dirname $0)/presubmit-integration-tests-common.sh + +function check_results() { + (( PRE_INTEGRATION_TESTS )) || failed "Pre integration tests did not run" + (( CUSTOM_INTEGRATION_TESTS )) || failed "Custom integration tests did not run" + (( POST_INTEGRATION_TESTS )) || failed "Post integration tests did not run" + echo "Test passed" +} + +echo "Testing all custom test integration functions" + +main $@ diff --git a/vendor/github.com/knative/test-infra/test/unit/presubmit-integration-tests-common.sh b/vendor/github.com/knative/test-infra/test/unit/presubmit-integration-tests-common.sh new file mode 100755 index 00000000000..78c0f4d0646 --- /dev/null +++ b/vendor/github.com/knative/test-infra/test/unit/presubmit-integration-tests-common.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +source $(dirname $0)/../../scripts/presubmit-tests.sh + +function failed() { + echo $1 + exit 1 +} + +function pre_integration_tests() { + PRE_INTEGRATION_TESTS=1 +} + +function integration_tests() { + CUSTOM_INTEGRATION_TESTS=1 +} + +function post_integration_tests() { + POST_INTEGRATION_TESTS=1 +} + +function build_tests() { + return 0 +} + +function unit_tests() { + return 0 +} + +PRE_INTEGRATION_TESTS=0 +CUSTOM_INTEGRATION_TESTS=0 +POST_INTEGRATION_TESTS=0 + +trap check_results EXIT diff --git a/vendor/github.com/knative/test-infra/test/unit/presubmit-partial-custom-integration-tests.sh b/vendor/github.com/knative/test-infra/test/unit/presubmit-partial-custom-integration-tests.sh new file mode 100755 index 00000000000..e0fb4ef24fa --- /dev/null +++ b/vendor/github.com/knative/test-infra/test/unit/presubmit-partial-custom-integration-tests.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Test that pre/post integration tests don't run if unset. + +source $(dirname $0)/presubmit-integration-tests-common.sh + +function check_results() { + (( ! PRE_INTEGRATION_TESTS )) || failed "Pre integration tests did run" + (( CUSTOM_INTEGRATION_TESTS )) || failed "Custom integration tests did not run" + (( ! POST_INTEGRATION_TESTS )) || failed "Post integration tests did run" + echo "Test passed" +} + +echo "Testing custom test integration function" + +unset -f pre_integration_tests +unset -f post_integration_tests + +main $@ diff --git a/vendor/github.com/knative/test-infra/test/unit/release-tests.sh b/vendor/github.com/knative/test-infra/test/unit/release-tests.sh new file mode 100755 index 00000000000..6fcd5d35f94 --- /dev/null +++ b/vendor/github.com/knative/test-infra/test/unit/release-tests.sh @@ -0,0 +1,108 @@ +#!/bin/bash + +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +source $(dirname $0)/../../scripts/release.sh + +set -e + +# Call a function and verify its return value and output. +# Parameters: $1 - expected return code. +# $2 - expected output ("" if no output is expected) +# $3 ..$n - function to call and its parameters. +function test_function() { + local expected_retcode=$1 + local expected_string=$2 + local output="$(mktemp)" + local output_code="$(mktemp)" + shift 2 + echo -n "$(trap '{ echo $? > ${output_code}; }' EXIT ; "$@")" &> ${output} + local retcode=$(cat ${output_code}) + if [[ ${retcode} -ne ${expected_retcode} ]]; then + cat ${output} + echo "Return code ${retcode} doesn't match expected return code ${expected_retcode}" + return 1 + fi + if [[ -n "${expected_string}" ]]; then + local found=1 + grep "${expected_string}" ${output} > /dev/null || found=0 + if (( ! found )); then + cat ${output} + echo "String '${expected_string}' not found" + return 1 + fi + else + if [[ -s ${output} ]]; then + ls ${output} + cat ${output} + echo "Unexpected output" + return 1 + fi + fi + echo "'$@' returns code ${expected_retcode} and displays '${expected_string}'" +} + +function mock_branch_release() { + set -e + BRANCH_RELEASE=1 + TAG=sometag + function git() { + echo $@ + } + function hub() { + echo $@ + } + branch_release "$@" 2>&1 +} + +function call_function() { + set -e + local init=$1 + shift + eval ${init} + "$@" 2>&1 +} + +echo ">> Testing initialization" + +test_function 1 "error: missing version" initialize --version +test_function 1 "error: version format" initialize --version a +test_function 1 "error: version format" initialize --version 0.0 +test_function 0 "" initialize --version 1.0.0 + +test_function 1 "error: missing branch" initialize --branch +test_function 1 "error: branch name must be" initialize --branch a +test_function 1 "error: branch name must be" initialize --branch 0.0 +test_function 0 "" initialize --branch release-0.0 + +test_function 1 "error: missing release notes" initialize --release-notes +test_function 1 "error: file a doesn't" initialize --release-notes a +test_function 0 "" initialize --release-notes $(mktemp) + +echo ">> Testing release branching" + +test_function 0 "" branch_release +test_function 129 "usage: git tag" call_function BRANCH_RELEASE=1 branch_release +test_function 1 "No such file" call_function BRANCH_RELEASE=1 branch_release "K Foo" "a.yaml b.yaml" +test_function 0 "release create" mock_branch_release "K Foo" "$(mktemp) $(mktemp)" + +echo ">> Testing validation tests" + +test_function 0 "Running release validation" run_validation_tests true +test_function 0 "" call_function SKIP_TESTS=1 run_validation_tests true +test_function 0 "i_passed" run_validation_tests "echo i_passed" +test_function 1 "validation tests failed" run_validation_tests false + +echo ">> All tests passed" diff --git a/vendor/github.com/knative/test-infra/tools/README.md b/vendor/github.com/knative/test-infra/tools/README.md new file mode 100644 index 00000000000..d4cf2a272f2 --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/README.md @@ -0,0 +1,3 @@ +# Test Infrastructure tools + +This directory contains tools used by our Prow jobs. diff --git a/vendor/github.com/knative/test-infra/tools/apicoverage/README.md b/vendor/github.com/knative/test-infra/tools/apicoverage/README.md new file mode 100644 index 00000000000..01ddf855151 --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/apicoverage/README.md @@ -0,0 +1,14 @@ +# API Coverage Tool +This tool is designed to show the field level coverage exercised by the conformance tests. + +## Read from GCS +This tool reads the logs from the latest continous build of knative/serving. The logs have the information of which CRD objects are being created and which fields are being set for the testing. +It uses the service account passed in or by default will use the GOOGLE_APPLICATION_CREDENTIALS variable to get the logs. + +## Creating Output +This tool creates an output xml in the prow artifacts directory. The prow artifacts directory is passed in or by default will use `./artifacts` directory. + +This output xml will be read by testgrid and displayed on the [dashboard](https://testgrid.knative.dev/knative-serving#api-coverage). + +## Prow Job +There is a daily prow job that triggers this tool that is run at 01:05 AM PST. This tool will then generate the output xml which is then displayed in the testgrid dashboard. diff --git a/vendor/github.com/knative/test-infra/tools/apicoverage/apicoverage.go b/vendor/github.com/knative/test-infra/tools/apicoverage/apicoverage.go new file mode 100644 index 00000000000..6e007a7270b --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/apicoverage/apicoverage.go @@ -0,0 +1,241 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// apicoverage.go parses the log file and outputs the api coverage numbers in a +// testgrid expected output xml file + +package main + +import ( + "context" + "encoding/json" + "flag" + "fmt" + "log" + "os" + "reflect" + "strings" + + "github.com/knative/serving/pkg/apis/serving/v1alpha1" + "github.com/knative/test-infra/tools/gcs" + "github.com/knative/test-infra/tools/testgrid" +) + +const ( + logDir = "logs/ci-knative-serving-continuous/" + buildFile = "build-log.txt" + apiCoverage = "api_coverage" + overallRoute = "OverallRoute" + overallConfig = "OverallConfiguration" + overallService = "OverallService" +) + +// ResourceObjects defines the resource objects in knative-serving +type ResourceObjects struct { + Route *v1alpha1.Route + Configuration *v1alpha1.Configuration + Service *v1alpha1.Service +} + +// OverallAPICoverage defines the overall api coverage for knative serving +type OverallAPICoverage struct { + RouteAPICovered map[string]int + RouteAPINotCovered map[string]int + ConfigurationAPICovered map[string]int + ConfigurationAPINotCovered map[string]int + ServiceAPICovered map[string]int + ServiceAPINotCovered map[string]int +} + +type apiObjectName string + +const ( + apiObjectRoute apiObjectName = "route" + apiObjectConfiguration = "configuration" + apiObjectService = "service" +) + +// check if the object value is nil or empty. +// Uses https://golang.org/pkg/reflect/#Kind to get the variable type +func isNil(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + } + return false +} + +func isStruct(v reflect.Value) bool { + return v.Kind() == reflect.Struct +} + +// Parse the struct and returns a map of +func parseStruct(v reflect.Value) map[string]reflect.Value { + f := make(map[string]reflect.Value) + + for i := 0; i < v.NumField(); i++ { + // Include only public vars. https://golang.org/pkg/reflect/#StructField. + if len(v.Type().Field(i).PkgPath) == 0 { + f[v.Type().Field(i).Name] = v.Field(i) + } + } + + return f +} + +func incrementCoverageValues(name string, covered map[string]int) { + if i, ok := covered[name]; ok { + covered[name] = i + 1 + } else { + covered[name] = 1 + } +} + +func handleCovered(name string, coverage *OverallAPICoverage) { + if strings.HasPrefix(name, "route") { + incrementCoverageValues(name, coverage.RouteAPICovered) + } else if strings.HasPrefix(name, "configuration") { + incrementCoverageValues(name, coverage.ConfigurationAPICovered) + } else if strings.HasPrefix(name, "service") { + incrementCoverageValues(name, coverage.ServiceAPICovered) + } +} + +func handleNotCovered(name string, coverage *OverallAPICoverage) { + if strings.HasPrefix(name, "route") { + coverage.RouteAPINotCovered[name] = 0 + } else if strings.HasPrefix(name, "configuration") { + coverage.ConfigurationAPINotCovered[name] = 0 + } else if strings.HasPrefix(name, "service") { + coverage.ServiceAPINotCovered[name] = 0 + } +} + +func getCoverage(value reflect.Value, name string, coverage *OverallAPICoverage) { + // Parse all the fields in the struct + for key, v := range parseStruct(value) { + name := name + "." + key + if isStruct(v) { + getCoverage(v, name, coverage) + } else { + // check if it is empty/nil + if isNil(v) { + handleNotCovered(name, coverage) + } else { + handleCovered(name, coverage) + } + } + } +} + +func calculateCoverage(covLogs []string, coverage *OverallAPICoverage) { + if len(covLogs) == 0 { + return + } + + for _, f := range covLogs { + var obj ResourceObjects + if err := json.Unmarshal([]byte(f), &obj); err != nil { + log.Fatalf("Cannot read resource object: %v", err) + } else { + if obj.Route != nil { + getCoverage(reflect.ValueOf(obj.Route).Elem(), "route", coverage) + } else if obj.Configuration != nil { + getCoverage(reflect.ValueOf(obj.Configuration).Elem(), "configuration", coverage) + } else if obj.Service != nil { + getCoverage(reflect.ValueOf(obj.Service).Elem(), "service", coverage) + } + } + } +} + +func initCoverage() *OverallAPICoverage { + coverage := OverallAPICoverage{} + coverage.RouteAPICovered = make(map[string]int) + coverage.RouteAPINotCovered = make(map[string]int) + coverage.ConfigurationAPICovered = make(map[string]int) + coverage.ConfigurationAPINotCovered = make(map[string]int) + coverage.ServiceAPICovered = make(map[string]int) + coverage.ServiceAPINotCovered = make(map[string]int) + + return &coverage +} + +func getRelevantLogs(fields []string) *string { + // I0727 16:23:30.055] 2018-10-12T18:18:06.835-0700 info TestRouteCreation test/configuration.go:34 resource {: }"} + if len(fields) == 8 && fields[3] == "info" && fields[6] == "resource" { + s := strings.Join(fields[7:], " ") + return &s + } + return nil +} + +func createCases(tcName string, covered map[string]int, notCovered map[string]int) []testgrid.TestCase { + var tc []testgrid.TestCase + + var percentCovered = float32(100 * len(covered) / (len(covered) + len(notCovered))) + tp := []testgrid.TestProperty{testgrid.TestProperty{Name: apiCoverage, Value: percentCovered}} + tc = append(tc, testgrid.TestCase{Name: tcName, Properties: testgrid.TestProperties{Property: tp}, Fail: false}) + + for key, value := range covered { + tp := []testgrid.TestProperty{testgrid.TestProperty{Name: apiCoverage, Value: float32(value)}} + tc = append(tc, testgrid.TestCase{Name: tcName + "/" + key, Properties: testgrid.TestProperties{Property: tp}, Fail: false}) + } + + for key, value := range notCovered { + tp := []testgrid.TestProperty{testgrid.TestProperty{Name: apiCoverage, Value: float32(value)}} + tc = append(tc, testgrid.TestCase{Name: tcName + "/" + key, Properties: testgrid.TestProperties{Property: tp}, Fail: true}) + } + return tc +} + +func createTestgridXML(coverage *OverallAPICoverage, artifactsDir string) { + tc := createCases(overallRoute, coverage.RouteAPICovered, coverage.RouteAPINotCovered) + tc = append(tc, createCases(overallConfig, coverage.ConfigurationAPICovered, coverage.ConfigurationAPINotCovered)...) + tc = append(tc, createCases(overallService, coverage.ServiceAPICovered, coverage.ServiceAPINotCovered)...) + ts := testgrid.TestSuite{TestCases: tc} + + if err := testgrid.CreateXMLOutput(ts, artifactsDir); err != nil { + log.Fatalf("Cannot create the xml output file: %v", err) + } +} + +func main() { + + artifactsDir := flag.String("artifacts-dir", "./artifacts", "Directory to store the generated XML file") + serviceAccount := flag.String("service-account", os.Getenv("GOOGLE_APPLICATION_CREDENTIALS"), "JSON key file for service account to use") + flag.Parse() + + // Read the latest-build.txt file to get the latest build number + ctx := context.Background() + num, err := gcs.GetLatestBuildNumber(ctx, logDir, *serviceAccount) + if err != nil { + log.Fatalf("Cannot get latest build number: %v", err) + } + + // Calculate coverage + coverage := initCoverage() + calculateCoverage( + gcs.ParseLog(ctx, fmt.Sprintf("%s/%d/%s", logDir, num, buildFile), getRelevantLogs), + coverage) + + // Write the testgrid xml to artifacts + createTestgridXML(coverage, *artifactsDir) +} diff --git a/vendor/github.com/knative/test-infra/tools/dep-collector/README.md b/vendor/github.com/knative/test-infra/tools/dep-collector/README.md new file mode 100644 index 00000000000..9acf6cef809 --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/dep-collector/README.md @@ -0,0 +1,88 @@ +# dep-collector + +`dep-collector` is a tool for gathering up a collection of licenses for Go +dependencies that have been pulled into the idiomatic `vendor/` directory. +The resulting file from running `dep-collector` is intended for inclusion +in container images to respect the licenses of the included software. + +### Basic Usage + +You can run `dep-collector` on one or more Go import paths as entrypoints, +and it will: +1. Walk the transitive dependencies to identify vendored software packages, +1. Search for licenses for each vendored dependency, +1. Dump a file containing the licenses for each vendored import. + +For example (single import path): +```shell +$ dep-collector . +=========================================================== +Import: github.com/mattmoor/dep-collector/vendor/github.com/google/licenseclassifier + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ +... + +``` + +For example (multiple import paths): + +```shell +$ dep-collector ./cmd/controller ./cmd/sleeper + +=========================================================== +Import: github.com/mattmoor/warm-image/vendor/cloud.google.com/go + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ +``` + +### CSV Usage + +You can also run `dep-collector` in a mode that produces CSV output, +including basic classification of the license. + +> In order to run dep-collector in this mode, you must first run: +> go get github.com/google/licenseclassifier + +For example: + +```shell +$ dep-collector -csv . +github.com/google/licenseclassifier,Static,,https://github.com/mattmoor/dep-collector/blob/master/vendor/github.com/google/licenseclassifier/LICENSE,Apache-2.0 +github.com/google/licenseclassifier/stringclassifier,Static,,https://github.com/mattmoor/dep-collector/blob/master/vendor/github.com/google/licenseclassifier/stringclassifier/LICENSE,Apache-2.0 +github.com/sergi/go-diff,Static,,https://github.com/mattmoor/dep-collector/blob/master/vendor/github.com/sergi/go-diff/LICENSE,MIT + +``` + +The columns here are: +* Import Path, +* How the dependency is linked in (always reports "static"), +* A column for whether any modifications have been made (always empty), +* The URL by which to access the license file (assumes `master`), +* A classification of what license this is ([using this](https://github.com/google/licenseclassifier)). + + +### Check mode + +`dep-collector` also includes a mode that will check for "forbidden" licenses. + +> In order to run dep-collector in this mode, you must first run: +> go get github.com/google/licenseclassifier + +For example (failing): +```shell +$ dep-collector -check ./foo/bar/baz +2018/07/20 22:01:29 Error checking license collection: Errors validating licenses: +Found matching forbidden license in "foo.io/bar/vendor/github.com/BurntSushi/toml": WTFPL +``` + +For example (passing): + +```shell +$ dep-collector -check . +2018/07/20 22:29:09 No errors found. +``` diff --git a/vendor/github.com/knative/test-infra/tools/dep-collector/imports.go b/vendor/github.com/knative/test-infra/tools/dep-collector/imports.go new file mode 100644 index 00000000000..924ce410228 --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/dep-collector/imports.go @@ -0,0 +1,94 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "fmt" + gb "go/build" + "path/filepath" + "sort" + "strings" +) + +func CollectTransitiveImports(binaries []string) ([]string, error) { + // Perform a simple DFS to collect the binaries' transitive dependencies. + visited := make(map[string]struct{}) + for _, importpath := range binaries { + if gb.IsLocalImport(importpath) { + ip, err := qualifyLocalImport(importpath) + if err != nil { + return nil, err + } + importpath = ip + } + + pkg, err := gb.Import(importpath, WorkingDir, gb.ImportComment) + if err != nil { + return nil, err + } + if err := visit(pkg, visited); err != nil { + return nil, err + } + } + + // Sort the dependencies deterministically. + var list sort.StringSlice + for ip := range visited { + if !strings.Contains(ip, "/vendor/") { + // Skip files outside of vendor + continue + } + list = append(list, ip) + } + list.Sort() + + return list, nil +} + +func qualifyLocalImport(ip string) (string, error) { + gopathsrc := filepath.Join(gb.Default.GOPATH, "src") + if !strings.HasPrefix(WorkingDir, gopathsrc) { + return "", fmt.Errorf("working directory must be on ${GOPATH}/src = ", gopathsrc) + } + return filepath.Join(strings.TrimPrefix(WorkingDir, gopathsrc+string(filepath.Separator)), ip), nil +} + +func visit(pkg *gb.Package, visited map[string]struct{}) error { + if _, ok := visited[pkg.ImportPath]; ok { + return nil + } + visited[pkg.ImportPath] = struct{}{} + + for _, ip := range pkg.Imports { + if ip == "C" { + // skip cgo + continue + } + subpkg, err := gb.Import(ip, WorkingDir, gb.ImportComment) + if err != nil { + return fmt.Errorf("%v\n -> %v", pkg.ImportPath, err) + } + if !strings.HasPrefix(subpkg.Dir, WorkingDir) { + // Skip import paths outside of our workspace (std library) + continue + } + if err := visit(subpkg, visited); err != nil { + return fmt.Errorf("%v (%v)\n -> %v", pkg.ImportPath, pkg.Dir, err) + } + } + return nil +} diff --git a/vendor/github.com/knative/test-infra/tools/dep-collector/licenses.go b/vendor/github.com/knative/test-infra/tools/dep-collector/licenses.go new file mode 100644 index 00000000000..cb1df9ab748 --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/dep-collector/licenses.go @@ -0,0 +1,203 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "fmt" + gb "go/build" + "io/ioutil" + "os" + "path/filepath" + "sort" + "strings" + + "github.com/google/licenseclassifier" +) + +var LicenseNames = []string{ + "LICENCE", + "LICENSE", + "LICENSE.code", + "LICENSE.md", + "LICENSE.txt", + "COPYING", + "copyright", +} + +const MatchThreshold = 0.9 + +type LicenseFile struct { + EnclosingImportPath string + LicensePath string +} + +func (lf *LicenseFile) Body() (string, error) { + body, err := ioutil.ReadFile(lf.LicensePath) + if err != nil { + return "", err + } + return string(body), nil +} + +func (lt *LicenseFile) Classify(classifier *licenseclassifier.License) (string, error) { + body, err := lt.Body() + if err != nil { + return "", err + } + m := classifier.NearestMatch(body) + if m == nil { + return "", fmt.Errorf("unable to classify license: %v", lt.EnclosingImportPath) + } + return m.Name, nil +} + +func (lt *LicenseFile) Check(classifier *licenseclassifier.License) error { + body, err := lt.Body() + if err != nil { + return err + } + ms := classifier.MultipleMatch(body, false) + for _, m := range ms { + return fmt.Errorf("Found matching forbidden license in %q: %v", lt.EnclosingImportPath, m.Name) + } + return nil +} + +func (lt *LicenseFile) Entry() (string, error) { + body, err := lt.Body() + if err != nil { + return "", err + } + return fmt.Sprintf(` +=========================================================== +Import: %s + +%s +`, lt.EnclosingImportPath, body), nil +} + +func (lt *LicenseFile) CSVRow(classifier *licenseclassifier.License) (string, error) { + classification, err := lt.Classify(classifier) + if err != nil { + return "", err + } + parts := strings.Split(lt.EnclosingImportPath, "/vendor/") + if len(parts) != 2 { + return "", fmt.Errorf("wrong number of parts splitting import path on %q : %q", "/vendor/", lt.EnclosingImportPath) + } + return strings.Join([]string{ + parts[1], + "Static", + "", // TODO(mattmoor): Modifications? + "https://" + parts[0] + "/blob/master/vendor/" + parts[1] + "/" + filepath.Base(lt.LicensePath), + classification, + }, ","), nil +} + +func findLicense(ip string) (*LicenseFile, error) { + pkg, err := gb.Import(ip, WorkingDir, gb.ImportComment) + if err != nil { + return nil, err + } + dir := pkg.Dir + + for { + // When we reach the root of our workspace, stop searching. + if dir == WorkingDir { + return nil, fmt.Errorf("unable to find license for %q", pkg.ImportPath) + } + + for _, name := range LicenseNames { + p := filepath.Join(dir, name) + if _, err := os.Stat(p); err != nil { + continue + } + + return &LicenseFile{ + EnclosingImportPath: ip, + LicensePath: p, + }, nil + } + + // Walk to the parent directory / import path + dir = filepath.Dir(dir) + ip = filepath.Dir(ip) + } +} + +type LicenseCollection []*LicenseFile + +func (lc LicenseCollection) Entries() (string, error) { + sections := make([]string, 0, len(lc)) + for _, key := range lc { + entry, err := key.Entry() + if err != nil { + return "", err + } + sections = append(sections, entry) + } + return strings.Join(sections, "\n"), nil +} + +func (lc LicenseCollection) CSV(classifier *licenseclassifier.License) (string, error) { + sections := make([]string, 0, len(lc)) + for _, entry := range lc { + row, err := entry.CSVRow(classifier) + if err != nil { + return "", err + } + sections = append(sections, row) + } + return strings.Join(sections, "\n"), nil +} + +func (lc LicenseCollection) Check(classifier *licenseclassifier.License) error { + errors := []string{} + for _, entry := range lc { + if err := entry.Check(classifier); err != nil { + errors = append(errors, err.Error()) + } + } + if len(errors) == 0 { + return nil + } + return fmt.Errorf("Errors validating licenses:\n%v", strings.Join(errors, "\n")) +} + +func CollectLicenses(imports []string) (LicenseCollection, error) { + // for each of the import paths, search for a license file. + licenseFiles := make(map[string]*LicenseFile) + for _, ip := range imports { + lf, err := findLicense(ip) + if err != nil { + return nil, err + } + licenseFiles[lf.EnclosingImportPath] = lf + } + + order := sort.StringSlice{} + for key := range licenseFiles { + order = append(order, key) + } + order.Sort() + + licenseTypes := LicenseCollection{} + for _, key := range order { + licenseTypes = append(licenseTypes, licenseFiles[key]) + } + return licenseTypes, nil +} diff --git a/vendor/github.com/knative/test-infra/tools/dep-collector/main.go b/vendor/github.com/knative/test-infra/tools/dep-collector/main.go new file mode 100644 index 00000000000..4532942751d --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/dep-collector/main.go @@ -0,0 +1,81 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "flag" + "log" + "os" + + "github.com/google/licenseclassifier" +) + +var WorkingDir, _ = os.Getwd() + +var ( + csv = flag.Bool("csv", false, "Whether to print in CSV format (with slow classification).") + check = flag.Bool("check", false, "Whether to just check license files for forbidden licenses.") +) + +func main() { + flag.Parse() + if flag.NArg() == 0 { + log.Fatalf("Expected a list of import paths, got: %v", flag.Args()) + } + + // Perform a simple DFS to collect the binaries' transitive dependencies. + transitiveImports, err := CollectTransitiveImports(flag.Args()) + if err != nil { + log.Fatalf("Error collecting transitive dependencies: %v", err) + } + + // Gather all of the license data from the imports. + collection, err := CollectLicenses(transitiveImports) + if err != nil { + log.Fatalf("Error identifying licenses for transitive dependencies: %v", err) + } + + if *check { + classifier, err := licenseclassifier.NewWithForbiddenLicenses(MatchThreshold) + if err != nil { + log.Fatalf("Error creating license classifier: %v", err) + } + if err := collection.Check(classifier); err != nil { + log.Fatalf("Error checking license collection: %v", err) + } + log.Printf("No errors found.") + return + } + + if *csv { + classifier, err := licenseclassifier.New(MatchThreshold) + if err != nil { + log.Fatalf("Error creating license classifier: %v", err) + } + output, err := collection.CSV(classifier) + if err != nil { + log.Fatalf("Error generating CSV: %v", err) + } + os.Stdout.Write([]byte(output)) + } else { + entries, err := collection.Entries() + if err != nil { + log.Fatalf("Error generating entries: %v", err) + } + os.Stdout.Write([]byte(entries)) + } +} diff --git a/vendor/github.com/knative/test-infra/tools/gcs/gcs.go b/vendor/github.com/knative/test-infra/tools/gcs/gcs.go new file mode 100644 index 00000000000..a41fbbb21a0 --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/gcs/gcs.go @@ -0,0 +1,112 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// gcs.go defines functions to use GCS + +package gcs + +import ( + "bufio" + "context" + "fmt" + "io/ioutil" + "log" + "strconv" + "strings" + + "cloud.google.com/go/storage" + "google.golang.org/api/option" +) + +const ( + bucketName = "knative-prow" + latest = "latest-build.txt" +) + +var client *storage.Client + +func createStorageClient(ctx context.Context, sa string) error { + var err error + client, err = storage.NewClient(ctx, option.WithCredentialsFile(sa)) + return err +} + +func createStorageObject(filename string) *storage.ObjectHandle { + return client.Bucket(bucketName).Object(filename) +} + +// GetLatestBuildNumber gets the latest build number for the specified log directory +func GetLatestBuildNumber(ctx context.Context, logDir string, sa string) (int, error) { + contents, err := ReadGcsFile(ctx, logDir+latest, sa) + if err != nil { + return 0, err + } + latestBuild, err := strconv.Atoi(string(contents)) + if err != nil { + return 0, err + } + + return latestBuild, nil +} + +//ReadGcsFile reads the specified file using the provided service account +func ReadGcsFile(ctx context.Context, filename string, sa string) ([]byte, error) { + // Create a new GCS client + if err := createStorageClient(ctx, sa); err != nil { + log.Fatalf("Failed to create GCS client: %v", err) + } + o := createStorageObject(filename) + if _, err := o.Attrs(ctx); err != nil { + return []byte(fmt.Sprintf("Cannot get attributes of '%s'", filename)), err + } + f, err := o.NewReader(ctx) + if err != nil { + return []byte(fmt.Sprintf("Cannot open '%s'", filename)), err + } + defer f.Close() + contents, err := ioutil.ReadAll(f) + if err != nil { + return []byte(fmt.Sprintf("Cannot read '%s'", filename)), err + } + return contents, nil +} + +// ParseLog parses the log and returns the lines where the checkLog func does not return an empty slice. +// checkLog function should take in the log statement and return a part from that statement that should be in the log output. +func ParseLog(ctx context.Context, filename string, checkLog func(s []string) *string) []string { + var logs []string + + log.Printf("Parsing '%s'", filename) + o := createStorageObject(filename) + if _, err := o.Attrs(ctx); err != nil { + log.Printf("Cannot get attributes of '%s', assuming not ready yet: %v", filename, err) + return nil + } + f, err := o.NewReader(ctx) + if err != nil { + log.Fatalf("Error opening '%s': %v", filename, err) + } + defer f.Close() + + scanner := bufio.NewScanner(f) + + for scanner.Scan() { + if s := checkLog(strings.Fields(scanner.Text())); s != nil { + logs = append(logs, *s) + } + } + return logs +} diff --git a/vendor/github.com/knative/test-infra/tools/githubhelper/Makefile b/vendor/github.com/knative/test-infra/tools/githubhelper/Makefile new file mode 100644 index 00000000000..c8fef33a770 --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/githubhelper/Makefile @@ -0,0 +1,17 @@ +# Copyright 2018 The Knative Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +all: + go get -u github.com/google/go-github/github + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build . diff --git a/vendor/github.com/knative/test-infra/tools/githubhelper/README.md b/vendor/github.com/knative/test-infra/tools/githubhelper/README.md new file mode 100644 index 00000000000..5975a23521b --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/githubhelper/README.md @@ -0,0 +1,10 @@ +# GitHub Helper Tool + +This tool is designed to interact with GitHub, providing useful data for a Prow job. Actions performed and the output are governed by the flags used. + +Currently the tool makes unauthenticated requests to GitHub API. + +## Flags + +* `-list-changed-files` will list the files that are touched by the current PR in a Prow job. +* `-verbose` will dump extra info on output when executing the comments; it is intended for debugging. diff --git a/vendor/github.com/knative/test-infra/tools/githubhelper/githubhelper.go b/vendor/github.com/knative/test-infra/tools/githubhelper/githubhelper.go new file mode 100644 index 00000000000..d45fad475cc --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/githubhelper/githubhelper.go @@ -0,0 +1,85 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// githubhelper.go interacts with GitHub, providing useful data for a Prow job. + +package main + +import ( + "context" + "flag" + "fmt" + "log" + "os" + "strconv" + + "github.com/google/go-github/github" +) + +var ( + // Info about the current PR + repoOwner = os.Getenv("REPO_OWNER") + repoName = os.Getenv("REPO_NAME") + pullNumber = atoi(os.Getenv("PULL_NUMBER"), "pull number") + + // Shared useful variables + ctx = context.Background() + onePageList = &github.ListOptions{Page: 1} + verbose = false + anonymousGitHubClient *github.Client +) + +// atoi is a convenience function to convert a string to integer, failing in case of error. +func atoi(str, valueName string) int { + value, err := strconv.Atoi(str) + if err != nil { + log.Fatalf("Unexpected non number '%s' for %s: %v", str, valueName, err) + } + return value +} + +// infof if a convenience wrapper around log.Infof, and does nothing unless --verbose is passed. +func infof(template string, args ...interface{}) { + if verbose { + log.Printf(template, args...) + } +} + +// listChangedFiles simply lists the files changed by the current PR. +func listChangedFiles() { + infof("Listing changed files for PR %d in repository %s/%s", pullNumber, repoOwner, repoName) + files, _, err := anonymousGitHubClient.PullRequests.ListFiles(ctx, repoOwner, repoName, pullNumber, onePageList) + if err != nil { + log.Fatalf("Error listing files: %v", err) + } + for _, file := range files { + fmt.Println(*file.Filename) + } +} + +func main() { + listChangedFilesFlag := flag.Bool("list-changed-files", false, "List the files changed by the current pull request") + verboseFlag := flag.Bool("verbose", false, "Whether to dump extra info on output or not; intended for debugging") + flag.Parse() + + verbose = *verboseFlag + anonymousGitHubClient = github.NewClient(nil) + + if *listChangedFilesFlag { + listChangedFiles() + } +} + diff --git a/vendor/github.com/knative/test-infra/tools/testgrid/testgrid.go b/vendor/github.com/knative/test-infra/tools/testgrid/testgrid.go new file mode 100644 index 00000000000..30d7ff2c13c --- /dev/null +++ b/vendor/github.com/knative/test-infra/tools/testgrid/testgrid.go @@ -0,0 +1,69 @@ +/* +Copyright 2018 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// testgrid.go provides methods to perform action on testgrid. + +package testgrid + +import ( + "encoding/xml" + "os" +) + +// TestProperty defines a property of the test +type TestProperty struct { + Name string `xml:"name,attr"` + Value float32 `xml:"value,attr"` +} + +// TestProperties is an array of test properties +type TestProperties struct { + Property []TestProperty `xml:"property"` +} + +// TestCase defines a test case that was executed +type TestCase struct { + ClassName string `xml:"class_name,attr"` + Name string `xml:"name,attr"` + Time int `xml:"time,attr"` + Properties TestProperties `xml:"properties"` + Fail bool `xml:"failure,omitempty"` +} + +// TestSuite defines the set of relevant test cases +type TestSuite struct { + XMLName xml.Name `xml:"testsuite"` + TestCases []TestCase `xml:"testcase"` +} + +// CreateXMLOutput creates the junit xml file in the provided artifacts directory +func CreateXMLOutput(ts TestSuite, artifactsDir string) error { + op, err := xml.MarshalIndent(ts, "", " ") + if err != nil { + return err + } + + outputFile := artifactsDir + "/junit_bazel.xml" + f, err := os.Create(outputFile) + if err != nil { + return err + } + defer f.Close() + if _, err := f.WriteString(string(op) + "\n"); err != nil { + return err + } + return nil +}