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

Unit Testing #176

Closed
0x4007 opened this issue Mar 7, 2023 · 14 comments
Closed

Unit Testing #176

0x4007 opened this issue Mar 7, 2023 · 14 comments

Comments

@0x4007
Copy link
Member

0x4007 commented Mar 7, 2023

We should set up basic unit tests and iterate towards more sophisticated ones.

  • Setup jest for the project
  • Add basic tests for the commands listed on the help menu.
  • Add a new script to the package.json that runs unit tests
  • Add unit tests execution to a CI workflow (perhaps to the "Build" workflow)
@sweetapplepumpkinpie
Copy link
Contributor

sweetapplepumpkinpie commented Jun 8, 2023

/start

@ubiquibot
Copy link

ubiquibot bot commented Jun 8, 2023

@sweetapplepumpkinpie The time limit for this bounty is on Thu, 15 Jun 2023 03:09:45 GMT

Your currently set address is:
0xceb35ce20527b4371f0a9a72f0a1a133075e4aef
please use /wallet 0x4FDE...BA18 if you want to update it.

@0x4007
Copy link
Member Author

0x4007 commented Jun 8, 2023

Good luck @sweetapplepumpkinpie I have a feeling that this one might be quite complicated.

@sweetapplepumpkinpie
Copy link
Contributor

Thanks @pavlovcik. will complete this asap

@sweetapplepumpkinpie
Copy link
Contributor

sweetapplepumpkinpie commented Jun 16, 2023

Sorry for the late start. I just thought that I would continue after the last issue is closed.
So the basic unit tests should cover all of the project? @pavlovcik

@0x4007
Copy link
Member Author

0x4007 commented Jun 18, 2023

The purpose of this bounty is more to set up a foundation so they can be just a few simple ones.

@molecula451
Copy link
Member

molecula451 commented Jul 15, 2023

/start

@ubiquibot
Copy link

ubiquibot bot commented Jul 15, 2023

Deadline Sat, 22 Jul 2023 23:03:00 GMT
Registered Wallet 0x4D0704f400D57Ba93eEa88765C3FcDBD826dCFc4
Payment Multiplier 1.00
Multiplier Reason
Total Bounty 900 USD
Tips:
  • Use /wallet 0x4FDE...BA18 if you want to update your registered payment wallet address @user.
  • Be sure to open a draft pull request as soon as possible to communicate updates on your progress.
  • Be sure to provide timely updates to us when requested, or you will be automatically unassigned from the bounty.

    @molecula451
    Copy link
    Member

    molecula451 commented Jul 15, 2023

    let's work on it!! great @pavlovcik any particular reason why we want a meta dockerized unit testing?, is this for seamlessly local dev testing? (just for the thoughts here, i will handle it anyway)

    @0x4007
    Copy link
    Member Author

    0x4007 commented Jul 16, 2023

    It's a best guess on how to closely match the GitHub actions runner environment. I did a small bit of research before and found that there are docker containers specifically to act like a GitHub Action runner.

    Do you have any other suggestions?

    Maybe @rndquu might have some ideas.

    @rndquu
    Copy link
    Member

    rndquu commented Jul 17, 2023

    Let's clear the terminology:

    • Unit tests: fast and small tests which mock most of the external dependencies
    • Integration tests: tests running in a simulated environment without mocking external dependencies

    This issue implies setting up a foundation for unit testing, i.e.:

    1. Setup jest for the project
    2. Add basic tests for the following commands:
    • /assign
    • /unassign
    • /wallet
    • /payout
    • /multiplier
    1. Add a new script to the package.json that runs unit tests
    2. Add unit tests execution to a CI workflow (perhaps to the "Build" workflow)

    At later steps, when we are about to implement integration tests, we could consider using docker for simulating github environment. Perhaps there are better ways for implementing integration tests.

    @0x4007
    Copy link
    Member Author

    0x4007 commented Jul 17, 2023

    Okay so let's remove Docker from the spec and just run jest in the CI.

    @rndquu
    Copy link
    Member

    rndquu commented Sep 29, 2023

    Closing this one because:

    • jest (along with jest CI) will be setup here
    • unit (functional) tests for basic commands will be implemented here

    @rndquu rndquu closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2023
    @ubiquibot
    Copy link

    ubiquibot bot commented Sep 29, 2023

    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!

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

    Successfully merging a pull request may close this issue.

    6 participants