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/worker/worker test #602

Merged
merged 16 commits into from
Aug 7, 2020
Merged

Add internal/worker/worker test #602

merged 16 commits into from
Aug 7, 2020

Conversation

kevindiu
Copy link
Contributor

@kevindiu kevindiu commented Jul 29, 2020

Author review required.

Description:

This PR includes the following changes:

  • implements internal/worker test code
  • create test/comparator package and implement go-cmp comparator
  • missing close(ech) in startJobLoop()

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 Jul 29, 2020

Score: 0.80

Best reviewed: commit by commit


Optimal code review plan (6 warnings)

add test

internal/worker/worker_test.go 42% changes removed in fix

create comparator

...al/test/comparator/standard.go 40% changes removed in comment unused code

internal/worker/worker_test.go 42% changes removed in fix

add test

internal/worker/worker.go 69% changes removed in revert changes and u...

remove unused code

internal/worker/worker.go 93% changes removed in fix

     update comment

do not use comparator

internal/worker/worker_test.go 77% changes removed in fix

     comment unused code

fix

...al/test/comparator/standard.go 50% changes removed in revert changes and u...

     fix

     fix

     revert changes and use alias for go-cmp

     fix

     fix

     🤖 Update license headers / Format go codes and yaml files

     fix Makefile

     fix

Powered by Pull Assistant. Last update c0cd3b4 ... ad07b1b. Read the comment docs.

@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 Jul 29, 2020

Codecov Report

Merging #602 into master will decrease coverage by 0.28%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #602      +/-   ##
==========================================
- Coverage   13.22%   12.94%   -0.29%     
==========================================
  Files         409      405       -4     
  Lines       21516    21294     -222     
==========================================
- Hits         2846     2757      -89     
+ Misses      18393    18264     -129     
+ Partials      277      273       -4     
Impacted Files Coverage Δ
internal/worker/worker_option.go
internal/worker/queue.go
internal/worker/queue_option.go

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 2e2581b...ad07b1b. Read the comment docs.

internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/queue_mock_test.go Show resolved Hide resolved
internal/worker/queue_mock_test.go Show resolved Hide resolved
internal/worker/queue_mock_test.go Show resolved Hide resolved
internal/worker/queue_mock_test.go Show resolved Hide resolved
internal/worker/worker_test.go Show resolved Hide resolved
@kevindiu kevindiu requested a review from hlts2 July 30, 2020 01:27
@kevindiu
Copy link
Contributor Author

/rebase

@vdaas-ci
Copy link
Collaborator

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

@kevindiu
Copy link
Contributor Author

/rebase

@vdaas-ci
Copy link
Collaborator

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

@kevindiu kevindiu requested a review from hlts2 August 3, 2020 01:45
internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/worker.go Outdated Show resolved Hide resolved
internal/worker/worker.go Outdated Show resolved Hide resolved
@kevindiu
Copy link
Contributor Author

kevindiu commented Aug 3, 2020

/rebase

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Aug 3, 2020

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

internal/worker/worker.go Outdated Show resolved Hide resolved
@kevindiu kevindiu requested a review from rinx August 5, 2020 09:39
rinx
rinx previously approved these changes Aug 5, 2020
@vankichi
Copy link
Contributor

vankichi commented Aug 6, 2020

/rebase
/format
/approve

@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Aug 6, 2020

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

@vdaas-ci vdaas-ci dismissed stale reviews from rinx, vankichi, and hlts2 via ad07b1b August 6, 2020 09:32
@vdaas-ci
Copy link
Collaborator

vdaas-ci commented Aug 6, 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.

Copy link
Collaborator

@kpango kpango left a comment

Choose a reason for hiding this comment

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

LGTM

@kpango kpango merged commit 0d955e9 into master Aug 7, 2020
@kpango kpango deleted the test/internal/worker branch August 7, 2020 00:57
@vdaas-ci vdaas-ci mentioned this pull request Sep 2, 2020
18 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.

6 participants