hoppscotch icon indicating copy to clipboard operation
hoppscotch copied to clipboard

[feature]: Running tests with Hoppscotch CLI in order

Open LuchoTurtle opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Summary

Hey there, Hoppscotch team! 👋 Thanks for the amazing work put on so far!

I'm using the Hoppscotch CLI to run some tests in Github Actions (hopp test).

I've run hopp test quite a few times and the execution flow of each test seems to be absolutely random. Shouldn't the tests be running in the same order that they appear in the json file that is exported/in the GUI? This is a bit frustrating because some tests require the correct execution of others and having no control of the execution order is a bit underwhelming.

For example, I have three folders with several requests in each one:

image

The tests are executed in the order of Tags -> Timers -> Items. Inside each folder, the tests are run sequentially.

Is this behaviour intentional?

Why should this be worked on?

I believe the simplest solution would be running the tests in the same order they are displayed in the GUI/exported to the json file.

I think this is important for people who want to use this CLI to make API definition tests.

LuchoTurtle avatar Feb 22 '23 15:02 LuchoTurtle

The issue is related to the collectionstack in hoppscotch-cli/src/utils/collections.ts. A stack is a last-in first-out collection. So, the last pushed folder is used as next step to do. image

I am not a ts developer. Would be nice if an ts expert could take a look on that. Many thanks in advanced.

cpanten avatar Aug 30 '23 12:08 cpanten

Hi Team, @AndrewBastin @liyasthomas

We are also facing this issue with CLI that it doesnt run the tests in the order it is saved in the collection file. Could you please fix this issue.

Thanks, Supriya

supriyahegde avatar Jun 12 '24 06:06 supriyahegde

The proposed behaviour update has been implemented in #4475 and released with Hoppscotch CLI v0.13.0.

jamesgeorge007 avatar Nov 28 '24 16:11 jamesgeorge007