Skip to content

Commit

Permalink
Skip running tests if there are no relevant changes
Browse files Browse the repository at this point in the history
  • Loading branch information
iangmaia committed Feb 24, 2025
1 parent a6877f9 commit 03d02a1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .buildkite/commands/run-ui-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash -eu

if .buildkite/commands/should-skip-ui-tests.sh; then
message="Skipping UI Tests as only documentation, tooling and/or non-code files were changed"
echo "$message" | buildkite-agent annotate --style "info" --context "skip-ui-tests"
echo "$message"
exit 0
fi

TEST_NAME=$1
DEVICE=$2

Expand Down
7 changes: 7 additions & 0 deletions .buildkite/commands/run-unit-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/bash -eu

if .buildkite/commands/should-skip-tests.sh; then
message="Skipping Unit Tests as only documentation and non-code files were changed"
echo "$message" | buildkite-agent annotate --style "info" --context "skip-unit-tests"
echo "$message"
exit 0
fi

# Run this at the start to fail early if value not available
echo '--- :test-analytics: Configuring Test Analytics'
export BUILDKITE_ANALYTICS_TOKEN=$BUILDKITE_ANALYTICS_TOKEN_UNIT_TESTS
Expand Down
4 changes: 4 additions & 0 deletions .buildkite/commands/should-skip-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Check if changes are limited to documentation, tooling and non-code files
pr_changed_files --all-match "*.md" "docs/**" "*.txt" "*.pot" "fastlane/**" ".github/**" ".buildkite/**"
2 changes: 1 addition & 1 deletion .buildkite/shared-pipeline-vars
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it.

XCODE_VERSION=$(sed 's/^~> *//' .xcode-version)
CI_TOOLKIT_PLUGIN_VERSION="3.9.1"
CI_TOOLKIT_PLUGIN_VERSION="4.0.0"

# Note: `-v4` suffix was added to use xcode-16.1-v4 image; remember to remove that suffix during the next Xcode update
export IMAGE_ID="xcode-$XCODE_VERSION-v4"
Expand Down

0 comments on commit 03d02a1

Please sign in to comment.