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 test case for storage/blob/s3/writer/option #656

Merged
merged 20 commits into from
Sep 4, 2020

Conversation

hlts2
Copy link
Contributor

@hlts2 hlts2 commented Aug 31, 2020

Signed-off-by: hlts2 hiroto.funakoshi.hiroto@gmail.com

Description:

I added test cases for option.go and refactored option.go.

Refactor Contents

  • warn output when FOP returns error
  • returns an error when the argument of FOP is invalid.
  • validation logic
    => if we do not notice that the invalid value is set at startup and an error occurs based on UploadWithContext after startup, we will lose our backup data.
  • check type of empty string.
str != "" 
↓
len(str) != 0

Related issue

author review required

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.

@pull-assistant
Copy link

pull-assistant bot commented Aug 31, 2020

@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

@codecov
Copy link

codecov bot commented Aug 31, 2020

Codecov Report

Merging #656 into master will increase coverage by 0.14%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #656      +/-   ##
==========================================
+ Coverage   15.24%   15.39%   +0.14%     
==========================================
  Files         411      412       +1     
  Lines       21578    21598      +20     
==========================================
+ Hits         3290     3324      +34     
+ Misses      18036    18026      -10     
+ Partials      252      248       -4     
Impacted Files Coverage Δ
internal/db/storage/blob/s3/writer/writer.go 0.00% <0.00%> (ø)
internal/errors/option.go 0.00% <0.00%> (ø)
internal/db/storage/blob/s3/writer/option.go 100.00% <100.00%> (+85.71%) ⬆️
internal/worker/worker.go 85.45% <0.00%> (+0.90%) ⬆️

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 1e0c37e...78db402. Read the comment docs.

docs/contributing/coding-style.md Show resolved Hide resolved
docs/contributing/coding-style.md Outdated Show resolved Hide resolved
docs/contributing/coding-style.md Outdated Show resolved Hide resolved
internal/errors/option.go Outdated Show resolved Hide resolved
internal/errors/option.go Outdated Show resolved Hide resolved
docs/contributing/coding-style.md Show resolved Hide resolved
docs/contributing/coding-style.md Show resolved Hide resolved
docs/contributing/coding-style.md Outdated Show resolved Hide resolved
docs/contributing/coding-style.md Outdated Show resolved Hide resolved
docs/contributing/coding-style.md Show resolved Hide resolved
docs/contributing/coding-style.md Outdated Show resolved Hide resolved
docs/contributing/coding-style.md Outdated Show resolved Hide resolved
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.

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Sep 3, 2020

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

vdaas-ci
vdaas-ci previously approved these changes Sep 3, 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 kpango.

@vankichi
Copy link
Contributor

vankichi commented Sep 4, 2020

/rebase
/format
/approve

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Sep 4, 2020

[REBASE] Rebase triggered by vankichi for branch: test/internal/storage_blob_s3_writer_option

hlts2 and others added 20 commits September 4, 2020 03:17
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Co-authored-by: Kevin Diu <kevin_diu@yahoo.com.hk>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
@vdaas-ci vdaas-ci force-pushed the test/internal/storage_blob_s3_writer_option branch from 04e8805 to 78db402 Compare September 4, 2020 03:17
@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Sep 4, 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 755d9c0 into master Sep 4, 2020
@vankichi vankichi deleted the test/internal/storage_blob_s3_writer_option branch September 4, 2020 04: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