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

Feature: Generate Mocks Per Service #1993

Closed
14 tasks done
rodneyosodo opened this issue Dec 7, 2023 · 1 comment
Closed
14 tasks done

Feature: Generate Mocks Per Service #1993

rodneyosodo opened this issue Dec 7, 2023 · 1 comment
Assignees
Milestone

Comments

@rodneyosodo
Copy link
Member

rodneyosodo commented Dec 7, 2023

Is your feature request related to a problem? Please describe.

The problem we are currently having is that we write mocks for interfaces ourselves which might be cumbersome and had to maintain especially for SDK.

Describe the feature you are requesting, as well as the possible use case(s) for it.

Instead of writing down each mock for individual interfaces use https://github.com/vektra/mockery or https://github.com/uber-go/mock to generate mocks for interfaces. This will be instrumental in testing. This is quite useful for services depending on the SDK for example, bootstrap and certs service. This approach simplifies the testing process as initially, one would need to generate the things services, then the things server and finally use the things server URL on the SDK. This effective means that when testing other services you inherently test services that depend on the SDK which is not ideal. With SDK mocks you can mock the SDK rather than mocking dependent services.

Indicate the importance of this feature to you.

Nice-to-have

Anything else?

Initial work is done at https://github.com/absmach/magistrala-old/pull/127

Procedure

Service/modules which have no mocks before

  • ws
  • opcua
  • coap
  • logger
  • internal
@dborovcanin dborovcanin transferred this issue from another repository Jan 10, 2024
@dborovcanin dborovcanin added this to the S1 milestone Mar 20, 2024
@arvindh123 arvindh123 moved this from Backlog to Todo in SuperMQ Mar 25, 2024
@arvindh123 arvindh123 moved this from Todo to In Progress in SuperMQ Mar 25, 2024
@dborovcanin
Copy link
Collaborator

Due to the complexity of tests changes, we will update one service mock at a time. @nyagamunene @JeffMboya @arvindh123 Please comment here which services we need, and create issues out of that list. We must finish it by the end of S2.

@dborovcanin dborovcanin modified the milestones: S1, S2 Apr 3, 2024
@JeffMboya JeffMboya moved this from In Progress to 🧪 Review and testing in progress in SuperMQ Apr 15, 2024
@arvindh123 arvindh123 moved this from 🧪 Review and testing in progress to In Progress in SuperMQ Apr 16, 2024
@dborovcanin dborovcanin modified the milestones: S2, S3 Apr 17, 2024
@JeffMboya JeffMboya moved this from In Progress to 🧪 Review and testing in progress in SuperMQ Apr 19, 2024
@arvindh123 arvindh123 moved this from 🧪 Review and testing in progress to Done in SuperMQ Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants