[GH-ISSUE #2928] [feature]: Running tests with Hoppscotch CLI in order #946

Closed
opened 2026-03-16 17:47:37 +03:00 by kerem · 3 comments
Owner

Originally created by @LuchoTurtle on GitHub (Feb 22, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2928

Is there an existing issue for this?

  • 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.

Originally created by @LuchoTurtle on GitHub (Feb 22, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2928 ### 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: <img width="453" alt="image" src="https://user-images.githubusercontent.com/17494745/220875469-248151f5-b7cb-49a7-8674-6551cd9361fb.png"> 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**.
kerem 2026-03-16 17:47:37 +03:00
Author
Owner

@cpanten commented on GitHub (Aug 30, 2023):

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.

<!-- gh-comment-id:1699097146 --> @cpanten commented on GitHub (Aug 30, 2023): 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](https://github.com/hoppscotch/hoppscotch/assets/68958452/331ab96c-be91-49c2-893f-6a0b3eb92fb5) I am not a ts developer. Would be nice if an ts expert could take a look on that. Many thanks in advanced.
Author
Owner

@supriyahegde commented on GitHub (Jun 12, 2024):

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

<!-- gh-comment-id:2162255127 --> @supriyahegde commented on GitHub (Jun 12, 2024): 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
Author
Owner

@jamesgeorge007 commented on GitHub (Nov 28, 2024):

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

<!-- gh-comment-id:2506484704 --> @jamesgeorge007 commented on GitHub (Nov 28, 2024): The proposed behaviour update has been implemented in #4475 and released with [Hoppscotch CLI v0.13.0](https://www.npmjs.com/package/@hoppscotch/cli/v/0.13.0).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#946
No description provided.