thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.59k stars 128 forks source link

TC CLI always returns "Folder not found" #1560

Open iAmcDiddy opened 1 month ago

iAmcDiddy commented 1 month ago

Discussed in https://github.com/thunderclient/thunder-client-support/discussions/1559

Originally posted by **iAmcDiddy** June 13, 2024 ## Update I tried this in another project that was NOT upgraded to the new schema and it worked. I have updated to the latest version and am trying to run all requests in a folder. When I run the --debug command it says 'saveToWorkspace' is undefined (although it's checked in my settings) and also 'customLocation' is undefined. My project has a 'thunder-tests' folder and all collections defined under that. There is a collection named "Execute_SQL_Query" and a folder in that collection named "Unauthorized". I used the 'tab' to complete the folder names while building the command. Below is my command prompt, command and result. Any help is greatly appreciated. ![image](https://github.com/thunderclient/thunder-client-support/assets/6363477/95994861-3a11-4350-8ae8-62ced8c54e3e) I have also tried not specifying the thunder-tests folder but got the same error: ![image](https://github.com/thunderclient/thunder-client-support/assets/6363477/59415998-c3f8-4674-bab4-3fa53e1d5e2c)
rangav commented 1 month ago

Hi @iAmcDiddy the commands should be run from root of the project folder

  1. type cd .. and run the tc --fol command again.
iAmcDiddy commented 1 month ago

I can't believe that's the fix, I thought I tried everything. So running an individual folder works for me now. I have data files for each folder and using this command picks up the .csv that is associated with that folder (I don't need to use --data-file): tc --fol "DataDriven-PositiveSpend" BUT when I try to run the parent collection, it only runs the Request in each Folder once. I would force the 'iterations' in the collection to a number, but each data file has a different number of data points in it (some have 1, some have 4). Any suggestions on how to get ALL the data to be utilized while running the whole collection? Many thanks!

This question is related to a closed issue: 1529

rangav commented 1 month ago

You can only use one data file using the collection/folder run view or using cli argument.

the iterations count is picked up from the rows in data file.

iAmcDiddy commented 1 month ago

Each folder has their own data file and 'iterations' set correctly. I can run these commands: tc --fol "DataDriven-PositiveAssessment" --report html tc --fol "DataDriven-NegativeAssessment" --report html but this doesn't work: tc --fol "DataDriven-PositiveAssessment,DataDriven-NegativeAssessment" --report html

Shouldn't I be able to run multiple folders?

rangav commented 1 month ago

Multiple folders not supported

Docs https://docs.thunderclient.com/cli/run-collection

iAmcDiddy commented 1 month ago

What am I missing? I can't run my (data driven) collection as a collection and I can't run it as folders either. Can you provide a suggestion? Do I need to resort to running 20 folder-level sets each time? That will use up my 500 collections/month for just this project.

rangav commented 1 month ago

@iAmcDiddy

can you please verify your subscription by using below form https://www.thunderclient.com/contact

rangav commented 1 month ago

Did not understand your question? Please provide more details

The documentation has all the details https://docs.thunderclient.com/cli/run-collection

What am I missing? I can't run my (data driven) collection as a collection and I can't run it as folders either. Can you provide a suggestion? Do I need to resort to running 20 folder-level sets each time? That will use up my 500 collections/month for just this project.

iAmcDiddy commented 1 month ago

I have this setup:

Collection 1

Folder 1

...

Folder 12

Collection 2

Folder 1

...

Folder 12

Each folder has a Request and a data file with multiple (~4) sets of data. Running a Collection won't work even if I pad each data file with the same number of rows and set that number as the iteration on the Collection. Running each Folder will work, but since there are so many - I will only be able to run the full set maybe once per week because of the limitation on number of collections executed per month. Is there a better solution than running these at the folder level? Can we get an extension on the number of collections/month until support for running at the collection level as we would like, is supported?

rangav commented 1 month ago

Multiple data files not supported, only single main data file is supported

alternatively you can skip folders and run selected folders

cw1934 commented 3 weeks ago

@rangav I feel like I'm missing something as to what's preventing this from working. Running Multiple Collections via CLI is supported, and running Multiple Requests is also supported. If multiples of layers both above and below Folders are supported, what is preventing the capability from being added to run Multiple Folders via CLI? It seems like a gap given other supported functionality, and seems like a valid use case given the described folder-specific aspects that come into play with this use case.

rangav commented 3 weeks ago

We will add this feature to roadmap and implement asap

rangav commented 2 weeks ago

The feature is implemented in CLI v1.16.0, Please update to latest version.

iAmcDiddy commented 2 weeks ago

The folders are being executed when using the above syntax, it even puts all the results into 1 report. However, each of our folders have data files defined and running them this way does NOT utilize the data from those files. So I would not consider this issue closed/completed.

rangav commented 2 weeks ago

Thanks for the feedback,

So, you want them to run independently utilising their own data files and generate separate reports right?

Please confirm above?

iAmcDiddy commented 1 week ago

Yes, we would like them to utilize the data file associated at the folder level. Ideally they would generate just 1 report (like it does now). Many thanks for looking into this!

rangav commented 3 days ago

I have published the new version v1.16.1 to run multiple folders. Currently, it will only generate only individual separate reports.

Please test and let me know your feedback.