Open jwala-anirudh opened 1 year ago
I didn't see Jest in package.json should I install it? And for the Integration test can I use a superset npm package
Hi @Tusharjagi,
Thank you for your interest towards contributing to FreeApi.app currently the test suite setup is under progress. We are commiting the code under branch feat/coverage
branch.
You can add jest, supertest & update the test script in package.json
I am also expecting to have a babel configuration json file that will include the presets & plugins necessary for the project. You can start with the base healthcheck API endpoint with a base test case for it to expect 200 as status code on making async call.
I would see this as a good starting point for our enhancement
Sure @jwala-anirudh I will investigate it, Firstly I need to understand the code base, and then I will raise a PR for it, If I have another query I will reach out to you ...
how about playwright?
Any update on this one? playwright seems a good option.
Alright, let me get started with playwright then 👍🏻 Thanks Shubham & Ranga
Hello @jwala-anirudh ,
I have one question why we are using playwright for api testing as per my understanding it's used E2E testing for web apps
can you explain bit more how we are going to add unit test using playwright or i'm missing something ??
@shrey-dadhaniya Yes the Playwright is more favourable for browser based E2E tests but it also provides an API testing module which I think is enough for our use case and has really simple apis to just do high level testing.
We could've gone for something like Jest or Mocha but our main focus is on business logic and working on the core functionality rather than robust testing.
However, we understand that doing testing is best practice and it eliminates manual testing work upon doing some major changes.
Playwright API testing reference: https://playwright.dev/docs/api-testing
@jwala-anirudh correct me if I'm wrong
Thanks!
@wajeshubham Thanks. @jwala-anirudh can you update here once you finish with setup so i can start with basic and easy tests. meanwhile i will go through playwright documents for api testing.
@shrey-dadhaniya available on feat/coverage
branch, we look forward for your contributions
Thanks!
@jwala-anirudh, @wajeshubham,
I have started adding test cases I want to make sure i'm going in right direction. I'm using mongodb-memory-server to connect mongodb and playwrite to test apis please check commit. commit is under development but i want your opinion on this. feel free to give you opinion.
Thanks!
@shrey-dadhaniya why do you have yarn-lock and package-lock in the commit? should'nt you be using only one package manager
@shrey-dadhaniya why do you have yarn-lock and package-lock in the commit? should'nt you be using only one package manager
yes, you are right. it's just draft commit i will remove yarn-lock file in final commit. The goal for that commit that i'm using playwright correctly or not. the way we decided erilier. once we lock that I will start actual development and then i will remove unnecessary code and files
Thanks for reviewing my code @theunhackable, I really appreciate that 😇
Hello @jwala-anirudh , @wajeshubham,
I think we should devide this issue in to multiple smaller issues or PR because it is time consuming task and we can not wait untill everything in done.
My suggestion is we can devide like 1) front-end
once core setup is done for BE and FE then multiple developers can work separately on different apps
what are your suggestions?
Thanks.
@shrey-dadhaniya This issue is only targeting backend testing and that too on a higher level. We are not focusing on the front-end testing as it will be done by the contributors creating the front-end apps which is optional.
@wajeshubham Okay.we can still divide BE test cases into multiple PRs. what you think?
1) first core setup 2) todo app test 3) social media app test 4) e-commerce app test 5) chat app test ...
@shrey-dadhaniya That is right, we expect this to be delivered in multiple PRs rather than one.
@jwala-anirudh how we want to proceed? I will rais PR for master branch ? and what about git workflow I suggest we should add workflow that run test when anyone create PR. what is your input ?
@shrey-dadhaniya Let's first start with the testing. Workflows and pipelines we can implement later. Also, please read the contribution guide, we have mentioned everything regarding how to contribute there.
Thanks
@wajeshubham yes right but my question is we have already branch feat/coverage that is created by someone my code is dependent on that branch
i can create one branch where i setup playwright and add test case for health function then we merge that branch to master and then we can proceed with app wise PR
what you suggest?
Ok, raise PR to the feat/coverage branch.
Todo and health check is done now I think i should take more easy app to test so i'm thinking to add Database Seeding feature
@wajeshubham, @jwala-anirudh give me green flag and i will start working on that
Yes you can proceed! cc: @jwala-anirudh
Hi @jwala-anirudh, PR #81 has been merged. Just a reminder to ensure that this branch is prepared for merging into the main
branch. Additionally, we'll need to update the README.md
to include testing-related instructions. Please let me know if you need any assistance from my side.
what is next we decide to merge master branch and then will continue to add test for other apps and also update readme.
how we are going to proceed from here?
@jwala-anirudh @wajeshubham please advise
Hello, anyone working on this? I'm planning to start with authentication test cases.
@wajeshubham give me green flag to start work
Sounds good @shrey-dadhaniya - you can start, please open a draft PR once you complete 50% of work
Background
FreeApi.app as of today doesn't come with any test cases writtern for the application. I want to keep this as a open issue until we reach the goal of 50% coverage in phase 1.
Phase 2 would be to reach min code coverage of 80% for every subsequent release.
Plan
Outcome
Additional information
We will not be closing this issue until the stated Phases are achieved. Until then all are welcomed to contribute