Skip to content

Commit

Permalink
Add kokoro_cleanup to end of verify_buildconfigs.sh to fix consistent…
Browse files Browse the repository at this point in the history
… failure.

Move actual commands to top of Kokoro shell scripts, and out of common.sh. Keep exports and function defs in common.sh.

Change-Id: I726d46eebe825caf5fa1e12eb7358f0ec0644941
  • Loading branch information
thmsbinder committed Jan 23, 2025
1 parent c1826e3 commit a20e7b5
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 27 deletions.
17 changes: 13 additions & 4 deletions kokoro/build_test_and_copy_to_placer.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
#!/usr/bin/env bash
echo "[$(date --utc)] Starting $0"

# shellcheck source=./kokoro/helpers/copy_binaries.sh
source "$(dirname "$0")/helpers/copy_binaries.sh"
# shellcheck source=./kokoro/helpers/common.sh
source "$(dirname "$0")/helpers/common.sh"
set -o errexit
set -o nounset
set -o xtrace
set -o pipefail

# Make sure we're in the root of the repository.
cd "$(dirname "$0")/.."

# shellcheck source=kokoro/helpers/copy_binaries.sh
source kokoro/helpers/copy_binaries.sh
# shellcheck source=kokoro/helpers/common.sh
source kokoro/helpers/common.sh

./scripts/docker_pull
# TODO: b/337266665 - Remove bazel-cache-test logic once we are satisfied with remote cache hits.
Expand Down
13 changes: 11 additions & 2 deletions kokoro/check_format.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/env bash
echo "[$(date --utc)] Starting $0"

# shellcheck source=./kokoro/helpers/common.sh
source "$(dirname "$0")/helpers/common.sh"
set -o errexit
set -o nounset
set -o xtrace
set -o pipefail

# Make sure we're in the root of the repository.
cd "$(dirname "$0")/.."

# shellcheck source=kokoro/helpers/common.sh
source kokoro/helpers/common.sh

./scripts/docker_pull
./scripts/docker_run nix develop .#ci --command just check-format
Expand Down
11 changes: 0 additions & 11 deletions kokoro/helpers/common.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
#!/usr/bin/env bash

echo "[$(date --utc)] Starting $0"

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


# Detect the kokoro job type, so our scripts can make configuration decisions
# based on whether we are running in presubmit or continous mode.
#
Expand All @@ -32,9 +24,6 @@ export XDG_RUNTIME_DIR=/var/run
export JUST_TIMESTAMP=true
export JUST_TIMESTAMP_FORMAT='JUST:%H:%M:%S%.3f'

# Make sure we're in the root of the repository.
cd "$(dirname "$0")/.."

function kokoro_cleanup() {
# Clean up bazel out directories to avoid everything being considered an action output.
# That is also problematic because bazel-out is an absolute symlink, and that is not allowed by
Expand Down
13 changes: 11 additions & 2 deletions kokoro/run_cargo_deny.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/env bash
echo "[$(date --utc)] Starting $0"

# shellcheck source=./kokoro/helpers/common.sh
source "$(dirname "$0")/helpers/common.sh"
set -o errexit
set -o nounset
set -o xtrace
set -o pipefail

# Make sure we're in the root of the repository.
cd "$(dirname "$0")/.."

# shellcheck source=kokoro/helpers/common.sh
source kokoro/helpers/common.sh

./scripts/docker_pull
./scripts/docker_run nix develop .#ci --command just cargo-audit
Expand Down
13 changes: 11 additions & 2 deletions kokoro/run_cargo_udeps.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/env bash
echo "[$(date --utc)] Starting $0"

# shellcheck source=./kokoro/helpers/common.sh
source "$(dirname "$0")/helpers/common.sh"
set -o errexit
set -o nounset
set -o xtrace
set -o pipefail

# Make sure we're in the root of the repository.
cd "$(dirname "$0")/.."

# shellcheck source=kokoro/helpers/common.sh
source kokoro/helpers/common.sh

./scripts/docker_pull
./scripts/docker_run nix develop .#ci --command just cargo-udeps
Expand Down
13 changes: 11 additions & 2 deletions kokoro/run_clippy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/env bash
echo "[$(date --utc)] Starting $0"

# shellcheck source=./kokoro/helpers/common.sh
source "$(dirname "$0")/helpers/common.sh"
set -o errexit
set -o nounset
set -o xtrace
set -o pipefail

# Make sure we're in the root of the repository.
cd "$(dirname "$0")/.."

# shellcheck source=kokoro/helpers/common.sh
source kokoro/helpers/common.sh

./scripts/docker_pull
./scripts/docker_run nix develop .#default --command just clippy-ci
Expand Down
13 changes: 11 additions & 2 deletions kokoro/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/env bash
echo "[$(date --utc)] Starting $0"

# shellcheck source=./kokoro/helpers/common.sh
source "$(dirname "$0")/helpers/common.sh"
set -o errexit
set -o nounset
set -o xtrace
set -o pipefail

# Make sure we're in the root of the repository.
cd "$(dirname "$0")/.."

# shellcheck source=kokoro/helpers/common.sh
source kokoro/helpers/common.sh

upload_test_logs() {
mkdir -p "${KOKORO_ARTIFACTS_DIR}/test_logs/"
Expand Down
13 changes: 11 additions & 2 deletions kokoro/verify_buildconfigs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/env bash
echo "[$(date --utc)] Starting $0"

# shellcheck source=./kokoro/helpers/common.sh
source "$(dirname "$0")/helpers/common.sh"
set -o errexit
set -o nounset
set -o xtrace
set -o pipefail

# Make sure we're in the root of the repository.
cd "$(dirname "$0")/.."

# shellcheck source=kokoro/helpers/common.sh
source kokoro/helpers/common.sh

./scripts/docker_pull
./scripts/docker_run nix develop .#ci --command just kokoro_verify_buildconfigs
Expand Down

0 comments on commit a20e7b5

Please sign in to comment.