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

Add Proper Unit Test Coverage #12

Open
gemanor opened this issue Oct 28, 2024 · 35 comments · May be fixed by #43
Open

Add Proper Unit Test Coverage #12

gemanor opened this issue Oct 28, 2024 · 35 comments · May be fixed by #43
Labels
💎 Bounty ⚔️ Quest Tracks quest-bot quests

Comments

@gemanor
Copy link
Collaborator

gemanor commented Oct 28, 2024

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
Copy link
Collaborator Author

gemanor commented Oct 28, 2024

/bounty 150

Copy link

algora-pbc bot commented Oct 28, 2024

💎 $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
🔴 @vishwamartur Nov 25, 2024, 5:00:08 PM WIP
🟢 @daveads Nov 29, 2024, 12:38:51 PM WIP
🟢 @Abiji-2020 Nov 29, 2024, 4:15:58 PM #43

Copy link

quest-bot bot commented Oct 28, 2024

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.

@quest-bot quest-bot bot added the ⚔️ Quest Tracks quest-bot quests label Oct 28, 2024
@sachinks07
Copy link

sachinks07 commented Oct 28, 2024

/attempt #12

@varshith257
Copy link

@quest-bot embark

Copy link

quest-bot bot commented Oct 28, 2024

@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
Copy link

@quest-bot embark

Copy link

quest-bot bot commented Oct 28, 2024

@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
Copy link

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
Copy link

varshith257 commented Oct 28, 2024

@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
Copy link

@quest-bot embark

Copy link

quest-bot bot commented Oct 29, 2024

@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.

Copy link

quest-bot bot commented Oct 29, 2024

🧚 @varshith257 has submitted PR #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
Copy link
Collaborator Author

gemanor commented Nov 3, 2024

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

@varshith257
Copy link

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

@varshith257
Copy link

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

@sachinks07
Copy link

@gemanor You can assign to @varshith257

@naaa760
Copy link

naaa760 commented Nov 5, 2024

@quest-bot embark

Copy link

quest-bot bot commented Nov 5, 2024

@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
Copy link

naaa760 commented Nov 5, 2024

/attempt #12

Hello @gemanor :)

I want to work on this issue.
Thank you!

@aegroto
Copy link

aegroto commented Nov 7, 2024

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

@Himasnhu-AT
Copy link

Himasnhu-AT commented Nov 8, 2024

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

Copy link

quest-bot bot commented Nov 20, 2024

🧚 @varshith257 has submitted PR #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.

@vishwamartur
Copy link

vishwamartur commented Nov 25, 2024

/attempt #12

vishwamartur added a commit to vishwamartur/permit-cli that referenced this issue Nov 25, 2024
Related to permitio#12

Add unit tests and integrate Jest for 90% code coverage.

* **Add Jest and Update Configuration**
  - Add Jest as a dev dependency in `package.json`.
  - Update the `test` script to use Jest.
  - Add Jest configuration to `package.json`.

* **Update GitHub Actions Workflow**
  - Add a step to run Jest tests in `.github/workflows/node.js.yml`.
  - Add a step to generate coverage reports.

* **Add Unit Tests**
  - Add unit tests for `ApiKey` component in `source/commands/apiKey.test.tsx`.
  - Add unit tests for `Login` component in `source/commands/login.test.tsx`.
  - Add unit tests for `Logout` component in `source/commands/logout.test.tsx`.
  - Add unit tests for `Policy` component in `source/commands/opa/policy.test.tsx`.
  - Add unit tests for `Check` component in `source/commands/pdp/check.test.tsx`.
  - Add unit tests for `Run` component in `source/commands/pdp/run.test.tsx`.
  - Add unit tests for `AuthProvider` component in `source/components/AuthProvider.test.tsx`.
  - Add unit tests for `PDPCommand` component in `source/components/PDPCommand.test.tsx`.

* **Update Documentation**
  - Add instructions for running tests locally in `README.md`.
  - Add instructions for writing new tests in `README.md`.
@daveads
Copy link

daveads commented Nov 29, 2024

/attempt #12

Algora profile Completed bounties Tech Active attempts Options
@daveads    2 Permitio bounties
+ 7 bounties from 4 projects
Python, Shell,
Go & more
Cancel attempt

@Abiji-2020
Copy link
Contributor

Abiji-2020 commented Nov 29, 2024

/attempt #12

Algora profile Completed bounties Tech Active attempts Options
@Abiji-2020 3 bounties from 2 projects
C++, Java,
TypeScript & more
Cancel attempt

@Abiji-2020
Copy link
Contributor

@quest-bot embark

Copy link

quest-bot bot commented Nov 29, 2024

@Abiji-2020 has embarked on their Quest. 🗡

  • @Abiji-2020 has been on GitHub since 2023.
  • They have merged 190 public PRs in that time.
  • Their swords are blessed with Rust and TypeScript magic ✨
  • They have 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.

@Abiji-2020 Abiji-2020 linked a pull request Nov 29, 2024 that will close this issue
Copy link

quest-bot bot commented Nov 29, 2024

🧚 @Abiji-2020 has submitted PR #43 and is claiming the loot.

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

cc @varshith257
@sachinks07
@Bhavyajain21
@naaa760

Questions? Check out the docs.

Copy link

algora-pbc bot commented Nov 29, 2024

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

@ayimdomnic
Copy link

@quest-bot embark

Copy link

quest-bot bot commented Dec 4, 2024

@ayimdomnic has embarked on their Quest. 🗡

  • @ayimdomnic has been on GitHub since 2013.
  • They have merged 52 public PRs in that time.
  • Their swords are blessed with Rust 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.

@ARYPROGRAMMER
Copy link
Contributor

@quest-bot embark

Copy link

quest-bot bot commented Dec 12, 2024

@ARYPROGRAMMER has embarked on their Quest. 🗡

  • @ARYPROGRAMMER has been on GitHub since 2020.
  • They have merged 42 public PRs in that time.
  • Their swords are blessed with CSS and JavaScript magic ✨
  • They have 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.

Copy link

quest-bot bot commented Dec 12, 2024

🧚 @ARYPROGRAMMER has submitted PR #46 and is claiming the loot.

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

cc @varshith257
@sachinks07
@Bhavyajain21
@Abiji-2020
@naaa760
@ayimdomnic

Questions? Check out the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment