Skip to content

Commit

Permalink
chore(bigtable): fix conformance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma committed Jul 22, 2024
1 parent 12ef2ad commit 498e937
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 54 deletions.
49 changes: 48 additions & 1 deletion google-cloud-bigtable/.toys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

toys_version! ">= 0.15.3"
toys_version! ">= 0.15.6"

if ENV["RUBY_COMMON_TOOLS"]
common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"]
Expand All @@ -24,3 +24,50 @@
path: "toys/gapic",
update: true
end

tool "conformance" do
tool "gen-tests" do
include :exec, e: true
include :gems
include :git_cache

def run
setup
generate_conformance
generate_test_proxy
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_conformance
Dir.chdir "conformance/v2/proto" do
cmd = [
"grpc_tools_ruby_protoc",
"--ruby_out", ".",
"-I", ".",
"-I", @googleapis_dir,
"google/cloud/conformance/bigtable/v2/tests.proto"
]
exec cmd
end
end

def generate_test_proxy
Dir.chdir "test/test_proxy/proto" do
cmd = [
"grpc_tools_ruby_protoc",
"--ruby_out", ".",
"--grpc_out", ".",
"-I", ".",
"-I", @googleapis_dir,
"google/bigtable/testproxy/test_proxy.proto"
]
exec cmd
end
end
end
end

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

8 changes: 4 additions & 4 deletions google-cloud-bigtable/test/test_proxy/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source "https://rubygems.org"

gem "google-cloud-bigtable", path: "../../"
gem "grpc", "~> 1.62"
gem "grpc-tools", "~> 1.62"
gem "googleapis-common-protos", "~> 1.5"
gem "googleapis-common-protos-types", "~> 1.14"
gem "grpc", "~> 1.65"
gem "grpc-tools", "~> 1.65"
gem "googleapis-common-protos", "~> 1.6"
gem "googleapis-common-protos-types", "~> 1.15"

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

2 changes: 1 addition & 1 deletion google-cloud-bigtable/test/test_proxy/test_proxy.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Generated protos live here
$LOAD_PATH << File.join(__dir__, "lib")
$LOAD_PATH << File.join(__dir__, "proto")

require "grpc"
require "google/cloud/bigtable"
Expand Down

0 comments on commit 498e937

Please sign in to comment.