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

Address quoting-service setImmediate calls in unit testing #1027

Closed
16 of 31 tasks
elnyry-sam-k opened this issue Oct 22, 2019 · 2 comments
Closed
16 of 31 tasks

Address quoting-service setImmediate calls in unit testing #1027

elnyry-sam-k opened this issue Oct 22, 2019 · 2 comments
Assignees
Labels
Milestone

Comments

@elnyry-sam-k
Copy link
Member

elnyry-sam-k commented Oct 22, 2019

Goal:

As a ML OSS code-base maintainer
I want to address issues in quoting-service that impede adding robust unit tests
so that the code-quality needed for quoting-service can be achieved and maintaned

Tasks:

  • Address quoting-service setImmediate calls in unit testing [@ggrg]
    • Discuss within team the right approach: native jest.runAllImmediates() does the job [@ggrg]
    • Rewrite test/unit/model/quotes.test.js to fully test underlying model/quotes.js (100% coverage)
      • validateQuoteRequest [@ggrg] (100%)
      • validateQuoteUpdate [@ggrg] (100%)
      • handleQuoteRequest [@ggrg] (100%)
      • forwardQuoteRequest [@ggrg] (100%)
      • handleQuoteRequestResend [@ggrg] (100%)
      • handleQuoteUpdate [@ggrg] (only provided sample QuotesIDPutResponse)
      • forwardQuoteUpdate
      • handleQuoteUpdateResend
      • handleQuoteError
      • handleQuoteGet
      • forwardQuoteGet
      • handleException
      • sendErrorCallback
      • checkDuplicateQuoteRequest
      • checkDuplicateQuoteResponse
      • removeEmptyKeys
      • calculateRequestHash
      • generateRequestHeaders
      • writeLog

Acceptance Criteria:

  • Use jest testing framework
    • Use native jest stubs (not Sinon)
    • Use jest.runAllImmediates() to cover code whitin setImmediate() calls
    • Use jest Matchers to ensure unit tests quality
    • Achieve 100% coverage for model/quotes.js to put the foundation of jest testing for quotes
  • Unit Tests pass
  • Changes made to config (default.json) are broadcast to team and follow-up tasks added to update helm charts and other deployment config.
  • Issues with setImmediate calls in quoting-service are addressed to help better develop unit tests

Pull Requests:

Follow-up:

Dependencies:

  • N/A

Accountability:

  • Owner: TBC
  • QA/Review: TBC
@ggrg ggrg self-assigned this Oct 28, 2019
@elnyry-sam-k elnyry-sam-k added this to the Sprint 8.4 milestone Oct 29, 2019
@ggrg
Copy link
Member

ggrg commented Oct 29, 2019

According to the latest story acceptance criteria edit, the story estimate needs to change (or reverted back) - to be discussed during the daily. Current progress is 33% and it consists of ~670 lines of code. The estimate for this single file is ~2000 lines of code for 100% tests coverage.

@elnyry-sam-k
Copy link
Member Author

@ggrg I think this issue should be about directly addressing the issue and not coverage. We should update that criteria and move forward with this story.

@ggrg ggrg closed this as completed Oct 31, 2019
@kjw000 kjw000 changed the title Address quoting-service setImmediate calls in unit testing Address quoting-service settlement calls in unit testing Nov 4, 2019
@ggrg ggrg changed the title Address quoting-service settlement calls in unit testing Address quoting-service setImmediate calls in unit testing Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants