Skip to content

Commit

Permalink
Update to latest test-infra (knative#2932)
Browse files Browse the repository at this point in the history
* Update to latest test-infra

* Remove unnecessary files

* Add release.sh file

* Add release.sh file

* Move release.sh to hack/
  • Loading branch information
srinivashegde86 authored and knative-prow-robot committed Jan 19, 2019
1 parent 047af7e commit f345429
Show file tree
Hide file tree
Showing 11 changed files with 527 additions and 330 deletions.
4 changes: 2 additions & 2 deletions Gopkg.lock

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

64 changes: 17 additions & 47 deletions hack/release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

# Copyright 2018 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -13,50 +13,20 @@
# 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)/../vendor/github.com/knative/test-infra/scripts/release.sh

# Script entry point

initialize $@

set -o errexit
set -o pipefail

run_validation_tests ./test/presubmit-tests.sh

# Build the release

banner "Building the release"

# Build should not try to deploy anything, use a bogus value for cluster.
export K8S_CLUSTER_OVERRIDE=CLUSTER_NOT_SET
export K8S_USER_OVERRIDE=USER_NOT_SET
export DOCKER_REPO_OVERRIDE=DOCKER_NOT_SET

# Run `generate-yamls.sh`, which should be versioned with the
# branch since the detail of building may change over time.
readonly YAML_LIST="$(mktemp)"
$(dirname $0)/generate-yamls.sh "${REPO_ROOT_DIR}" "${YAML_LIST}"
readonly YAMLS_TO_PUBLISH=$(cat "${YAML_LIST}" | tr '\n' ' ')
readonly RELEASE_YAML="$(head -n1 ${YAML_LIST})"

tag_images_in_yaml "${RELEASE_YAML}"

echo "New release built successfully"

if (( ! PUBLISH_RELEASE )); then
# Copy the generated YAML files to the repo root dir.
cp ${YAMLS_TO_PUBLISH} ${REPO_ROOT_DIR}
exit 0
fi

# Publish the release
# We publish our own istio.yaml, so users don't need to use helm
for yaml in ${YAMLS_TO_PUBLISH}; do
publish_yaml "${yaml}"
done

branch_release "Knative Serving" "${YAMLS_TO_PUBLISH}"

echo "New release published successfully"

function build_release() {
# Run `generate-yamls.sh`, which should be versioned with the
# branch since the detail of building may change over time.
local YAML_LIST="$(mktemp)"
# We publish our own istio.yaml, so users don't need to use helm
$(dirname $0)/generate-yamls.sh "${REPO_ROOT_DIR}" "${YAML_LIST}"
YAMLS_TO_PUBLISH=$(cat "${YAML_LIST}" | tr '\n' ' ')
if (( ! PUBLISH_RELEASE )); then
# Copy the generated YAML files to the repo root dir if not publishing.
cp ${YAMLS_TO_PUBLISH} ${REPO_ROOT_DIR}
fi
}

main $@
17 changes: 0 additions & 17 deletions test/performance-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ function teardown() {
uninstall_knative_serving
}

# On a Prow job, save some metadata about the test for Testgrid.
function save_metadata() {
(( ! IS_PROW )) && return
cat << EOF > ${ARTIFACTS}/metadata.json
{
"Region": "${E2E_CLUSTER_REGION}",
"Zone": "${E2E_CLUSTER_ZONE}",
"Machine": "${E2E_CLUSTER_MACHINE}",
"MinNodes": "${E2E_MIN_CLUSTER_NODES}",
"MaxNodes": "${E2E_MAX_CLUSTER_NODES}"
}
EOF
}

initialize $@

header "Setting up environment"
Expand All @@ -57,7 +43,4 @@ publish_test_images || fail_test "one or more test images weren't published"
# the test summary, thus overwriting our generated performance summary
go test -v -count=1 -tags=performance -timeout=5m ./test/performance || fail_test

# Save some metadata about the test cluster
save_metadata

success
23 changes: 1 addition & 22 deletions test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,6 @@

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

function build_tests() {
header "Running build tests"
local result=0
go build -v ./cmd/... ./pkg/... || result=1
# "go build" on //test will fail with "no non-test Go files in ..."
# See https://github.com/golang/go/issues/8279 for details
# Workaround is to use "go test -run" with a non matching pattern
go test -run=^$ -tags="e2e performance" ./test/... || result=1
subheader "Checking autogenerated code is up-to-date"
./hack/verify-codegen.sh || result=1
# Check that we don't have any forbidden licenses in our images.
subheader "Checking for forbidden licenses"
check_licenses ./cmd/* || result=1
return ${result}
}

function unit_tests() {
header "Running unit tests"
report_go_test ./...
}

# We use the default integration test runner.
# We use the default build, unit and integration test runners.

main $@
Loading

0 comments on commit f345429

Please sign in to comment.