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 internal/config/tls test #534

Merged
merged 3 commits into from
Jul 2, 2020
Merged

add internal/config/tls test #534

merged 3 commits into from
Jul 2, 2020

Conversation

vankichi
Copy link
Contributor

@vankichi vankichi commented Jul 1, 2020

Description:

I added test of internal/config/tls.
And also, I refactored internal/tls for testing

Related Issue:

How Has This Been Tested?:

Environment:

  • Go Version: 1.14.3
  • Docker Version: 19.03.8
  • Kubernetes Version: 1.18.2
  • NGT Version: 1.11.5

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.

@pull-assistant
Copy link

pull-assistant bot commented Jul 1, 2020

Score: 1.00

Best reviewed: commit by commit


Optimal code review plan

     ✅ add internal/config/tls test

     ♻️ refactor internal/tls

     🤖 Update license headers / Format go codes and yaml files

Powered by Pull Assistant. Last update 5f373d9 ... 985b867. Read the comment docs.

@vankichi vankichi requested review from hlts2 and kevindiu July 1, 2020 07:57
@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 1, 2020

[WARNING:INTCFG] Changes in interal/config may require you to change Helm charts. Please check.

@codecov
Copy link

codecov bot commented Jul 1, 2020

Codecov Report

Merging #534 into master will increase coverage by 0.03%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #534      +/-   ##
=========================================
+ Coverage    9.10%   9.13%   +0.03%     
=========================================
  Files         402     402              
  Lines       20831   20846      +15     
=========================================
+ Hits         1896    1905       +9     
- Misses      18681   18688       +7     
+ Partials      254     253       -1     
Impacted Files Coverage Δ
internal/config/tls.go 100.00% <ø> (+100.00%) ⬆️
internal/tls/option.go 0.00% <ø> (-6.25%) ⬇️
internal/tls/tls.go 0.00% <0.00%> (ø)

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 c1c0eab...985b867. Read the comment docs.

@vankichi
Copy link
Contributor Author

vankichi commented Jul 2, 2020

/rebase

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 2, 2020

[REBASE] Rebase triggered by vankichi for branch: test/internal/config-tls

Signed-off-by: vankichi <kyukawa315@gmail.com>
Signed-off-by: vankichi <kyukawa315@gmail.com>
hlts2
hlts2 previously approved these changes Jul 2, 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

if len(w.want) != len(got) {
return errors.Errorf("len(got) = %d, len(want) = %d", len(got), len(w.want))
}
for i := range w.want {
Copy link
Contributor

Choose a reason for hiding this comment

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

😮👍🏿

@@ -23,47 +23,6 @@ type Option func(*credentials) error

var (
defaultOpts = []Option{
WithTLSConfig(&tls.Config{
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we move this block to tls.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To avoid same pointer between want and got in test

kevindiu
kevindiu previously approved these changes Jul 2, 2020
Copy link
Contributor

@kevindiu kevindiu 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
Copy link
Contributor Author

vankichi commented Jul 2, 2020

/rebase
/format
/approve

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 2, 2020

[REBASE] Rebase triggered by vankichi for branch: test/internal/config-tls

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 2, 2020

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

@vdaas-ci vdaas-ci dismissed stale reviews from kevindiu and hlts2 via 985b867 July 2, 2020 02:13
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 vankichi.

@vankichi vankichi merged commit 1104fdc into master Jul 2, 2020
@vankichi vankichi deleted the test/internal/config-tls branch July 2, 2020 02:52
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.

None yet

4 participants