# Re-running jobs doesn't currently work because the test API
# server has no git repository to check against. For now, check
- # that the correct script version is mentioned in the
- # Fiddlesticks error message.
+ # that the error message says something appropriate for that
+ # situation.
if expect_options && use_latest
- assert_text "Script version #{job['supplied_script_version']} does not resolve to a commit"
+ assert_text "no local repository for active/foo"
else
assert_text "Script version #{job['script_version']} does not resolve to a commit"
end
raise ArgumentError.new "invalid sha1 #{sha1}"
end
src_gitdir, _ = git_dir_for repo_name
+ unless src_gitdir
+ raise ArgumentError.new "no local repository for #{repo_name}"
+ end
dst_gitdir = Rails.configuration.git_internal_dir
must_pipe("echo #{sha1.shellescape}",
"git --git-dir #{src_gitdir.shellescape} pack-objects -q --revs --stdout",
end
def ensure_script_version_is_commit
- if self.state == Running
+ if state == Running
# Apparently client has already decided to go for it. This is
# needed to run a local job using a local working directory
# instead of a commit-ish.
end
def tag_version_in_internal_repository
- if self.state == Running
+ if state == Running
# No point now. See ensure_script_version_is_commit.
true
+ elsif errors.any?
+ # Won't be saved, and script_version might not even be valid.
+ true
elsif new_record? or repository_changed? or script_version_changed?
uuid_was = uuid
begin