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

Chore.throw error in mock #6336

Merged
merged 2 commits into from
Jan 6, 2025
Merged

Conversation

RubenGeo
Copy link
Contributor

@RubenGeo RubenGeo commented Dec 24, 2024

AB#32398

Describe your changes

First merge in #6335

  • We had an error on main where tried to post this transfer amount to intersolve 1626.0000000000002
    • This was caused by a floating point error
    • To fix this I added a math.round() to ensure that we always post an integer
  • I want to prevent that we reintroduce this error again in the future
  • So I added to our mock service that it throws an error if you call it using a non-integer
    • Since floating point errors do not appear in a consistent way it's not straight forward to create an automated test for this
    • But I think if we re-introduce this error again it will appear in our k6 tests this way
  • I also do not want to spend too much time on this..
  • What do you think @Reviewer

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added tests wherever relevant
  • I have made sure that all automated checks pass before requesting a review
  • I do not need any deviation from our PR guidelines

@Copilot Copilot bot review requested due to automatic review settings December 24, 2024 09:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

services/121-service/src/payments/fsp-integration/intersolve-visa/intersolve-visa.api.service.ts:450

  • Ensure that the rounding behavior is covered by tests.
const amountInCent = Math.round(amountInMajorUnit * 100);

@RubenGeo RubenGeo added the chore Something that does not affect the end user label Dec 24, 2024
Ruben and others added 2 commits January 6, 2025 13:15
…rsolve-visa.mock.service.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@PeterSmallenbroek PeterSmallenbroek enabled auto-merge (squash) January 6, 2025 12:16
@PeterSmallenbroek PeterSmallenbroek merged commit 7efb54a into main Jan 6, 2025
6 checks passed
@PeterSmallenbroek PeterSmallenbroek deleted the chore.throw-error-in-mock branch January 6, 2025 12:27
Piotrk39 pushed a commit that referenced this pull request Jan 9, 2025
* Throw error in mock visa on floating error

* Update services/mock-service/src/fsp-integration/intersolve-visa/intersolve-visa.mock.service.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ruben <vandervalk@geoit.nl>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Something that does not affect the end user
Development

Successfully merging this pull request may close these issues.

2 participants