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

Add cassandra option test #644

Merged
merged 30 commits into from
Sep 17, 2020
Merged

Add cassandra option test #644

merged 30 commits into from
Sep 17, 2020

Conversation

kpango
Copy link
Collaborator

@kpango kpango commented Aug 27, 2020

Description:

This PR includes the cassandra_option test code, and some refactoring for writing the test code.
It is only the part of the option test.
It also contains the changes to update the coding guideline for FOP implementation and handling.

Reference: #638

Related Issue:

How Has This Been Tested?:

Environment:

  • Go Version: 1.14.4
  • Docker Version: 19.03.8
  • Kubernetes Version: 1.18.2
  • NGT Version: 1.12.0

Types of changes:

  • Bug fix [type/bug]
  • New feature [type/feature]
  • Add tests [type/test]
  • Security related changes [type/security]
  • Add documents [type/documentation]
  • Refactoring [type/refactoring]
  • Update dependencies [type/dependency]
  • Update benchmarks and performances [type/bench]
  • Update CI [type/ci]

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Checklist:

  • I have read the CONTRIBUTING document.
  • I have checked open Pull Requests for the similar feature or fixes?
  • I have added tests and benchmarks to cover my changes.
  • I have ensured all new and existing tests passed.
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly.

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 💌 /changelog - add changelog comment
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • /rebase - rebase master

@pull-assistant
Copy link

pull-assistant bot commented Aug 27, 2020

Score: 0.96

Best reviewed: commit by commit


Optimal code review plan (8 warnings, 2 commits squashed)

     add cassandra option test

     fix

     ttest

fix

...l/db/nosql/cassandra/option.go 67% changes removed in fix failed test and ...

fix int option

...l/db/nosql/cassandra/option.go 56% changes removed in fix failed test and ...

     fix deepsource

     🤖 Update license headers / Format go codes and yaml files

     fix

     fix

     🤖 Update license headers / Format go codes and yaml files

     fix

Merge branch 'master' into test/internal/db/cassandra/option

...ithub/PULL_REQUEST_TEMPLATE.md 50% changes removed in Merge branch 'master...

...s/manager/index/configmap.yaml 67% changes removed in Merge branch 'master...

...PLATE/security_issue_report.md 50% changes removed in Merge branch 'master...

go.mod 44% changes removed in Merge branch 'master...

...b/ISSUE_TEMPLATE/bug_report.md 50% changes removed in Merge branch 'master...

update coding guidel... ... fix

Squashed 2 commits:

...l/db/nosql/cassandra/option.go 80% changes removed in fix

internal/errors/option.go 43% changes removed in fix

...s/contributing/coding-style.md 54% changes removed in update coding guidel...

fix

internal/errors/option.go 50% changes removed in fix

Merge branch 'master' into test/internal/db/cassandra/option

...8s/discoverer/clusterrole.yaml 67% changes removed in Merge branch 'master...

...overer/clusterrolebinding.yaml 67% changes removed in Merge branch 'master...

     fix guideline

apply suggestion

internal/errors/option.go 85% changes removed in fix

     fix

     fix indent

     update guideline

fix

internal/errors/option.go 60% changes removed in fix

     fix

     fix failed test and refactor

     fix comment

     use beforeFunc in test case

     fix

     fix

     update coding guideline

     Merge branch 'master' into test/internal/db/cassandra/option

Powered by Pull Assistant. Last update 5af01e9 ... 8491247. Read the comment docs.

@kevindiu
Copy link
Contributor

/rebase

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/db/cassandra/option

@vdaas-ci vdaas-ci force-pushed the test/internal/db/cassandra/option branch from c4dbb6c to ed0a05b Compare August 27, 2020 06:39
@codecov
Copy link

codecov bot commented Aug 27, 2020

Codecov Report

Merging #644 into master will increase coverage by 0.08%.
The diff coverage is 36.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #644      +/-   ##
==========================================
+ Coverage   15.35%   15.43%   +0.08%     
==========================================
  Files         412      417       +5     
  Lines       21629    22177     +548     
==========================================
+ Hits         3321     3424     +103     
- Misses      18060    18518     +458     
+ Partials      248      235      -13     
Impacted Files Coverage Δ
internal/db/nosql/cassandra/cassandra.go 0.00% <0.00%> (ø)
internal/errors/option.go 0.00% <0.00%> (ø)
internal/db/nosql/cassandra/option.go 30.07% <100.00%> (+20.26%) ⬆️
internal/db/storage/blob/s3/writer/option.go 100.00% <100.00%> (ø)
internal/config/ngt.go 100.00% <0.00%> (ø)
pkg/agent/core/ngt/service/ngt.go 0.00% <0.00%> (ø)
pkg/agent/core/ngt/usecase/agentd.go 0.00% <0.00%> (ø)
pkg/tools/cli/loadtest/usecase/load.go 0.00% <0.00%> (ø)
pkg/tools/cli/loadtest/service/loader.go 0.00% <0.00%> (ø)
...ternal/observability/metrics/agent/core/ngt/ngt.go 0.00% <0.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8445611...8491247. Read the comment docs.

@kevindiu
Copy link
Contributor

/rebase

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/db/cassandra/option

@kevindiu
Copy link
Contributor

/rebase

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/db/cassandra/option

@kevindiu kevindiu requested a review from hlts2 August 31, 2020 02:51
hlts2
hlts2 previously approved these changes Aug 31, 2020
Copy link
Contributor

@hlts2 hlts2 left a comment

