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

internal/tls test #485

Merged
merged 34 commits into from
Jul 9, 2020
Merged

internal/tls test #485

merged 34 commits into from
Jul 9, 2020

Conversation

kevindiu
Copy link
Contributor

@kevindiu kevindiu commented Jun 18, 2020

Just in case I think we need author review for the tls/tls.go file.

Description:

This PR implements the test case of internal/tls package.
The test coverage is 93%. The missing test case is as the follow:

  1. Option will never return error so for example tls.go:48 cannot be covered.
  2. no error return from x509.SystemCertPool() call so tls.go:113 cannot be covered.

It also include the new package implementation called test to get the test data path.

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.

@kevindiu
Copy link
Contributor Author

/rebase

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/tls

internal/tls/tls_test.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 18, 2020

Codecov Report

Merging #485 into master will increase coverage by 0.37%.
The diff coverage is 82.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #485      +/-   ##
==========================================
+ Coverage    9.79%   10.17%   +0.37%     
==========================================
  Files         402      403       +1     
  Lines       20859    20874      +15     
==========================================
+ Hits         2044     2124      +80     
+ Misses      18558    18490      -68     
- Partials      257      260       +3     
Impacted Files Coverage Δ
internal/cache/gache/gache.go 0.00% <0.00%> (ø)
internal/cache/gache/option.go 0.00% <0.00%> (-6.67%) ⬇️
internal/test/testdata.go 72.72% <72.72%> (ø)
internal/tls/option.go 100.00% <100.00%> (+100.00%) ⬆️
internal/tls/tls.go 84.78% <100.00%> (+84.78%) ⬆️

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 845c43e...5e2c0c5. Read the comment docs.

internal/tls/tls_test.go Outdated Show resolved Hide resolved
internal/tls/tls_test.go Outdated Show resolved Hide resolved
internal/tls/tls_test.go Outdated Show resolved Hide resolved
internal/tls/tls_test.go Outdated Show resolved Hide resolved
internal/tls/tls_test.go Outdated Show resolved Hide resolved
@kevindiu
Copy link
Contributor Author

/rebase

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/tls

internal/tls/tls_test.go Outdated Show resolved Hide resolved
internal/tls/tls_test.go Outdated Show resolved Hide resolved
@kevindiu
Copy link
Contributor Author

/rebase

internal/tls/tls_test.go Outdated Show resolved Hide resolved
@kevindiu
Copy link
Contributor Author

/rebase

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/tls

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/tls

hlts2
hlts2 previously approved these changes Jun 18, 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.

thank you for your PR.
LGTM

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 9, 2020

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

vdaas-ci
vdaas-ci previously approved these changes Jul 9, 2020
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.

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.

/rebase
/format
/approve

@vankichi
Copy link
Contributor

vankichi commented Jul 9, 2020

/format
/approve

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Jul 9, 2020

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

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 a697749 into master Jul 9, 2020
@vankichi vankichi deleted the test/internal/tls branch July 9, 2020 06:29
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