starbasedb icon indicating copy to clipboard operation
starbasedb copied to clipboard

Improve test coverage with Vitest

Open Brayden opened this issue 11 months ago • 9 comments

Is your feature request related to a problem? Please describe. Currently the test coverage of the project is nearly non-existent. We do have and use Vitest as a dependency in the Starbase project already that future tests should also use. The idea is to begin accumulating test coverage throughout the entire project.

Goal is to bring test coverage up to above 75% with meaningful tests.

Describe the solution you'd like Important: Tests should not just be made for line coverage, they should also include meaningful tests that help reveal when issues arise. For example, if we were to write a test for our LiteREST code to see if making a request fetched data we would pass it potentially:

  • a real table name
  • a fake table name
  • no table name (omitted altogether)
  • -1 or null as a value

When PR's are made we run the following Github test action (https://github.com/outerbase/starbasedb/blob/main/.github/workflows/test.yaml) that verifies the project can execute a pnpm i and then run tests with pnpm test. All tests added should be executed during that same pnpm test command.

Describe alternatives you've considered N/A

Additional context N/A

Brayden avatar Jan 23 '25 20:01 Brayden

/bounty $250

Brayden avatar Jan 24 '25 16:01 Brayden

💎 $250 bounty • Outerbase (YC W23)

Steps to solve:

  1. Start working: Comment /attempt #71 with your implementation plan
  2. Submit work: Create a pull request including /claim #71 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 outerbase/starbasedb!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @varshith257 Jan 24, 2025, 4:26:08 PM #74
🟢 @aybanda Jan 24, 2025, 6:00:30 PM #73

algora-pbc[bot] avatar Jan 24 '25 16:01 algora-pbc[bot]

/attempt #71

Algora profile Completed bounties Tech Active attempts Options
@varshith257 25 bounties from 11 projects
Scala, Rust,
TypeScript & more
Cancel attempt

varshith257 avatar Jan 24 '25 16:01 varshith257

/attempt #71

Algora profile Completed bounties Tech Active attempts Options
@aybanda 2 bounties from 2 projects
TypeScript, Python,
Julia & more
Cancel attempt

aybanda avatar Jan 24 '25 18:01 aybanda

@Brayden There are a few bugs in implementations that are getting found during tests. I am fixing them too along with the testing. Could I draft PR?

varshith257 avatar Jan 24 '25 18:01 varshith257

@Brayden There are a few bugs in implementations that are getting found during tests. I am fixing them too along with the testing. Could I draft PR?

You may absolutely fix issues along the way. Feel free to draft a PR @varshith257!

Brayden avatar Jan 24 '25 19:01 Brayden

@Brayden I have opened

  • #74

and fixing few more implementations caught in the way in testing

varshith257 avatar Jan 24 '25 19:01 varshith257

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

algora-pbc[bot] avatar Jan 24 '25 23:01 algora-pbc[bot]

🎉🎈 @varshith257 has been awarded $250! 🎈🎊

algora-pbc[bot] avatar Feb 17 '25 14:02 algora-pbc[bot]