Choose a reason for hiding this comment

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

LGTM

vankichi
vankichi previously approved these changes Sep 1, 2020
Copy link
Contributor

@vankichi vankichi left a comment

Choose a reason for hiding this comment

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

LGTM
but, it contains logic changes, please ask for authors.

internal/db/nosql/cassandra/option.go Outdated Show resolved Hide resolved
hlts2
hlts2 previously approved these changes Sep 16, 2020
Copy link
Contributor

@hlts2 hlts2 left a comment

Choose a reason for hiding this comment

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

LGTM

@kevindiu kevindiu changed the title [WIP] Add cassandra option test Add cassandra option test Sep 16, 2020
internal/db/nosql/cassandra/option.go Outdated Show resolved Hide resolved
internal/db/nosql/cassandra/option.go Outdated Show resolved Hide resolved
internal/errors/option.go Show resolved Hide resolved
internal/db/nosql/cassandra/option_test.go Outdated Show resolved Hide resolved
internal/db/nosql/cassandra/option_test.go Outdated Show resolved Hide resolved
internal/db/nosql/cassandra/option_test.go Outdated Show resolved Hide resolved
internal/db/nosql/cassandra/option_test.go Outdated Show resolved Hide resolved
},
},
{
name: "set timeout success if the time format is invalid",
Copy link
Contributor

Choose a reason for hiding this comment

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

why??

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this pattern gets the error...

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

could you please tell me the reason of this implementation?
maybe, I heard at once, but I forgot 😓

Copy link
Contributor

Choose a reason for hiding this comment

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

@vankichi There's no reason of this implementation. I haven't fix this implementation😂
Please let me fix it in next PR as changing it cause logic changes which requires approval from authors, which may cause time.

Copy link
Contributor

Choose a reason for hiding this comment

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

what should we do?

Copy link
Contributor

Choose a reason for hiding this comment

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

@vankichi can we ignore it in this PR and work on it in next PR?

internal/db/nosql/cassandra/option_test.go Outdated Show resolved Hide resolved
internal/db/nosql/cassandra/option_test.go Outdated Show resolved Hide resolved
internal/db/nosql/cassandra/option_test.go Outdated Show resolved Hide resolved
},
},
{
name: "set timeout success if the time format is invalid",
Copy link
Contributor

Choose a reason for hiding this comment

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

what should we do?

@kpango
Copy link
Collaborator Author

kpango commented Sep 17, 2020

/rebase
/format

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kpango for branch: test/internal/db/cassandra/option

@vdaas-ci
Copy link
Collaborator

[REBASE] Failed to rebase.

hlts2
hlts2 previously approved these changes Sep 17, 2020
return nil, errors.ErrOptionFailed(err, reflect.ValueOf(opt))
werr := errors.ErrOptionFailed(err, reflect.ValueOf(opt))

e := new(errors.ErrCriticalOption)
Copy link
Contributor

Choose a reason for hiding this comment

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

[LanguageTool] reported by reviewdog 🐶
This sentence does not start with an uppercase letter (UPPERCASE_SENTENCE_START)
Suggestions: E
Rule: https://community.languagetool.org/rule/show/UPPERCASE_SENTENCE_START?lang=en-US
Category: CASING

return nil, errors.ErrOptionFailed(err, reflect.ValueOf(opt))
werr := errors.ErrOptionFailed(err, reflect.ValueOf(opt))

e := new(errors.ErrCriticalOption)
Copy link
Contributor

Choose a reason for hiding this comment

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

[LanguageTool] reported by reviewdog 🐶
Add a space between sentences (SENTENCE_WHITESPACE)
Suggestions: ErrCriticalOption
Rule: https://community.languagetool.org/rule/show/SENTENCE_WHITESPACE?lang=en-US
Category: TYPOGRAPHY

werr := errors.ErrOptionFailed(err, reflect.ValueOf(opt))

e := new(errors.ErrCriticalOption)
if errors.As(err, &e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[LanguageTool] reported by reviewdog 🐶
Add a space between sentences (SENTENCE_WHITESPACE)
Suggestions: As
Rule: https://community.languagetool.org/rule/show/SENTENCE_WHITESPACE?lang=en-US
Category: TYPOGRAPHY

werr := errors.ErrOptionFailed(err, reflect.ValueOf(opt))

e := new(errors.ErrCriticalOption)
if errors.As(err, &e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[LanguageTool] reported by reviewdog 🐶
Don't put a space after the opening parenthesis (COMMA_PARENTHESIS_WHITESPACE)
Suggestions: {
Rule: https://community.languagetool.org/rule/show/COMMA_PARENTHESIS_WHITESPACE?lang=en-US
Category: TYPOGRAPHY

@kpango
Copy link
Collaborator Author

kpango commented Sep 17, 2020

/rebase
/format
/approve

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kpango for branch: test/internal/db/cassandra/option

@vdaas-ci
Copy link
Collaborator

[REBASE] Failed to rebase.

@kpango
Copy link
Collaborator Author

kpango commented Sep 17, 2020

/format
/approve

@vdaas-ci
Copy link
Collaborator

[FORMAT] Updating license headers and formatting go codes triggered by kpango.

Copy link
Collaborator

@vdaas-ci vdaas-ci left a comment

Choose a reason for hiding this comment

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

[APPROVED] This PR is approved by kpango.

@kpango kpango merged commit 1bd41ef into master Sep 17, 2020
@kpango kpango deleted the test/internal/db/cassandra/option branch September 17, 2020 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants