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

feat: add tests #70

Open
julio4 opened this issue Aug 28, 2023 · 34 comments
Open

feat: add tests #70

julio4 opened this issue Aug 28, 2023 · 34 comments
Labels
good first issue Good for newcomers

Comments

@julio4
Copy link
Contributor

julio4 commented Aug 28, 2023

Most of the current listings do not have tests. Adding tests would ensure that we have not left any logic errors that could confuse readers later on.

We need to add atleast simple integration tests for all contracts. Unit tests can be added for more complex contracts.

  • Integration tests are tests that deploy the contract and interact with it's provided interface. They should be placed on a separate file/module tests.cairo.

  • Unit tests do not have to deploy the contract and use the interface. Unit tests can use mocked implementation or state to test only one specific feature. They should be placed on the same file as the example (and hidden in the book using ANCHOR).

You do not have to add tests to all missing listings at once.

See this as a reference.

Please open a PR per example.

@julio4 julio4 added the good first issue Good for newcomers label Aug 28, 2023
@julio4 julio4 changed the title Feat: add tests feat: add tests Aug 28, 2023
@ebbieaden

This comment was marked as outdated.

@julio4 julio4 mentioned this issue Aug 29, 2023
@julio4

This comment was marked as outdated.

@petersdt

This comment was marked as outdated.

@NueloSE

This comment was marked as outdated.

@CollinsC1O

This comment was marked as outdated.

@julio4
Copy link
Contributor Author

julio4 commented May 23, 2024

@petersdt @NueloSE @CollinsC1O Thank you for your interest.
Currently, all chapter0 examples are tested. You can pick any listings without tests and list it here to be assigned to it.
You can take a look at #179 #181 #182 as examples.

@No-bodyq

This comment was marked as outdated.

@julio4 julio4 added the ODHack label May 24, 2024
@the-first-elder

This comment was marked as outdated.

@julio4
Copy link
Contributor Author

julio4 commented May 24, 2024

i can work on this

You need to specify the 1-3 tests you want to work on it. Only complete tests will be accepted!

@NueloSE

This comment was marked as outdated.

@petersdt

This comment was marked as outdated.

@the-first-elder

This comment was marked as outdated.

@julio4

This comment was marked as outdated.

@CollinsC1O

This comment was marked as outdated.

@LamsyA

This comment was marked as outdated.

@the-first-elder the-first-elder mentioned this issue May 27, 2024
2 tasks
@the-first-elder

This comment was marked as outdated.

@the-first-elder the-first-elder mentioned this issue May 27, 2024
1 task
@Timilehin-bello

This comment was marked as outdated.

@julio4
Copy link
Contributor Author

julio4 commented May 28, 2024

Hi @julio4 I will love to work on cairo_cheatsheet

Exceptionally, we will not add tests for the cairo cheatsheet section

@julio4

This comment was marked as outdated.

@Timilehin-bello

This comment was marked as outdated.

@petersdt

This comment was marked as outdated.

@saimeunt
Copy link
Contributor

Hey @julio4 is there any tests left I can work on? Maybe Constant Product AMM since OZ#953 has been fixed now.
https://github.com/NethermindEth/StarknetByExample/blob/main/listings/applications/constant_product_amm/src/tests.cairo#L41

@LamsyA
Copy link
Contributor

LamsyA commented Jun 1, 2024

Hello @julio4
I have added test to simple_vault contract this is the PR

@nemealfaro
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, I'm Nemesis Alfaro from Costa Rica, i'm a system engineer.
I love to learn and practice about different tecnologies.
I'm hard-working, constant and curious person
This would be my first contribution on the platform, in order to gain more knowledge and improve in the area.

How I plan on tackling this issue

First, i would like carefully read the request and be in contact with you for more infomation.
Then i would to further investigate about the options to solve the issue

@julio4
Copy link
Contributor Author

julio4 commented Jul 1, 2024

Hi, I'm Nemesis Alfaro from Costa Rica, i'm a system engineer. ...

Thank you for your interest! Please take a look at the contributing guide to get started.

@nemealfaro
Copy link

Thank you for the opportunity, I will review it and if I have any questions, I will contact you

@julio4
Copy link
Contributor Author

julio4 commented Jul 1, 2024

New missing tests: simple_account

@Ternder001

This comment was marked as off-topic.

@Giri-Aayush

This comment was marked as off-topic.

@EmmanuelAR
Copy link

heyyyy @julio4 is this still available? any function to test? let me know

@livinalt
Copy link

livinalt commented Oct 1, 2024

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi my name is Jeremiah Samuel. I am a frontend and blockchain developer. I build web solutions and interested in building blockchain infrastructures. I am hardworking and focused

This is my first application for contributing and would be looking forward to be granted that opportunity to gain more experience.

How I plan on tackling this issue

To begin, I would await briefing on the contracts in need of unit testing. After that I would proceed to write the test, submit and wait for your review and feedback which would determine the next course of action. Your feedback is my quality assurance guiding me in the rest of the tests.

@julio4
Copy link
Contributor Author

julio4 commented Oct 3, 2024

@livinalt @EmmanuelAR and others... No need to apply on OnlyDust platform. Just explore listings and find one that have no tests, and implement tests for atleast the most important use cases.

@livinalt
Copy link

livinalt commented Oct 4, 2024

Thanks for the heads up @julio4. I'll check out the listings

@Lukman-01

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests