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 internal/errors/mysql.go #918

Merged
merged 7 commits into from
Jan 25, 2021

Conversation

hlts2
Copy link
Collaborator

@hlts2 hlts2 commented Jan 13, 2021

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

Description:

I added the test cases for internal/errors/mysql.go and comments.
And I fixed the test error for parallel testing and existing code to support parallel testing.

Details of fails test

goroutine detecting error occurs when we use t.Parallel and goleak.Verity(tt) in the sub-test.
the goroutine generated by t.Parallel will also be detected by goleak.
So I Changed to use goleak.IgnoreCurrent method and ignore goroutines other than the function under test

grammar check passed

Related Issue:

How Has This Been Tested?:

Environment:

  • Go Version: 1.15.2
  • Docker Version: 19.03.8
  • Kubernetes Version: 1.18.2
  • NGT Version: 1.12.1

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.

@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

Merging #918 (7e07d2a) into master (fa77790) will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #918      +/-   ##
==========================================
+ Coverage   16.08%   16.15%   +0.06%     
==========================================
  Files         476      476              
  Lines       23839    23839              
==========================================
+ Hits         3835     3851      +16     
+ Misses      19763    19748      -15     
+ Partials      241      240       -1     
Impacted Files Coverage Δ
internal/errors/mysql.go 100.00% <ø> (+100.00%) ⬆️
internal/errgroup/group.go 92.42% <0.00%> (-1.52%) ⬇️
internal/worker/worker.go 83.33% <0.00%> (-1.05%) ⬇️

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 153f8d0...7e07d2a. Read the comment docs.

internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
@hlts2 hlts2 requested a review from vankichi January 18, 2021 03:33
@hlts2 hlts2 changed the title [WIP] Add test case for internal/errors/mysql.go Add test case for internal/errors/mysql.go Jan 19, 2021
@hlts2 hlts2 self-assigned this Jan 19, 2021
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
internal/errors/mysql_test.go Outdated Show resolved Hide resolved
vankichi
vankichi previously approved these changes Jan 21, 2021
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

@kevindiu
Copy link
Contributor

/rebase

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-errors-mysql-test

@kevindiu
Copy link
Contributor

/rebase

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-errors-mysql-test

@vdaas-ci vdaas-ci force-pushed the test/internal/add-errors-mysql-test branch from 301019b to 438a29c Compare January 25, 2021 02:42
@kevindiu
Copy link
Contributor

/format
/rebase
/approve

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-errors-mysql-test

@vdaas-ci
Copy link
Collaborator

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

kevindiu
kevindiu previously approved these changes Jan 25, 2021
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

@kevindiu
Copy link
Contributor

/format
/rebase
/approve

@vdaas-ci
Copy link
Collaborator

[REBASE] Rebase triggered by kevindiu for branch: test/internal/add-errors-mysql-test

Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
hlts2 and others added 5 commits January 25, 2021 02:58
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Co-authored-by: Kiichiro YUKAWA <kyukawa315@gmail.com>
@vdaas-ci
Copy link
Collaborator

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

@kevindiu kevindiu merged commit 5df9ec1 into master Jan 25, 2021
@kevindiu kevindiu deleted the test/internal/add-errors-mysql-test branch January 25, 2021 03:14
kpango pushed a commit that referenced this pull request Jan 25, 2021
* feat: add test case and comment

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

* fix: add godoc comment

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

* Apply suggestions from code review

* fix: goleak bug

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

* fix: fails test

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

* Update internal/errors/mysql_test.go

* Apply suggestions from code review

Co-authored-by: Kiichiro YUKAWA <kyukawa315@gmail.com>

Co-authored-by: Kiichiro YUKAWA <kyukawa315@gmail.com>
Signed-off-by: kpango <kpango@vdaas.org>
@vdaas-ci vdaas-ci mentioned this pull request Jan 29, 2021
18 tasks
@kpango kpango mentioned this pull request Feb 2, 2021
11 tasks
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.

4 participants