Skip to content

added tests for clickhouse database - #532

Merged
dhui merged 3 commits into
golang-migrate:masterfrom
prinkov:master
Apr 5, 2021
Merged

dhui merged 3 commits into
golang-migrate:masterfrom
prinkov:master

Conversation

@prinkov

@prinkov prinkov commented Mar 24, 2021

Copy link
Copy Markdown
Contributor

Hi!
I want added tests for clickhouse database

@coveralls

coveralls commented Mar 24, 2021 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 272

  • 9 of 11 (81.82%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 56.869%

Changes Missing Coverage Covered Lines Changed/Added Lines %
database/clickhouse/clickhouse.go 9 11 81.82%
Totals Coverage Status
Change from base Build 249: 0.02%
Covered Lines: 3444
Relevant Lines: 6056

💛 - Coveralls

@dhui dhui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Comment thread database/clickhouse/clickhouse.go Outdated
config *Config
conn *sql.DB
config *Config
isLocked bool

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thnx, used

Comment thread database/clickhouse/clickhouse_test.go Outdated
t.Fatal(err)
}

if err := d.(*ClickHouse).ensureVersionTable(); err != nil {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is ensureVersionTable() called twice? Does it need to be called at all?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you right. I removed it, thanks

Comment thread database/clickhouse/clickhouse_test.go Outdated
@@ -0,0 +1,184 @@
package clickhouse

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be clickhouse_test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test included in the package clickhouse, not clichouse_test. Other databases tests included in databases packages too

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see any usage of unexported identifiers, but could have missed some. If we don't need to use unexported identifiers in tests, let's use a different package name for the tests and import the clickhouse package.

Other databases tests included in databases packages too

Some db tests test unexported methods. We should really split our tests into internal and external tests...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understood. Thanks, fixed

@dhui dhui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for address the PR feedback!

@dhui
dhui merged commit d68a3ab into golang-migrate:master Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants