Skip to content
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

added tests for clickhouse database #532

Merged
merged 3 commits into from Apr 5, 2021
Merged

added tests for clickhouse database #532

merged 3 commits into from Apr 5, 2021

Conversation

prinkov
Copy link
Contributor

@prinkov prinkov commented Mar 24, 2021

Hi!
I want added tests for clickhouse database

@coveralls
Copy link

coveralls commented Mar 24, 2021

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

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

config *Config
conn *sql.DB
config *Config
isLocked bool
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thnx, used

t.Fatal(err)
}

if err := d.(*ClickHouse).ensureVersionTable(); err != nil {
Copy link
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
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

@@ -0,0 +1,184 @@
package clickhouse
Copy link
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
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
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
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

Copy link
Member

@dhui dhui left a comment

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.

None yet

3 participants