Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ required = [
"k8s.io/code-generator/cmd/client-gen",
"k8s.io/code-generator/cmd/lister-gen",
"k8s.io/code-generator/cmd/informer-gen",
"github.com/knative/test-infra",
]

[prune]
Expand All @@ -20,6 +21,11 @@ required = [
unused-packages = false
non-go = false

[[prune.project]]
name = "github.com/knative/test-infra"
unused-packages = false
non-go = false

# Use HEAD (2018-04-21) to pick up:
# https://github.com/spf13/cobra/pull/662
[[override]]
Expand Down
6 changes: 1 addition & 5 deletions hack/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Load github.com/knative/test-infra/images/prow-tests/scripts/release.sh
[ -f /workspace/release.sh ] \
&& source /workspace/release.sh \
|| eval "$(docker run --entrypoint sh gcr.io/knative-tests/test-infra/prow-tests -c 'cat release.sh')"
[ -v KNATIVE_TEST_INFRA ] || exit 1
source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/release.sh

# Set default GCS/GCR
: ${EVENTING_RELEASE_GCS:="knative-releases/eventing"}
Expand Down
9 changes: 5 additions & 4 deletions hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ set -o errexit
set -o nounset
set -o pipefail

SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../../../k8s.io/code-generator)}
source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/library.sh

CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../../../k8s.io/code-generator)}

# generate the code with:
# --output-base because this script should also be able to run inside the vendor dir of
Expand All @@ -28,7 +29,7 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${SCRIPT_ROOT}; ls -d -1 ./vendor/k8s.io/code-ge
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
github.com/knative/eventing/pkg/client github.com/knative/eventing/pkg/apis \
"channels:v1alpha1 feeds:v1alpha1 flows:v1alpha1" \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate/boilerplate.go.txt
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt

# Make sure our dependencies are up-to-date
${SCRIPT_ROOT}/hack/update-deps.sh
${REPO_ROOT_DIR}/hack/update-deps.sh
11 changes: 5 additions & 6 deletions hack/update-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Load github.com/knative/test-infra/images/prow-tests/scripts/library.sh
[ -f /workspace/library.sh ] \
&& source /workspace/library.sh \
|| eval "$(docker run --entrypoint sh gcr.io/knative-tests/test-infra/prow-tests -c 'cat library.sh')"
[ -v KNATIVE_TEST_INFRA ] || exit 1

set -o errexit
set -o nounset
set -o pipefail

source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/library.sh

cd ${REPO_ROOT_DIR}

# Ensure we have everything we need under vendor/
Expand All @@ -32,4 +28,7 @@ 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 "./cmd/*"
21 changes: 11 additions & 10 deletions hack/verify-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ set -o errexit
set -o nounset
set -o pipefail

readonly EVENTING_ROOT_DIR="$(git rev-parse --show-toplevel)"
readonly TMP_DIFFROOT="$(mktemp -d -p ${EVENTING_ROOT_DIR})"
source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/library.sh

readonly TMP_DIFFROOT="$(mktemp -d ${REPO_ROOT_DIR}/tmpdiffroot.XXXXXX)"

cleanup() {
rm -rf "${TMP_DIFFROOT}"
Expand All @@ -31,21 +32,21 @@ cleanup

# Save working tree state
mkdir -p "${TMP_DIFFROOT}"
cp -aR "${EVENTING_ROOT_DIR}/Gopkg.lock" "${EVENTING_ROOT_DIR}/pkg" "${EVENTING_ROOT_DIR}/vendor" "${TMP_DIFFROOT}"
cp -aR "${REPO_ROOT_DIR}/Gopkg.lock" "${REPO_ROOT_DIR}/pkg" "${REPO_ROOT_DIR}/vendor" "${TMP_DIFFROOT}"

"${EVENTING_ROOT_DIR}/hack/update-codegen.sh"
echo "Diffing ${EVENTING_ROOT_DIR} against freshly generated codegen"
"${REPO_ROOT_DIR}/hack/update-codegen.sh"
echo "Diffing ${REPO_ROOT_DIR} against freshly generated codegen"
ret=0
diff -Naupr "${EVENTING_ROOT_DIR}/pkg" "${TMP_DIFFROOT}/pkg" || ret=1
diff -Naupr "${REPO_ROOT_DIR}/pkg" "${TMP_DIFFROOT}/pkg" || ret=1

# Restore working tree state
rm -fr "${EVENTING_ROOT_DIR}/Gopkg.lock" "${EVENTING_ROOT_DIR}/pkg" "${EVENTING_ROOT_DIR}/vendor"
cp -aR "${TMP_DIFFROOT}"/* "${EVENTING_ROOT_DIR}"
rm -fr "${REPO_ROOT_DIR}/Gopkg.lock" "${REPO_ROOT_DIR}/pkg" "${REPO_ROOT_DIR}/vendor"
cp -aR "${TMP_DIFFROOT}"/* "${REPO_ROOT_DIR}"

if [[ $ret -eq 0 ]]
then
echo "${EVENTING_ROOT_DIR} up to date."
echo "${REPO_ROOT_DIR} up to date."
else
echo "${EVENTING_ROOT_DIR} is out of date. Please run hack/update-codegen.sh"
echo "${REPO_ROOT_DIR} is out of date. Please run hack/update-codegen.sh"
exit 1
fi
9 changes: 1 addition & 8 deletions test/e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,7 @@
# project $PROJECT_ID, start Knative serving and the eventing system, run
# the tests and delete the cluster.

# Load github.com/knative/test-infra/images/prow-tests/scripts/e2e-tests.sh
[ -f /workspace/e2e-tests.sh ] \
&& source /workspace/e2e-tests.sh \
|| eval "$(docker run --entrypoint sh gcr.io/knative-tests/test-infra/prow-tests -c 'cat e2e-tests.sh')"

if [ -z "${KNATIVE_TEST_INFRA}" ]; then
exit 1
fi
source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/e2e-tests.sh

# Names of the Resources used in the tests.
readonly E2E_TEST_NAMESPACE=e2etest
Expand Down
11 changes: 3 additions & 8 deletions test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
# Use the flags --build-tests, --unit-tests and --integration-tests
# to run a specific set of tests.

# Load github.com/knative/test-infra/images/prow-tests/scripts/presubmit-tests.sh
[ -f /workspace/presubmit-tests.sh ] \
&& source /workspace/presubmit-tests.sh \
|| eval "$(docker run --entrypoint sh gcr.io/knative-tests/test-infra/prow-tests -c 'cat presubmit-tests.sh')"
[ -v KNATIVE_TEST_INFRA ] || exit 1
source $(dirname $0)/../vendor/github.com/knative/test-infra/scripts/presubmit-tests.sh

# Directories with code to build/test
readonly CODE_PACKAGES=(cmd pkg sample)
Expand All @@ -41,10 +37,9 @@ function build_tests() {
go build -v ${CODE_PACKAGES_STR} || result=1
subheader "Checking autogenerated code is up-to-date"
./hack/verify-codegen.sh || result=1
# Fetch the google/licenseclassifier for its license db
go get github.com/google/licenseclassifier || return 1
# Check that we don't have any forbidden licenses in our images.
dep-collector -check ./cmd/* || result=1
subheader "Checking for forbidden licenses"
check_licenses ./cmd/* || result=1
return ${result}
}

Expand Down
3 changes: 3 additions & 0 deletions vendor/github.com/knative/test-infra/scripts/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading