AnWeber / httpyac

Command Line Interface for *.http and *.rest files. Connect with http, gRPC, WebSocket and MQTT
https://httpyac.github.io/
MIT License
437 stars 37 forks source link

BUG: Setting export.$cancel = true of one test cancels all subsequent tests #808

Closed alekdavis closed 1 month ago

alekdavis commented 1 month ago

Setting the exports.$cancel variable works fine in the VSCode, but when I execute the same tests from CLI, as soon as the first test in the sequence encounters the exports.$cancel=true condition, all subsequent test will be skipped as well (even the ones with no dependencies).

I created a demo here:

https://github.com/alekdavis/httpyac-extras/blob/main/Tests/Bugs/cli_cancel_bug.http

If you run all test in the file from VSCode, it will execute tests A, C and D, but if you run all tests via CLI, it will only execute test A. I used these command-line options:

httpyac send -a -o short Tests\Bugs\cli_cancel_bug.http

And my output is this:

---------------------

=== Test A ===

GET https://httpbin.org/json
=> 200 (368 ms, 612 B)

1 requests processed (1 succeeded, 0 failed)
AnWeber commented 1 month ago

when I call up the file, it actually looks correct at first. image

Which CLI version are you currently using? We could try using a docker run command to test my app without your environment:

docker run -it -v ${PWD}:/data ghcr.io/anweber/httpyac:latest send -a -o short ./Tests/Bugs/cli_cancel_bug.http
alekdavisintel commented 1 month ago

Ah, cool. One or more versions (npm, node, or httpyac) must have been out of date. I should've recorded, but I'm not a user of node or npm outside of httpyac, so I just learned about the commands to check versions and run an update. I updated all three and now it looks good. Thank you.

While we're on this topic, if I update the VSCode extension, would it automatically update the CLI package? Or are they totally independent and I need to make sure to update them individually?

AnWeber commented 1 month ago

The versions are independent. I have noticed that someone has set up httpyac in homebrew so that the updates are automatically managed with homebrew.

alekdavis commented 1 month ago

I see, thanks. I assumed that the CLI was a dependency of the VSCode extension and expected a VSCode update to also update the CLI version. We do not use Homebrew (it looks like a MacOS/Linux thing and we're mostly a MSFT shop), but I will keep in mind that we need to monitor the CLI release announcements and make sure we update the CLI periodically.