-
-
Notifications
You must be signed in to change notification settings - Fork 797
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
Testing enviornment for Redis Services #2037
Comments
@palisadoes If this is relevant then can we talk on this? |
@Manik2708 Once check @xoldyckk 's message in talawa-admin slack channel. The Redis recently moved away from open-source. maybe a case we have to move to another solution instead of Redis in the near future. |
Like when it is going to happen? Because till then I think we will be needy of tests. Without that code might break! |
Might need guidance from @palisadoes for it |
@palisadoes |
@Manik2708 Check for discussions on redis in Slack, there have been some, maybe it will give you the guidance you need. |
Actually it is not related to Redis, it is related to test Cache Services. Once current Cache Services are tested it will be easy to migrate to a new Caching Database. It will make it less buggy. |
I think we don't need to leave Redis. This PR solves the licence problem: redis/redis#13169 |
This PR was closed just after this comment. I think we can wait for a while before reaching a migration decision. |
It was just for informing Peter, I didn't say anything about needing to replace it. As far as I'm aware, the license doesn't prohibit usage of redis in the way it is used in talawa-api.
Changed my username, thought the new one was more appropriate. |
Ok, thanks a lot for explanation. I think then we can talk on the approach to test Redis Services. |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
@palisadoes Actually from the last week I was searching about DI in node js. I have written test including Redis in one of my personal project https://github.com/Manik2708/Hi_Server/blob/develop/test/Controllers/Confession/Services/send_confession.e2e-spec.ts, but problem is that this project is in Nestjs and it has an OOPs based structure. But unfortunately our Talawa-API is neither in Nest nor have OOPs structure. Also nodejs doesn't have a strong DI library. I was thinking to test Redis Services in this way:
I achieved this in Nestjs, but currently it is nearly impossible to execute this in Nodejs. So either we have ditch tests for redis services for now or we have to migrate from Nodejs+Graphql to Nestjs+Graphql. Another advice from my side is to consider this migration important because as far I know, industries don't use Node js due to it's poor structure. As nodejs code increases, it becomes very difficult to maintain and test the code. |
This is not an area of strength for me. If so the slack channel and / or create a GitHub discussion for this |
@Manik2708 you can have dependency injection using the graphql context. It is available to all resolvers as the third parameter of the resolver function. |
This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue. |
This issue did not get any activity in the past 180 days and thus has been closed. Please check if the newest release or develop branch has it fixed. Please, create a new issue if the issue is not fixed. |
Is your feature request related to a problem? Please describe.
Currently there are no tests written for
src/services
. These services are Cache Services and as project is moving forward, a testing environment for this has to be prepared.Describe the solution you'd like
The solution according to me can be running a testing Redis server on a different port other than standard 6379. Mocking can bypass the tests making them pseudo, hence
e2e
(end-to-end) tests should be performed.Approach to be followed (optional)
tsyringe
. If you have a better alternative to this, feel free to discuss.wait-on
can be used for this.services
so that it is easy for a reviewer to review this PR.Additional context
Only thing which I want to say that if you have any other better approach, the please firstly discuss with maintainers. If possible firstly propose an approach in the issue and then start working.
Potential internship candidates
Please read this if you are planning to apply for a Palisadoes Foundation internship PalisadoesFoundation/talawa#359
The text was updated successfully, but these errors were encountered: