permitio / permit-cli

A command line utility from Permit.io to work with everything IAM and Authorization. A one-stop-shop to manage all your Authorization tools (OPA, OpenFGA, Cedar, OPAL, AVP...) as well as the Permit Service.
20 stars 27 forks source link

Add Proper Unit Test Coverage #12

Open gemanor opened 3 weeks ago

gemanor commented 3 weeks ago

This issue is about getting to 90% coverage for the Permit CLI. The current tests use only Node test runner and do not pass completely, so the task is also to stabilize the tests and choose the right tooling for efficient unit test writing.

Acceptance Criteria:

gemanor commented 3 weeks ago

/bounty 150

algora-pbc[bot] commented 3 weeks ago

💎 $150 bounty • Permit.io

Steps to solve:

  1. Start working: Comment /attempt #12 with your implementation plan
  2. Submit work: Create a pull request including /claim #12 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to permitio/permit-cli!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @sachinks07 Oct 28, 2024, 4:30:38 PM WIP
🟢 @naaa760 Nov 5, 2024, 11:08:17 AM WIP
🟢 @varshith257 #34
quest-bot[bot] commented 3 weeks ago

New Quest! image New Quest!

A new Quest has been launched in @permitio’s repo. Merge a PR that solves this issue to loot the Quest and earn your reward.


Loot of 250 USD has been stashed in this issue to reward the solver!

🗡 Comment @quest-bot embark to check-in for this Quest and start solving the issue. Other solvers will be notified!

⚔️ When you submit a PR, comment @quest-bot loot #12 to link your PR to this Quest.

Questions? Check out the docs.

sachinks07 commented 3 weeks ago

/attempt #12

varshith257 commented 3 weeks ago

@quest-bot embark

quest-bot[bot] commented 3 weeks ago

@varshith257 has embarked on their Quest. 🗡

  • @varshith257 has been on GitHub since 2022.
  • They have merged 65 public PRs in that time.
  • Their swords are blessed with Python and Shell magic ✨
  • They haven't contributed to this repo before.

This is not an assignment to the issue. Please check the repo’s contribution guidelines before submitting a PR.

Questions? Check out the docs.

sachinks07 commented 3 weeks ago

@quest-bot embark

quest-bot[bot] commented 3 weeks ago

@sachinks07 has embarked on their Quest. 🗡

  • @sachinks07 has been on GitHub since 2021.
  • They have merged 14 public PRs in that time.
  • Their swords are blessed with CSS and HTML magic ✨
  • They haven't contributed to this repo before.

This is not an assignment to the issue. Please check the repo’s contribution guidelines before submitting a PR.

Questions? Check out the docs.

Neptune650 commented 3 weeks ago

This issue is about getting to 90% coverage for the Permit CLI. The current tests use only Node test runner and do not pass completely, so the task is also to stabilize the tests and choose the right tooling for efficient unit test writing.

Acceptance Criteria:

* Consistlenlty passed unit tests that cover 90% of the code in the repository by the time of starting work on the issue

* Well-documented explanation of how to run and write the tests on the home page

@gemanor How do you feel about using Jest for the tests, if we use it, I can start working on this right away. Also should we also use something like Codecov together with Jest for ensuring coverage, or just Jest with GitHub Actions is fine?

varshith257 commented 3 weeks ago

@Neptune650 I have done progress on it integrating Jest. Just left with the task of increasing code coverage. Increases to 70 till now :)

PS: Updated progress so that we don't make duplicate efforts IMAO

Bhavyajain21 commented 3 weeks ago

@quest-bot embark

quest-bot[bot] commented 3 weeks ago

@Bhavyajain21 has embarked on their Quest. 🗡

  • @Bhavyajain21 has been on GitHub since 2020.
  • They have merged 31 public PRs in that time.
  • Their swords are blessed with JavaScript and CSS magic ✨
  • They haven't contributed to this repo before.

This is not an assignment to the issue. Please check the repo’s contribution guidelines before submitting a PR.

Questions? Check out the docs.

quest-bot[bot] commented 3 weeks ago

🧚 @varshith257 has submitted PR https://github.com/permitio/permit-cli/issues/23 and is claiming the loot.

Keep up the pace, or you'll be left in the shadows.

cc @Bhavyajain21 @sachinks07

Questions? Check out the docs.

gemanor commented 2 weeks ago

Seems like @varshith257 is the only one working on it. @sachinks07 are you planning to submit something or can I assign @varshith257

varshith257 commented 2 weeks ago

@gemanor I think you an assign me. I have already covered good coverage of 85% as of now

varshith257 commented 2 weeks ago

I think there are few bugs in login.tsx and policy.tsx, I think there needed fixes

sachinks07 commented 2 weeks ago

@gemanor You can assign to @varshith257

naaa760 commented 2 weeks ago

@quest-bot embark

quest-bot[bot] commented 2 weeks ago

@naaa760 has embarked on their Quest. 🗡

  • @naaa760 has been on GitHub since 2024.
  • They have merged 3 public PRs in that time.
  • Their swords are blessed with Shell and JavaScript magic ✨
  • They haven't contributed to this repo before.

This is not an assignment to the issue. Please check the repo’s contribution guidelines before submitting a PR.

Questions? Check out the docs.

naaa760 commented 2 weeks ago

/attempt #12

Hello @gemanor :)

I want to work on this issue. Thank you!

aegroto commented 2 weeks ago

Is there any work left on tests? I am willing to contribute if needed.

Himasnhu-AT commented 1 week ago

hey @gemanor, is this issue still open, else i can work on it, as no-one is assigned to it is it okay if we use jest, as its in typescript, that would be best, according to me. Its even use in NestJS. They provide unit, integratin and end to end test which we can execute, with built in coverage checker and nice terminal UI

Few resource on how these test case looks: https://github.com/Himasnhu-AT/scrapi/blob/main/apps/backend/libs/fetch/src/scrappers/axios.scrapper.spec.ts

Let me know your views on it

algora-pbc[bot] commented 1 day ago

💡 @varshith257 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

quest-bot[bot] commented 1 day ago

🧚 @varshith257 has submitted PR https://github.com/permitio/permit-cli/issues/34 and is claiming the loot.

Keep up the pace, or you'll be left in the shadows.

cc @Bhavyajain21 @naaa760 @sachinks07

Questions? Check out the docs.