Skip to content

Commit

Permalink
Fix spelling and boilerplate errors
Browse files Browse the repository at this point in the history
Some spelling and boilerplate errors are fixed which caused the failing
of these tests.
  • Loading branch information
sachinkumarsingh092 committed Jan 12, 2021
1 parent 71690af commit 48186eb
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 13 deletions.
16 changes: 16 additions & 0 deletions .prow.sh
@@ -1,7 +1,23 @@
#! /bin/bash -e

# Copyright 2021 The Kubernetes 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 is for testing csi-release-tools itself in Prow. All other
# repos use prow.sh for that, but as csi-release-tools isn't a normal
# repo with some Go code in it, it has a custom Prow test script.

./verify-shellcheck.sh "$(pwd)"
./verify-spelling.sh "$(pwd)"
./verify-boilerplate.sh "$(pwd)"
2 changes: 1 addition & 1 deletion SIDECAR_RELEASE_PROCESS.md
Expand Up @@ -11,7 +11,7 @@ The release manager must:
kubernetes/org to request membership
* Be a top level approver for the repository. To become a top level approver,
the candidate must demonstrate ownership and deep knowledge of the repository
through active maintainence, responding to and fixing issues, reviewing PRs,
through active maintenance, responding to and fixing issues, reviewing PRs,
test triage.
* Be part of the maintainers or admin group for the repository. admin is a
superset of maintainers, only maintainers level is required for cutting a
Expand Down
14 changes: 14 additions & 0 deletions cloudbuild.sh
@@ -1,5 +1,19 @@
#! /bin/bash

# Copyright 2021 The Kubernetes 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.

# shellcheck disable=SC1091
. release-tools/prow.sh

Expand Down
8 changes: 4 additions & 4 deletions prow.sh
@@ -1,5 +1,5 @@
#! /bin/bash
#

# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -73,7 +73,7 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64; windows amd64 .exe; linux ppc64
# which is disabled with GOFLAGS=-mod=vendor).
configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory"

# Go versions can be specified seperately for different tasks
# Go versions can be specified separately for different tasks
# If the pre-installed Go is missing or a different
# version, the required version here will get installed
# from https://golang.org/dl/.
Expand Down Expand Up @@ -293,7 +293,7 @@ configvar CSI_PROW_E2E_FOCUS_LATEST '\[Feature:VolumeSnapshotDataSource\]' "non-
configvar CSI_PROW_E2E_FOCUS "$(get_versioned_variable CSI_PROW_E2E_FOCUS "${csi_prow_kubernetes_version_suffix}")" "non-alpha, feature-tagged tests"

# Serial vs. parallel is always determined by these regular expressions.
# Individual regular expressions are seperated by spaces for readability
# Individual regular expressions are separated by spaces for readability
# and expected to not contain spaces. Use dots instead. The complete
# regex for Ginkgo will be created by joining the individual terms.
configvar CSI_PROW_E2E_SERIAL '\[Serial\] \[Disruptive\]' "tags for serial E2E tests"
Expand Down Expand Up @@ -998,7 +998,7 @@ make_test_to_junit () {
echo "$line" # pass through
if echo "$line" | grep -q "^### [^ ]*:$"; then
if [ "$testname" ]; then
# previous test succesful
# previous test successful
echo " </system-out>" >>"$out"
echo " </testcase>" >>"$out"
fi
Expand Down
10 changes: 7 additions & 3 deletions verify-boilerplate.sh
Expand Up @@ -25,12 +25,16 @@ if [[ -z "$(command -v python)" ]]; then
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
fi

REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")
# The csi-release-tools directory.
TOOLS="$(dirname "${BASH_SOURCE[0]}")"

boilerDir="${REPO_ROOT}/boilerplate"
# Directory to check. Default is the parent of the tools themselves.
ROOT="${1:-${TOOLS}/..}"

boilerDir="${ROOT}/boilerplate"
boiler="${boilerDir}/boilerplate.py"

files_need_boilerplate=("$("${boiler}" --rootdir="${REPO_ROOT}" --verbose)")
mapfile -t files_need_boilerplate < <("${boiler}" --rootdir="${ROOT}" --verbose)

# Run boilerplate.py unit tests
unitTestOut="$(mktemp)"
Expand Down
10 changes: 6 additions & 4 deletions verify-spelling.sh
Expand Up @@ -20,9 +20,11 @@ set -o pipefail

TOOL_VERSION="v0.3.4"

# cd to the root path
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
cd "${ROOT}"
# The csi-release-tools directory.
TOOLS="$(dirname "${BASH_SOURCE[0]}")"

# Directory to check. Default is the parent of the tools themselves.
ROOT="${1:-${TOOLS}/..}"

# create a temporary directory
TMP_DIR=$(mktemp -d)
Expand All @@ -42,12 +44,12 @@ if [[ -z "$(command -v misspell)" ]]; then
GO111MODULE=on GOBIN="${TMP_DIR}" go get "github.com/client9/misspell/cmd/misspell@${TOOL_VERSION}"
export PATH="${TMP_DIR}:${PATH}"
fi
cd "${ROOT}"

# check spelling
RES=0
echo "Checking spelling..."
ERROR_LOG="${TMP_DIR}/errors.log"
cd "${ROOT}"
git ls-files | grep -v vendor | xargs misspell > "${ERROR_LOG}"
if [[ -s "${ERROR_LOG}" ]]; then
sed 's/^/error: /' "${ERROR_LOG}" # add 'error' to each line to highlight in e2e status
Expand Down
2 changes: 1 addition & 1 deletion verify-subtree.sh
@@ -1,5 +1,5 @@
#! /bin/sh -e
#

# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down

0 comments on commit 48186eb

Please sign in to comment.