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

[TESTS] Implement Mocking where needed #16

Open
4 tasks
paulotruta opened this issue Jun 13, 2021 · 0 comments
Open
4 tasks

[TESTS] Implement Mocking where needed #16

paulotruta opened this issue Jun 13, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@paulotruta
Copy link
Member

Using mocking to be able to test some of the functions in modules that depend on dynamic functionality (measuring available disks and disk sizes, getting a list of running apps, etc).

This is an iteration on our efforts to provide complete app testing.

There are two types of mocking we will be interested in doing:

  • function return mocking, which mocks the return value of a function, be it internally or in external dependencies / apis. This can be achieve through clever implementation of Interfaces in Golang. More information about Interfaces here, and a tutorial on mocking using Interfaces here.
  • DB call mocking, that we can leverage to simulate the existence of various states within the application. [MORE INFORMATION AND REFERENCES NEEDED HERE]

Some task guidelines for a PR:

  • Implement interfaces for mocking data that is called within storage.getDevicesSpaceUsage and storage.getDevices.
  • Reliably test all branches of those functions
  • Gather information about what in the codebase can benefit from this approach
  • Research DB call mocking to test edgeapps.go
@paulotruta paulotruta added enhancement New feature or request help wanted Extra attention is needed labels Jun 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant