[PR #4475] [MERGED] feat: collection CLI runner with iterations and data feed #4825

Closed
opened 2026-03-17 02:19:30 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4475
Author: @shobanrajm
Created: 10/25/2024
Status: Merged
Merged: 11/22/2024
Merged by: @jamesgeorge007

Base: nextHead: run-cli-iterations


📝 Commits (10+)

  • 2880ebe feat: collection CLI runner with iterations and data feed
  • fcf8809 fix: junit report test case snapshot updated
  • 147530b fix: junit report test case snapshot updated
  • e37031f chore: to verify test case
  • 0e1af34 fix: added validations for data option
  • ff1b667 fix: added validations for data option
  • 273c9c4 fix: test case update for data option
  • b2d19e3 fix: test case update for data option
  • 301904e fix: test case update for data option
  • 7f3e20d fix: test case update for timeout

📊 Changes

16 files changed (+626 additions, -241 deletions)

View changed files

📝 packages/hoppscotch-cli/README.md (+53 -35)
📝 packages/hoppscotch-cli/package.json (+5 -3)
📝 packages/hoppscotch-cli/src/__tests__/e2e/commands/__snapshots__/test.spec.ts.snap (+100 -100)
📝 packages/hoppscotch-cli/src/__tests__/e2e/commands/test.spec.ts (+205 -34)
packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/iteration-data-tests-coll.json (+23 -0)
packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/iteration-data-envs.json (+18 -0)
packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/iteration-data-export.csv (+4 -0)
📝 packages/hoppscotch-cli/src/commands/test.ts (+74 -4)
📝 packages/hoppscotch-cli/src/handlers/error.ts (+3 -0)
📝 packages/hoppscotch-cli/src/index.ts (+9 -0)
📝 packages/hoppscotch-cli/src/types/collections.ts (+6 -1)
📝 packages/hoppscotch-cli/src/types/commands.ts (+2 -0)
📝 packages/hoppscotch-cli/src/types/errors.ts (+1 -0)
📝 packages/hoppscotch-cli/src/types/request.ts (+1 -1)
📝 packages/hoppscotch-cli/src/utils/collections.ts (+104 -63)
📝 pnpm-lock.yaml (+18 -0)

📄 Description

Closes #4469 , #2928, HFE-660.

What's changed

This PR enhances the CLI by adding iteration and data-driven capabilities for collection runs. Users can now specify the number of iterations and provide data via a CSV file, enabling basic load testing via the following CLI flag additions for the test command:

  • --iteration-count <no_of_iterations> - Takes in the number of iterations to run the collection.

  • --iteration-data <file_path> - Accepts the path to a CSV file with contents in the below format:

      key1,key2,key3
      value1,value2,value
      value4,value5,value6
    

    For every iteration the values will be replaced with the respective keys in the environment. For iteration 1 the value1,value2,value3 will be replaced and for iteration 2 value4,value5,value6 will be replaced and so on.

Additionally, this PR corrects the execution order of CLI collection runs, moving from LIFO to FIFO to maintain the defined sequence.

Notes to reviewers

N/A


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/4475 **Author:** [@shobanrajm](https://github.com/shobanrajm) **Created:** 10/25/2024 **Status:** ✅ Merged **Merged:** 11/22/2024 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `run-cli-iterations` --- ### 📝 Commits (10+) - [`2880ebe`](https://github.com/hoppscotch/hoppscotch/commit/2880ebe59425defedd19a1761ce8d66e5bb0f6de) feat: collection CLI runner with iterations and data feed - [`fcf8809`](https://github.com/hoppscotch/hoppscotch/commit/fcf88094d119b307b64d4d680b472fdefbfa0e02) fix: junit report test case snapshot updated - [`147530b`](https://github.com/hoppscotch/hoppscotch/commit/147530b80444423ef2522772c1c3d78a91d69b3a) fix: junit report test case snapshot updated - [`e37031f`](https://github.com/hoppscotch/hoppscotch/commit/e37031f73309d44faa1e0cf45372909b8b75392c) chore: to verify test case - [`0e1af34`](https://github.com/hoppscotch/hoppscotch/commit/0e1af34f467726b53cc53bf33b29a16ef64b1ee9) fix: added validations for data option - [`ff1b667`](https://github.com/hoppscotch/hoppscotch/commit/ff1b66736fe2ad8ea12d3ab00fad0bde751ccfc3) fix: added validations for data option - [`273c9c4`](https://github.com/hoppscotch/hoppscotch/commit/273c9c4ea90cb00c9d203e4aba84f67ebda8a914) fix: test case update for data option - [`b2d19e3`](https://github.com/hoppscotch/hoppscotch/commit/b2d19e31fad54c8f345b07588068dc9dd5855f74) fix: test case update for data option - [`301904e`](https://github.com/hoppscotch/hoppscotch/commit/301904e46c54f25ff7b8913209a97a18fe1c91e1) fix: test case update for data option - [`7f3e20d`](https://github.com/hoppscotch/hoppscotch/commit/7f3e20d672b4ef3a06f3a3201b7e70046f70d324) fix: test case update for timeout ### 📊 Changes **16 files changed** (+626 additions, -241 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-cli/README.md` (+53 -35) 📝 `packages/hoppscotch-cli/package.json` (+5 -3) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/commands/__snapshots__/test.spec.ts.snap` (+100 -100) 📝 `packages/hoppscotch-cli/src/__tests__/e2e/commands/test.spec.ts` (+205 -34) ➕ `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/collections/iteration-data-tests-coll.json` (+23 -0) ➕ `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/iteration-data-envs.json` (+18 -0) ➕ `packages/hoppscotch-cli/src/__tests__/e2e/fixtures/environments/iteration-data-export.csv` (+4 -0) 📝 `packages/hoppscotch-cli/src/commands/test.ts` (+74 -4) 📝 `packages/hoppscotch-cli/src/handlers/error.ts` (+3 -0) 📝 `packages/hoppscotch-cli/src/index.ts` (+9 -0) 📝 `packages/hoppscotch-cli/src/types/collections.ts` (+6 -1) 📝 `packages/hoppscotch-cli/src/types/commands.ts` (+2 -0) 📝 `packages/hoppscotch-cli/src/types/errors.ts` (+1 -0) 📝 `packages/hoppscotch-cli/src/types/request.ts` (+1 -1) 📝 `packages/hoppscotch-cli/src/utils/collections.ts` (+104 -63) 📝 `pnpm-lock.yaml` (+18 -0) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes #4469 , #2928, HFE-660. <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> ### What's changed This PR enhances the CLI by adding iteration and data-driven capabilities for collection runs. Users can now specify the number of iterations and provide data via a CSV file, enabling basic load testing via the following CLI flag additions for the test command: - `--iteration-count <no_of_iterations>` - Takes in the number of iterations to run the collection. - `--iteration-data <file_path>` - Accepts the path to a CSV file with contents in the below format: ``` key1,key2,key3 value1,value2,value value4,value5,value6 ``` > For every iteration the values will be replaced with the respective keys in the environment. For iteration 1 the value1,value2,value3 will be replaced and for iteration 2 value4,value5,value6 will be replaced and so on. Additionally, this PR corrects the execution order of CLI collection runs, moving from LIFO to FIFO to maintain the defined sequence. <!-- Describe point by point the different things you have changed in this PR --> <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Notes to reviewers <!-- Any information you feel the reviewer should know about when reviewing your PR --> N/A --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:19:30 +03:00
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#4825
No description provided.