ubiquity / ubiquibot

Putting the 'A' in 'DAO'
https://github.com/marketplace/ubiquibot
MIT License
16 stars 59 forks source link

Unit Test Coverage Workflow #853

Closed rndquu closed 4 months ago

rndquu commented 9 months ago

There's a pretty big technical debt in the bot's codebase (lack of unit tests, not optimally structured code, etc...). We can't ship new production builds any more without breaking an existing functionality.

We should setup a unit testing workflow and stop accepting PRs without unit tests and docs. This will cut down 80% of bounty hunters but the rest will write structured and maintainable code.

What should be done: ~~1. Setup jest in the bot's project

  1. Add a single test
  2. Add a script that runs unit tests in package.json~~
  3. Add a workflow that runs unit tests on PRs and pushes to the development branch
  4. Add a workflow that fails if test coverage has decreased in a PR compared to the development branch (as far as I remember we can simply authorize coveralls OAuth app in the bot's repository which brings this functionality out of the box)

@ubiquity/software-development Your input is really appreciated.

0x4007 commented 9 months ago

not optimally structured code,

Handling this at https://github.com/ubiquity/ubiquibot/pull/644

As for tests, @whilefoo produced some e2e tests already which I merged in and used a few times before redoing all of the code. I'll certainly make sure to get that back up and running before merging my refactor.

ubiquibot[bot] commented 9 months ago

Permit generation skipped because the issue was not closed as completed

If you've enjoyed your experience in the DevPool, we'd appreciate your support. Follow Ubiquity on GitHub and star this repo. Your endorsement means the world to us and helps us grow!
We are excited to announce that the DevPool and UbiquiBot are now available to partners! Our ideal collaborators are globally distributed crypto-native organizations, who actively work on open source on GitHub, and excel in research & development. If you can introduce us to the repository maintainers in these types of companies, we have a special bonus in store for you!

rndquu commented 9 months ago

@pavlovcik This issue also implied adding 2 workflows: running unit tests and checking test coverage for PRs. You sure we don't need those workflows? I don't think we should close this issue as not planned.

PhantomCracker commented 9 months ago

/start

ubiquibot[bot] commented 9 months ago

Deadline Mon, 16 Oct 2023 20:46:24 UTC
Registered Wallet 0xCAC0A8cF4cc7073b040c7fe6328Da7f229AF40A6

Tips:

ubiquibot[bot] commented 8 months ago

Do you have any updates @PhantomCracker? If you would like to release the bounty back to the DevPool, please comment /stop Last activity time: Mon Oct 16 2023 18:46:17 GMT+0000 (Coordinated Universal Time)

ubiquibot[bot] commented 8 months ago

@PhantomCracker - Releasing the bounty back to dev pool because the allocated duration already ended! Last activity time: Mon Oct 16 2023 18:46:17 GMT+0000 (Coordinated Universal Time)

gentlementlegen commented 4 months ago

@rndquu I can have a look if you want, since I've been settings tests in the other repos. However, we did not set the blockage on coverage decrease anywhere yet.

0x4007 commented 4 months ago

@rndquu I can have a look if you want, since I've been settings tests in the other repos. However, we did not set the blockage on coverage decrease anywhere yet.

I think that anything related to this codebase, unless it's strictly event handler related, is not a good idea to invest into.

That's why we actually removed this codebase from the directory.

As you know we plan to move to using the kernel asap.

@whilefoo how's it coming along to get it deployed?

rndquu commented 4 months ago

@rndquu I can have a look if you want, since I've been settings tests in the other repos. However, we did not set the blockage on coverage decrease anywhere yet.

Thank for your endeavour

I think this issue should be closed as "not planned" since we're moving to the plugin oriented architecture

ubiquibot[bot] commented 4 months ago
# Issue was not closed as completed. Skipping.