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

Do not stop if one unit test fails #14

Closed
mshudrak opened this issue Jan 18, 2023 · 7 comments · Fixed by #33
Closed

Do not stop if one unit test fails #14

mshudrak opened this issue Jan 18, 2023 · 7 comments · Fixed by #33
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@mshudrak
Copy link
Collaborator

Currently, our unit test process stops as soon as one test fails thereby making it hard to evaluate what else breaking without actually fixing the error and relaunching test again. We need to first run all tests and then print summary of failed functions.

@mshudrak mshudrak added good first issue Good for newcomers enhancement New feature or request labels Jan 18, 2023
@Pavan-Nambi
Copy link

Pavan-Nambi commented Jan 28, 2023

hey is this issue still exists? if so can i work on this? a try catch blocks? or should i use unittest to keep consistency?

asking this as i see there is unittest.mock alrdy being used here

@mshudrak
Copy link
Collaborator Author

Oh yes, the issue still exist. Feel free to work on it. I was actually referring to this one: https://github.com/google/gcp_scanner/blob/main/src/gcp_scanner/test_unit.py. It fails as soon as the first assert is not satisfied. I'd use unittest.mock module to keep consistency.

@Pavan-Nambi
Copy link

oo ok gotcha

@jatinagwal
Copy link

@Pavan-Nambi Can I pick this up?

@Pavan-Nambi
Copy link

hey @jatinagwal yeah feel free to do so , i got into some work so wasn't able to do , appologies for delay

@sudiptob2
Copy link
Contributor

I am also interested in this issue if it's open.

@sudiptob2
Copy link
Contributor

@mshudrak I think its best practice to write single assert per test function. If you agree, I can take on the issue and refactor the tests.
I am looking forward to your opinion 🙂

sudiptob2 added a commit to sudiptob2/gcp_scanner that referenced this issue Feb 23, 2023
Signed-off-by: Sudipto Baral <sudiptobaral.me@gmail.com>
sudiptob2 added a commit to sudiptob2/gcp_scanner that referenced this issue Feb 23, 2023
Signed-off-by: Sudipto Baral <sudiptobaral.me@gmail.com>
mshudrak pushed a commit that referenced this issue Feb 23, 2023
Signed-off-by: Sudipto Baral <sudiptobaral.me@gmail.com>
mshudrak pushed a commit that referenced this issue Feb 23, 2023
Signed-off-by: Sudipto Baral <sudiptobaral.me@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants