Skip to content

Commit

Permalink
tests: Update benchmark tests for Protobuf 4
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma committed Aug 16, 2024
1 parent 7842fe9 commit 44a5667
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 58 deletions.
59 changes: 59 additions & 0 deletions google-cloud-spanner/.toys.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# frozen_string_literal: true

# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

toys_version! ">= 0.15.6"

if ENV["RUBY_COMMON_TOOLS"]
common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"]
load File.join(common_tools_dir, "toys", "gapic")
else
load_git remote: "https://github.com/googleapis/ruby-common-tools.git",
path: "toys/gapic",
update: true
end

tool "benchmark" do
tool "gen-protos" do
include :exec, e: true
include :gems
include :git_cache

def run
setup
generate_spanner_bench
end

def setup
gem "grpc-tools", "~> 1.65"
@googleapis_dir = git_cache.get "https://github.com/googleapis/googleapis.git", update: true
Dir.chdir context_directory
end

def generate_spanner_bench
Dir.chdir "benchmark/benchwrapper" do
cmd = [
"grpc_tools_ruby_protoc",
"--ruby_out", ".",
"--grpc_out", ".",
"-I", ".",
"-I", @googleapis_dir,
"spanner_bench/spanner.proto"
]
exec cmd
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

require 'optparse'
require 'grpc'
require 'spanner_services_pb'
require 'spanner_bench/spanner_services_pb'
require "google/cloud/spanner"

include SpannerBench
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 0 additions & 55 deletions google-cloud-spanner/benchmark/benchwrapper/spanner_pb.rb

This file was deleted.

0 comments on commit 44a5667

Please sign in to comment.