Skip to content
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
9 changes: 6 additions & 3 deletions scripts/campfire-oracle
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,15 @@ cmd_prepare() {
[[ -d "$APP" ]] || die "no campfire checkout at $APP"
command -v sqlite3 >/dev/null || die "sqlite3 not on PATH"

local sha
sha="$(git -C "$APP" rev-parse HEAD 2>/dev/null || echo unknown)"
local sha=unknown tracked=
# Not a bare rev-parse: a tarball checkout inside another repository (Bazel's execroot links .git) would archive that one.
if [[ "$(git -C "$APP" rev-parse --show-toplevel 2>/dev/null)" == "$(cd "$APP" && pwd -P)" ]]; then
tracked=1; sha="$(git -C "$APP" rev-parse HEAD)"
fi

step "exporting $APP @ ${sha:0:12} -> $OUT"
rm -rf "$OUT"; mkdir -p "$OUT"
if git -C "$APP" rev-parse HEAD >/dev/null 2>&1; then
if [[ -n "$tracked" ]]; then
# git archive: tracked files only, no local litter.
(cd "$APP" && git archive HEAD) | tar -x -C "$OUT"
else
Expand Down
8 changes: 5 additions & 3 deletions tests/overlay_cable_dispatch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ def self.application = @application ||= Struct.new(:global_id_app, :secret_key_b
load "#{root}/runtime/ruby/action_controller/message_verifier.rb"

# action_cable.rb's one require; the transport half is not under test.
$LOADED_FEATURES << File.expand_path(
"#{root}/runtime/spinel/scaffold/ruby_overlay/runtime/broadcasts.rb"
# Not expand_path: require_relative resolves symlinks, so under a symlinked tree (Bazel's runfiles) the paths differ.
$LOADED_FEATURES << File.join(
File.dirname(File.realpath("#{root}/runtime/spinel/scaffold/ruby_overlay/runtime/action_cable.rb")),
"broadcasts.rb"
)
module Broadcasts
LOG = []
Expand All @@ -69,7 +71,7 @@ module Broadcasts
# Loading the spinel action_cable here would replace `Channel::Base` with
# the sibling whose methods raise — a green run against the wrong file.
%w[action_cable base64 broadcasts].each do |sibling|
$LOADED_FEATURES << File.expand_path("#{root}/runtime/spinel/#{sibling}.rb")
$LOADED_FEATURES << File.join(File.dirname(File.realpath("#{root}/runtime/spinel/turbo_streams.rb")), "#{sibling}.rb")
end
load "#{root}/runtime/spinel/turbo_streams.rb"
load "#{root}/runtime/spinel/global_id_locator.rb"
Expand Down
6 changes: 4 additions & 2 deletions tests/overlay_cable_identity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ def self.application = @app ||= Application.new("a" * 64)
load "#{root}/runtime/spinel/cgi_io.rb"

# action_cable.rb's one require; the transport half is not under test.
$LOADED_FEATURES << File.expand_path(
"#{root}/runtime/spinel/scaffold/ruby_overlay/runtime/broadcasts.rb"
# Not expand_path: require_relative resolves symlinks, so under a symlinked tree (Bazel's runfiles) the paths differ.
$LOADED_FEATURES << File.join(
File.dirname(File.realpath("#{root}/runtime/spinel/scaffold/ruby_overlay/runtime/action_cable.rb")),
"broadcasts.rb"
)
module Broadcasts
LOG = []
Expand Down
Loading