-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing SQL #338
Fixing SQL #338
Conversation
@factory = SqlV1Factory.new(namespaced_name) | ||
end | ||
|
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingBlankLines: Final newline missing.
@subject = Fog::Google[:sql].instances | ||
@factory = SqlV1Factory.new(namespaced_name) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/EmptyLinesAroundClassBody: Extra empty line detected at class body end.
@subject = Fog::Google[:sql].instances | ||
@factory = SqlV1InstancesFactory.new(namespaced_name) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingBlankLines: Final newline missing.
assert_equal(labels, updated.settings[:user_labels]) | ||
assert_operator(updated.settings_version, :>, settings_version) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingBlankLines: Final newline missing.
|
||
settings_version = instance.settings_version | ||
labels = { | ||
:foo => "bar" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentHash: Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
0b53fdf
to
4e1a115
Compare
"expected no user #{user.name}" | ||
) | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingBlankLines: Final newline missing.
# Delete user | ||
users.first.destroy(:async => false) | ||
assert_empty( | ||
@subject.all(user.instance).select { |u| u.name == user.name }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/FirstParameterIndentation: Indent the first parameter one step more than the start of the previous line.
|
||
def cleanup | ||
# Users will be cleaned up with the test instance. | ||
@instances.cleanup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationWidth: Use 2 (not 3) spaces for indentation.
@subject.get(instance_name, ssl_cert2.sha1_fingerprint).tap do |result| | ||
assert_equal(ssl_cert2.common_name, result.common_name) | ||
assert_equal("sql#sslCert", result.kind) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/BlockAlignment: end at 33, 6 is not aligned with @subject.get(instance_name, ssl_cert2.sha1_fingerprint).tap do |result| at 30, 4.
ssl_cert2 = @subject.new( | ||
:common_name => "#{ssl_cert.common_name}-2" , | ||
:instance => instance_name | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/ClosingParenthesisIndentation: Indent ) the same as the start of the line where ( is.
|
||
# Create a second cert and attach to the same instance | ||
ssl_cert2 = @subject.new( | ||
:common_name => "#{ssl_cert.common_name}-2" , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/FirstParameterIndentation: Indent the first parameter one step more than the start of the previous line.
Layout/SpaceBeforeComma: Space found before comma.
|
||
def cleanup | ||
# Certs will be cleaned up with the test instance. | ||
@instances.cleanup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/IndentationWidth: Use 2 (not 3) spaces for indentation.
|
||
# Create a second cert and attach to the same instance | ||
ssl_cert2 = @subject.new( :common_name => "#{ssl_cert.common_name}-2", | ||
:instance => instance_name ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/SpaceInsideParens: Space inside parentheses detected.
instance_name = ssl_cert.instance | ||
|
||
# Create a second cert and attach to the same instance | ||
ssl_cert2 = @subject.new( :common_name => "#{ssl_cert.common_name}-2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/SpaceInsideParens: Space inside parentheses detected.
description = "test backup run" | ||
operation = wait_until_complete do | ||
@client.insert_backup_run( | ||
instance.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/FirstParameterIndentation: Indent the first parameter one step more than the start of the previous line.
5c0a1ef
to
826d293
Compare
tasks/test.rake
Outdated
t.libs << "test" | ||
t.pattern = FileList['test/integration/sql/test_*.rb'] | ||
t.pattern = FileList['test/integration/sql/test_v2*.rb'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
tasks/test.rake
Outdated
t.name = "sqlv1" | ||
t.description = "Run SQLv1 API tests" | ||
t.libs << "test" | ||
t.pattern = FileList['test/integration/sql/test_common*.rb','test/integration/sql/test_v1*.rb'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Layout/SpaceAfterComma: Space missing after comma.
tasks/test.rake
Outdated
multitask :sql_parallel => [:sqlv1, :sqlv2] | ||
|
||
desc 'Run all SQL API tests' | ||
task :sql => [:sqlv1, :sqlv2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/SymbolArray: Use %i or %I for an array of symbols.
tasks/test.rake
Outdated
desc 'Run all SQL API tests in parallel' | ||
multitask :sql_parallel => [:sqlv1, :sqlv2] | ||
|
||
desc 'Run all SQL API tests' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
tasks/test.rake
Outdated
@@ -46,11 +47,26 @@ namespace :test do | |||
t.verbose = true | |||
end | |||
|
|||
desc 'Run all SQL API tests in parallel' | |||
multitask :sql_parallel => [:sqlv1, :sqlv2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/SymbolArray: Use %i or %I for an array of symbols.
tasks/test.rake
Outdated
@@ -46,11 +47,26 @@ namespace :test do | |||
t.verbose = true | |||
end | |||
|
|||
desc 'Run all SQL API tests in parallel' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
tasks/test.rake
Outdated
t.libs << "test" | ||
t.pattern = FileList['test/integration/sql/test_*.rb'] | ||
t.pattern = FileList['test/integration/sql/test_v2*.rb'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
tasks/test.rake
Outdated
t.name = "sqlv1" | ||
t.description = "Run SQLv1 API tests" | ||
t.libs << "test" | ||
t.pattern = FileList['test/integration/sql/test_common*.rb','test/integration/sql/test_v1*.rb'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
Layout/SpaceAfterComma: Space missing after comma.
tasks/test.rake
Outdated
multitask :sql_parallel => [:sqlv1, :sqlv2] | ||
|
||
desc 'Run all SQL API tests' | ||
task :sql => [:sqlv1, :sqlv2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/SymbolArray: Use %i or %I for an array of symbols.
tasks/test.rake
Outdated
desc 'Run all SQL API tests in parallel' | ||
multitask :sql_parallel => [:sqlv1, :sqlv2] | ||
|
||
desc 'Run all SQL API tests' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
tasks/test.rake
Outdated
@@ -46,11 +47,26 @@ namespace :test do | |||
t.verbose = true | |||
end | |||
|
|||
desc 'Run all SQL API tests in parallel' | |||
multitask :sql_parallel => [:sqlv1, :sqlv2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/SymbolArray: Use %i or %I for an array of symbols.
tasks/test.rake
Outdated
@@ -46,11 +47,26 @@ namespace :test do | |||
t.verbose = true | |||
end | |||
|
|||
desc 'Run all SQL API tests in parallel' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.
SQL Api is being flaky again, it seems -_- I'll try to figure this out, probably will need to wrap with |
tasks/test.rake
Outdated
t.name = "sqlv1" | ||
t.description = "Run SQLv1 API tests" | ||
t.libs << "test" | ||
t.pattern = FileList["test/integration/sql/test_common*.rb","test/integration/sql/test_v1*.rb"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/SpaceAfterComma: Space missing after comma.
tasks/test.rake
Outdated
multitask :sql_parallel => [:sqlv1, :sqlv2] | ||
|
||
desc "Run all SQL API tests" | ||
task :sql => [:sqlv1, :sqlv2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/SymbolArray: Use %i or %I for an array of symbols.
tasks/test.rake
Outdated
end | ||
|
||
desc "Run all SQL API tests in parallel" | ||
multitask :sql_parallel => [:sqlv1, :sqlv2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/SymbolArray: Use %i or %I for an array of symbols.
Ok, it seems only us-central1 is misbehaving. Australia is fine. I'll try to choose another US region first but if this is persistent I'll need to investigate the backend. |
So I get tons of I'll need to sleep on this... Maybe add a simple wait to teardown or something. |
00ee296
to
22381bb
Compare
6040ca3
to
c2a2f9e
Compare
tasks/test.rake
Outdated
t.warning = false | ||
t.verbose = true | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/TrailingWhitespace: Trailing whitespace detected.
- Changes to instantiate proper collection tests: -- Add sql users factory and migrate user tests to it -- Adding SslCert factory -- Breaking out tests by subject collection - Removing old v1 Tests - Drive-by fix for SQL Users model workflow -- If Etag is nil then User doesn't exist, so should be inserted, not the other way around. -- Changed async to positional parameter to match other models.
- Remove list test as .all depends on list - Scope down the test to not instantiate a full client
Refactored old SQLv2 tests, deleting old shared
To locally preempt HoundCI where needed
- Make monitoring cleanup less chatty - Bump GoogleSQL instance tier - Since Shared CPU machine types (db-f1-micro and db-g1-small) are not covered by the Cloud SQL SLA. See: https://cloud.google.com/sql/pricing - Set github status if any CI task failed - Make SQL tests serial - Tweak rubocop rules
This is now finalised, waiting for integration tests and we should be good to go. |
A lot of SQL refactoring, mostly tests. This will slow tests down a bit but will fix 99% of the flakiness, and add proper lifecycle tests.
SQL Tests
Minor CI/Test improvements
Drive-by improvements:
Set SQL delete/create operations to synchronous
Fixes for SQL Users model workflow
not the other way around.
Minor refactor of tier tests
Improve disk type test to include more regions
Fixes #337