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

Need Help with rerun-fails #385

Closed
lovefromindia opened this issue Jan 12, 2024 · 6 comments
Closed

Need Help with rerun-fails #385

lovefromindia opened this issue Jan 12, 2024 · 6 comments

Comments

@lovefromindia
Copy link

thanks for gotestsum package

We use below command on our Build but rerun didn't worked as expected.

gotestsum --rerun-fails --packages="./..." --format testname --junitfile ../../jsonreport.xml -- -coverprofile=../../cover.out ./... -p 7 -timeout 0

Is it because of using -p flag for parallel testcases? Any test case which failed only ran once and not twice as expected!

@dnephin
Copy link
Member

dnephin commented Jan 13, 2024

Hello! Thank you for the bug report.

The only thing I notice from the command you shared is that ./... appears twice. Once in as the value for --packages , and again after cover.out. It is correct to pass that value to --packages, but I think you need to remove the second one after cover.out. I'm not sure if that is causing the problem or if it's something else.

The -p flag should be ok, I haven't seen problems with that before.

Can you share some of the test output? How many tests are failing, and are any failing with a panic?

@lovefromindia
Copy link
Author

lovefromindia commented Jan 13, 2024

Thanks for the response.
We already removed the twice occuring packages and then also the rerun didn't worked
For panic part, I ensure no panic occured and assertions failed for the test case but I expected rerun for the test cases that failed. That didn't occured
Also, for argument -packages do we need to list all packages instead of recursive package path "./..." ? With -count=2 all test cases ran twice as expected but not with only rerun-fails

I just wanted to know if I am doing anything wrong with command that my script generates to run at build environment?

gotestsum --rerun-fails --packages="./..." --format testname --junitfile ../../jsonreport.xml -- -coverprofile=../../cover.out -p 7 -timeout 0

@dnephin
Copy link
Member

dnephin commented Jan 13, 2024

Can you try with adding the --debug flag to gotestsum ? That will print out the go test commands that are run each time. That should help us understand why there is no rerun.

If you can share some output of the test run that may help us debug, but from what you've shared I don't see anything that would prevent the re-runs.

@lovefromindia
Copy link
Author

lovefromindia commented Jan 16, 2024

Thanks for the quick response, dnephin
I thinks issue was with the argument of packages="./...". Instead we list out all packages in double quotes e.g. "a b c" and now reruns works as expected.
Now the coverage report generated is of last run. Is there any argument that gotestum give so that i can get combined coverage report of all runs?

@dnephin
Copy link
Member

dnephin commented Jan 17, 2024

Ah, yes there is a way to make that work. See #274 (comment), and this demo repo: https://github.com/neiser/gotestsum-rerun-dependent-subtests

@lovefromindia
Copy link
Author

lovefromindia commented Jan 17, 2024

Thanks for sharing. I am closing this issue and also apologise that i bothered you with too much questions and so kind of you to answer them.

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

No branches or pull requests

2 participants