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

token bucket unit tests and redesign (DI of timer function) #692

Merged
merged 12 commits into from
Jul 2, 2019

Conversation

leodido
Copy link
Member

@leodido leodido commented Jun 25, 2019

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area engine
/area rules

What this PR does / why we need it:

The goal of this PR is to introduce an initial set of unit tests for the existing code surface.

Which issue(s) this PR fixes:

Refs #691

Special notes for your reviewer:

This PR introduces the unit test of token_bucket class via Catch2 framework for unit testing.
It also introduces the fakeit framework for mocking, stubbing, and spying capabilities.
Furthermore it redesigns the token_bucket class decoupling the timer function via classical DI (dependency injection) approach.

Does this PR introduce a user-facing change?:

introducing unit testing via Catch2 framework

@leodido
Copy link
Member Author

leodido commented Jun 25, 2019

/hold

@mstemm
Copy link
Contributor

mstemm commented Jun 27, 2019

I'd suggest splitting any PR to add unit tests from a PR that adds formatting changes.

leodido and others added 11 commits July 2, 2019 12:24
Co-Authored-by: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
Co-Authored-by: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
Co-authored-by: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
Co-Authored-by: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
Co-Authored-by: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
Co-Authored-By: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
Co-Authored-By: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
Co-authored-by: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
Co-Authored-By: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
Co-authored-by: Leonardo Di Donato <[email protected]>
Signed-off-by: Lorenzo Fontana <[email protected]>
Co-Authored-By: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
Co-Authored-By: Lorenzo Fontana <[email protected]>
Signed-off-by: Leonardo Di Donato <[email protected]>
@leodido leodido changed the title wip: initial tests initial unit tests setup via catch2 framework (+ fakeit for mocking/stubbing/spying) Jul 2, 2019
@poiana
Copy link
Contributor

poiana commented Jul 2, 2019

LGTM label has been added.

Git tree hash: 93b40ccb1809c0c81d6e710fa05155281be269de

@poiana
Copy link
Contributor

poiana commented Jul 2, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fntlnz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana added the approved label Jul 2, 2019
@leodido leodido changed the title initial unit tests setup via catch2 framework (+ fakeit for mocking/stubbing/spying) token bucket unit tests and redesign (DI of timer function) Jul 2, 2019
@leodido
Copy link
Member Author

leodido commented Jul 2, 2019

/hold cancel

@fntlnz fntlnz merged commit 5fdf658 into dev Jul 2, 2019
@poiana poiana deleted the feat/initial-tests branch July 2, 2019 15: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.

4 participants