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

[HOLD for payment 2023-11-21] Unified testing utilities for mocks using a fake data generation library #30994

Closed
mountiny opened this issue Nov 7, 2023 · 6 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production NewFeature Something to build that is a new item. Weekly KSv2

Comments

@mountiny
Copy link
Contributor

mountiny commented Nov 7, 2023

Problem

Mocking data with confidence is crucial when developing tests, especially for an offline-first data-driven app. What I saw myself was a lack of predefined mocking strategies, which combined with the poor type-safety led me to a lot of errors and frustration. Each test file (when written by different people over time) had to reinvent the wheel when it comes to working with reports, reportActions, policies and so on.

Solution

By introducing a fake data library (my pick was ngneat/falso - it’s more lightweight and composable than the popular faker module) as a dev dependency we can unify our mocks across the whole project and improve the DX of our teams when testing.

The example below shows whole entities being mocked, but with composition we can also generate useful partials.

@mountiny mountiny added Daily KSv2 NewFeature Something to build that is a new item. labels Nov 7, 2023
@mountiny mountiny self-assigned this Nov 7, 2023
Copy link

melvin-bot bot commented Nov 7, 2023

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Nov 7, 2023
@mountiny
Copy link
Contributor Author

mountiny commented Nov 7, 2023

@adhorodyski can you please comment on this issue?

@lschurr nothing required for this one right now

@adhorodyski
Copy link
Contributor

@mountiny sure thing, I'd like to work on this.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 14, 2023
@melvin-bot melvin-bot bot changed the title Unified testing utilities for mocks using a fake data generation library [HOLD for payment 2023-11-21] Unified testing utilities for mocks using a fake data generation library Nov 14, 2023
Copy link

melvin-bot bot commented Nov 14, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.98-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-11-21. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Nov 14, 2023

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@adhorodyski] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@lschurr] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@mountiny
Copy link
Contributor Author

This is completed, nothing to pay out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production NewFeature Something to build that is a new item. Weekly KSv2
Projects
Development

No branches or pull requests

3 participants