Skip to content

Commit

Permalink
tests: download only needed cached artifacts
Browse files Browse the repository at this point in the history
We don't need to download cached artifacts for other OSes/MacOS
versions, so let's skip doing that where we can.
  • Loading branch information
carlocab committed Apr 23, 2024
1 parent 8eea839 commit 2aa5082
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/tests/formulae.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ def run!(args:)
verify_local_bottles

with_env(HOMEBREW_DISABLE_LOAD_FORMULA: "1") do
download_artifacts_from_previous_run!("bottles{,_*}", dry_run: args.dry_run?)
bottle_specifier = if OS.linux?
"{linux,ubuntu}"
else
"#{MacOS.version}#{"-arm64" if Hardware::CPU.arm?}"
end
download_artifacts_from_previous_run!("bottles{,_#{bottle_specifier}*}", dry_run: args.dry_run?)
end
@bottle_checksums.merge!(
bottle_glob("*", artifact_cache, ".{json,tar.gz}", bottle_tag: "*").to_h do |bottle_file|
Expand Down
7 changes: 6 additions & 1 deletion lib/tests/formulae_dependents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ def run!(args:)

install_formulae_if_needed_from_bottles!(args:)

download_artifacts_from_previous_run!("dependents{,_*}", dry_run: args.dry_run?)
artifact_specifier = if OS.linux?
"{linux,ubuntu}"
else
"#{MacOS.version}#{"-arm64" if Hardware::CPU.arm?}"
end
download_artifacts_from_previous_run!("dependents{,_#{artifact_specifier}*}", dry_run: args.dry_run?)
@skip_candidates = if (tested_dependents_cache = artifact_cache/@tested_dependents_list).exist?
tested_dependents_cache.read.split("\n")
else
Expand Down

0 comments on commit 2aa5082

Please sign in to comment.