Skip to content

Commit

Permalink
feat(bigquery): Add Routine#determinism_level
Browse files Browse the repository at this point in the history
* Add Routine#determinism_level
* Add Routine#determinism_level=
* Add Routine#determinism_level_deterministic?
* Add Routine#determinism_level_not_deterministic?
* Add Routine::Updater#determinism_level=

closes: googleapis#8960
refs: googleapis#9127
  • Loading branch information
quartzmo committed Feb 9, 2021
1 parent 722a0d1 commit ff98830
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions google-cloud-bigquery/acceptance/bigquery/routine_test.rb
Expand Up @@ -252,6 +252,8 @@
_(routine.body).must_equal "return x * 3;"
_(routine.description).must_equal "my description"
_(routine.determinism_level).must_equal "DETERMINISTIC"
_(routine.determinism_level_deterministic?).must_equal true
_(routine.determinism_level_not_deterministic?).must_equal false

arguments = routine.arguments
_(arguments).must_be_kind_of Array
Expand Down
Expand Up @@ -143,6 +143,8 @@

_(routine.description).must_equal new_description
_(routine.determinism_level).must_equal new_determinism_level
_(routine.determinism_level_deterministic?).must_equal false
_(routine.determinism_level_not_deterministic?).must_equal true
end

it "updates its routine_type" do
Expand Down Expand Up @@ -307,6 +309,8 @@
mock.verify

_(routine.determinism_level).must_equal new_determinism_level
_(routine.determinism_level_deterministic?).must_equal false
_(routine.determinism_level_not_deterministic?).must_equal true
end

it "updates its attributes in a block" do
Expand Down Expand Up @@ -346,6 +350,8 @@
_(routine.body).must_equal new_body
_(routine.description).must_equal new_description
_(routine.determinism_level).must_equal new_determinism_level
_(routine.determinism_level_deterministic?).must_equal false
_(routine.determinism_level_not_deterministic?).must_equal true
end

it "skips update when no updates are made in a block" do
Expand Down
Expand Up @@ -147,6 +147,8 @@

_(routine.description).must_equal new_description
_(routine.determinism_level).must_equal new_determinism_level
_(routine.determinism_level_deterministic?).must_equal false
_(routine.determinism_level_not_deterministic?).must_equal true
end

it "updates its routine_type" do
Expand Down Expand Up @@ -309,6 +311,8 @@
mock.verify

_(routine.determinism_level).must_equal new_determinism_level
_(routine.determinism_level_deterministic?).must_equal false
_(routine.determinism_level_not_deterministic?).must_equal true
end

it "updates its attributes in a block" do
Expand Down Expand Up @@ -348,6 +352,8 @@
_(routine.body).must_equal new_body
_(routine.description).must_equal new_description
_(routine.determinism_level).must_equal new_determinism_level
_(routine.determinism_level_deterministic?).must_equal false
_(routine.determinism_level_not_deterministic?).must_equal true
end

it "skips update when no updates are made in a block" do
Expand Down
Expand Up @@ -135,6 +135,8 @@
_(routine.body).must_equal "x * 3"
_(routine.description).must_equal description
_(routine.determinism_level).must_equal determinism_level
_(routine.determinism_level_deterministic?).must_equal true
_(routine.determinism_level_not_deterministic?).must_equal false
end

it "can test its existence" do
Expand Down Expand Up @@ -335,6 +337,8 @@

it "updates its determinism_level" do
_(routine.determinism_level).must_equal determinism_level
_(routine.determinism_level_deterministic?).must_equal true
_(routine.determinism_level_not_deterministic?).must_equal false

mock = Minitest::Mock.new
updated_routine_gapi = routine_gapi.dup
Expand All @@ -348,11 +352,15 @@
mock.verify

_(routine.determinism_level).must_equal new_determinism_level
_(routine.determinism_level_deterministic?).must_equal false
_(routine.determinism_level_not_deterministic?).must_equal true
end

it "updates its attributes in a block" do
_(routine.description).must_equal description
_(routine.determinism_level).must_equal determinism_level
_(routine.determinism_level_deterministic?).must_equal true
_(routine.determinism_level_not_deterministic?).must_equal false

mock = Minitest::Mock.new
updated_routine_gapi = routine_gapi.dup
Expand Down Expand Up @@ -388,6 +396,9 @@
_(routine.imported_libraries).must_equal new_imported_libraries
_(routine.body).must_equal new_body
_(routine.description).must_equal new_description
_(routine.determinism_level).must_equal new_determinism_level
_(routine.determinism_level_deterministic?).must_equal false
_(routine.determinism_level_not_deterministic?).must_equal true
end

it "skips update when no updates are made in a block" do
Expand Down

0 comments on commit ff98830

Please sign in to comment.