Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [ci] Use es snapshot cache for jest integration tests (#196695) #196875

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .buildkite/scripts/copy_es_snapshot_cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -euo pipefail

# If cached snapshots are baked into the agent, copy them into our workspace first
# We are doing this rather than simply changing the ES base path because many workers
# run with the workspace mounted in memory or on a local ssd
cacheDir="$ES_CACHE_DIR/cache"
if [[ -d "$cacheDir" ]]; then
mkdir -p .es/cache
echo "--- Copying ES snapshot cache"
echo "Copying cached snapshots from $cacheDir to .es/cache"
cp -R "$cacheDir"/* .es/cache/
fi
12 changes: 1 addition & 11 deletions .buildkite/scripts/steps/functional/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,7 @@ source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/download_build_artifacts.sh

# If cached snapshots are baked into the agent, copy them into our workspace first
# We are doing this rather than simply changing the ES base path because many workers
# run with the workspace mounted in memory or on a local ssd
cacheDir="$ES_CACHE_DIR/cache"
if [[ -d "$cacheDir" ]]; then
mkdir -p .es/cache
echo "--- Copying ES snapshot cache"
echo "Copying cached snapshots from $cacheDir to .es/cache"
cp -R "$cacheDir"/* .es/cache/
fi
.buildkite/scripts/copy_es_snapshot_cache.sh

is_test_execution_step

1 change: 1 addition & 0 deletions .buildkite/scripts/steps/test/jest_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ source .buildkite/scripts/common/util.sh
is_test_execution_step

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/copy_es_snapshot_cache.sh

echo '--- Jest Integration Tests'
.buildkite/scripts/steps/test/jest_parallel.sh jest.integration.config.js