-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Tests must fail the build - fix a false-positive condition * Add tests to compilers image * Add script to update all Go toolchain images and run it * Add helper script to update tester image * Add optional `-C` flag to chdir - this will enable including tests inside the image, so that any downstream images can actually re-run the test. * Relax Go runtime version check Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
- Loading branch information
1 parent
fe87c5f
commit d47f6ac
Showing
10 changed files
with
191 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
schemaVersion: "2.0.0" | ||
|
||
commandTests: | ||
- name: "gcc command is in path" | ||
command: "which" | ||
args: ["gcc"] | ||
expectedOutput: ["/usr/bin/gcc"] | ||
- name: "gcc version" | ||
command: "gcc" | ||
args: ["-v"] | ||
expectedError: | ||
- 'Target:\ x86_64-linux-gnu' | ||
- 'gcc\ version\ 9\.3\.0' | ||
- name: "aarch64-linux-gnu-gcc command is in path" | ||
command: "which" | ||
args: ["aarch64-linux-gnu-gcc"] | ||
expectedOutput: ["/usr/bin/aarch64-linux-gnu-gcc"] | ||
- name: "aarch64-linux-gnu-gcc version" | ||
command: "aarch64-linux-gnu-gcc" | ||
args: ["-v"] | ||
expectedError: | ||
- 'Target:\ aarch64-linux-gnu' | ||
- 'gcc\ version\ 9\.3\.0' | ||
|
||
- name: "which bazel-2.0.0-linux-x86_64" | ||
command: "which" | ||
args: ["bazel-2.0.0-linux-x86_64"] | ||
expectedOutput: ["/usr/local/bin/bazel-2.0.0-linux-x86_64"] | ||
- name: "which bazel-2.0.0-linux-x86_64 version" | ||
command: "bazel-2.0.0-linux-x86_64" | ||
args: ["version"] | ||
expectedOutput: ['Build\ label:\ 2\.0\.0'] | ||
- name: "bazel 2.0.0 version" | ||
command: "bazel" | ||
envVars: [{ key: "USE_BAZEL_VERSION", value: "2.0.0" }] | ||
args: ["version"] | ||
expectedOutput: ['Build\ label:\ 2\.0\.0'] | ||
|
||
- name: "which bazel-2.2.0-linux-x86_64" | ||
command: "which" | ||
args: ["bazel-2.2.0-linux-x86_64"] | ||
expectedOutput: ["/usr/local/bin/bazel-2.2.0-linux-x86_64"] | ||
- name: "bazel-2.2.0-linux-x86_64 version" | ||
command: "bazel-2.2.0-linux-x86_64" | ||
args: ["version"] | ||
expectedOutput: ['Build\ label:\ 2\.2\.0'] | ||
- name: "bazel 2.2.0 version" | ||
command: "bazel" | ||
envVars: [{ key: "USE_BAZEL_VERSION", value: "2.2.0" }] | ||
args: ["version"] | ||
expectedOutput: ['Build\ label:\ 2\.2\.0'] | ||
|
||
- name: "which bazel-3.1.0-linux-x86_64" | ||
command: "which" | ||
args: ["bazel-3.1.0-linux-x86_64"] | ||
expectedOutput: ["/usr/local/bin/bazel-3.1.0-linux-x86_64"] | ||
- name: "bazel-3.1.0-linux-x86_64 version" | ||
command: "bazel-3.1.0-linux-x86_64" | ||
args: ["version"] | ||
expectedOutput: ['Build\ label:\ 3\.1\.0'] | ||
- name: "bazel 3.1.0 version" | ||
command: "bazel" | ||
envVars: [{ key: "USE_BAZEL_VERSION", value: "3.1.0" }] | ||
args: ["version"] | ||
expectedOutput: ['Build\ label:\ 3\.1\.0'] | ||
|
||
- name: "which bazel-3.2.0-linux-x86_64" | ||
command: "which" | ||
args: ["bazel-3.2.0-linux-x86_64"] | ||
expectedOutput: ["/usr/local/bin/bazel-3.2.0-linux-x86_64"] | ||
- name: "bazel-3.2.0-linux-x86_64 version" | ||
command: "bazel-3.2.0-linux-x86_64" | ||
args: ["version"] | ||
expectedOutput: ['Build\ label:\ 3\.2\.0'] | ||
- name: "bazel 3.2.0 version" | ||
command: "bazel" | ||
envVars: [{ key: "USE_BAZEL_VERSION", value: "3.2.0" }] | ||
args: ["version"] | ||
expectedOutput: ['Build\ label:\ 3\.2\.0'] | ||
|
||
- name: "bazel version" | ||
command: "bazel" | ||
args: ["version"] | ||
expectedOutput: ['Build\ label:\ 3\.2\.0'] | ||
|
||
fileExistenceTests: | ||
- name: '/usr/local/bin/bazel' | ||
path: '/usr/local/bin/bazel' | ||
shouldExist: true | ||
permissions: '-rwxr-xr-x' | ||
|
||
fileContentTests: | ||
- name: '/usr/local/bin/bazel' | ||
path: '/usr/local/bin/bazel' | ||
expectedContents: | ||
- '#!/bin/bash' | ||
- '# Copyright 2019 The Bazel Authors. All rights reserved.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2017-2020 Authors of Cilium | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -o xtrace | ||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
if [ "$#" -gt 1 ] ; then | ||
echo "$0 supports at most 1 argument" | ||
exit 1 | ||
fi | ||
|
||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
root_dir="$(git rev-parse --show-toplevel)" | ||
|
||
cd "${root_dir}" | ||
|
||
image="${1:-docker.io/library/golang:1.14}" | ||
|
||
image_digest="$("${script_dir}/get-image-digest.sh" "${image}")" | ||
|
||
# shellcheck disable=SC2207 | ||
used_by=($(git grep -l GOLANG_IMAGE= images)) | ||
|
||
for i in "${used_by[@]}" ; do | ||
sed "s|\(GOLANG_IMAGE=\)docker.io/library/golang:.*\$|\1${image}@${image_digest}|" "${i}" > "${i}.sedtmp" && mv "${i}.sedtmp" "${i}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Copyright 2017-2020 Authors of Cilium | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set -o xtrace | ||
set -o errexit | ||
set -o pipefail | ||
set -o nounset | ||
|
||
if [ "$#" -ne 1 ] ; then | ||
echo "$0 supports exactly 1 argument" | ||
exit 1 | ||
fi | ||
|
||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
root_dir="$(git rev-parse --show-toplevel)" | ||
|
||
cd "${root_dir}" | ||
|
||
image_name="${1}/image-tester" | ||
|
||
image_tag="$(WITHOUT_SUFFIX=1 "${script_dir}/make-image-tag.sh" images/tester)" | ||
|
||
image_digest="$("${script_dir}/get-image-digest.sh" "${image_name}:${image_tag}")" | ||
|
||
# shellcheck disable=SC2207 | ||
used_by=($(git grep -l TESTER_IMAGE= images)) | ||
|
||
for i in "${used_by[@]}" ; do | ||
sed "s|\(TESTER_IMAGE=${image_name}\):.*\$|\1:${image_tag}@${image_digest}|" "${i}" > "${i}.sedtmp" && mv "${i}.sedtmp" "${i}" | ||
done |