From 836ecf6dd3a5d3742b5ee4ecf3b313640ffdba25 Mon Sep 17 00:00:00 2001 From: Bhuwan Pandit Date: Tue, 26 Nov 2024 21:33:42 +0000 Subject: [PATCH] enhance/hurl: remove depreciated --fail-at-end option --- completions/_hurl | 1 - completions/_hurl.ps1 | 1 - completions/hurl.bash | 2 +- completions/hurl.fish | 1 - docs/spec/options/hurl/fail_at_end.option | 7 ------- integration/hurl/tests_failed/fail_at_end.err | 17 ----------------- integration/hurl/tests_failed/fail_at_end.exit | 1 - integration/hurl/tests_failed/fail_at_end.hurl | 9 --------- integration/hurl/tests_failed/fail_at_end.ps1 | 3 --- integration/hurl/tests_failed/fail_at_end.py | 8 -------- integration/hurl/tests_failed/fail_at_end.sh | 3 --- packages/hurl/src/cli/options/commands.rs | 9 --------- packages/hurl/src/cli/options/matches.rs | 4 ---- packages/hurl/src/cli/options/mod.rs | 5 ++--- 14 files changed, 3 insertions(+), 68 deletions(-) delete mode 100644 docs/spec/options/hurl/fail_at_end.option delete mode 100644 integration/hurl/tests_failed/fail_at_end.err delete mode 100644 integration/hurl/tests_failed/fail_at_end.exit delete mode 100644 integration/hurl/tests_failed/fail_at_end.hurl delete mode 100755 integration/hurl/tests_failed/fail_at_end.ps1 delete mode 100644 integration/hurl/tests_failed/fail_at_end.py delete mode 100755 integration/hurl/tests_failed/fail_at_end.sh diff --git a/completions/_hurl b/completions/_hurl index d98c6661336..9e62ed4cbeb 100644 --- a/completions/_hurl +++ b/completions/_hurl @@ -29,7 +29,6 @@ _hurl() { '--curl[Export each request to a list of curl commands]: :_files' \ '--delay[Sets delay before each request]: :' \ '--error-format[Control the format of error messages]: :' \ - '--fail-at-end[Fail at end]' \ '--file-root[Set root directory to import files \[default: input file directory\]]: :' \ '(-L --location)'{-L,--location}'[Follow redirects]' \ '--location-trusted[Follow redirects but allows sending the name + password to all hosts that the site may redirect to]' \ diff --git a/completions/_hurl.ps1 b/completions/_hurl.ps1 index 73e75f35a54..e80f9f87470 100644 --- a/completions/_hurl.ps1 +++ b/completions/_hurl.ps1 @@ -34,7 +34,6 @@ Register-ArgumentCompleter -Native -CommandName 'hurl' -ScriptBlock { [CompletionResult]::new('--curl', 'curl', [CompletionResultType]::ParameterName, 'Export each request to a list of curl commands') [CompletionResult]::new('--delay', 'delay', [CompletionResultType]::ParameterName, 'Sets delay before each request') [CompletionResult]::new('--error-format', 'error-format', [CompletionResultType]::ParameterName, 'Control the format of error messages') - [CompletionResult]::new('--fail-at-end', 'fail-at-end', [CompletionResultType]::ParameterName, 'Fail at end') [CompletionResult]::new('--file-root', 'file-root', [CompletionResultType]::ParameterName, 'Set root directory to import files [default: input file directory]') [CompletionResult]::new('--location', 'location', [CompletionResultType]::ParameterName, 'Follow redirects') [CompletionResult]::new('--location-trusted', 'location-trusted', [CompletionResultType]::ParameterName, 'Follow redirects but allows sending the name + password to all hosts that the site may redirect to') diff --git a/completions/hurl.bash b/completions/hurl.bash index 14352ab33fa..b21be5b3800 100644 --- a/completions/hurl.bash +++ b/completions/hurl.bash @@ -5,7 +5,7 @@ _hurl() _init_completion || return if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W '--aws-sigv4 --cacert --cert --key --color --compressed --connect-timeout --connect-to --continue-on-error --cookie --cookie-jar --curl --delay --error-format --fail-at-end --file-root --location --location-trusted --from-entry --glob --http1.0 --http1.1 --http2 --http3 --ignore-asserts --include --insecure --interactive --ipv4 --ipv6 --jobs --json --limit-rate --max-filesize --max-redirs --max-time --netrc --netrc-file --netrc-optional --no-color --no-output --noproxy --output --parallel --path-as-is --proxy --repeat --report-html --report-json --report-junit --report-tap --resolve --retry --retry-interval --ssl-no-revoke --test --to-entry --unix-socket --user --user-agent --variable --variables-file --verbose --very-verbose --help --version' -- "$cur")) + COMPREPLY=($(compgen -W '--aws-sigv4 --cacert --cert --key --color --compressed --connect-timeout --connect-to --continue-on-error --cookie --cookie-jar --curl --delay --error-format --file-root --location --location-trusted --from-entry --glob --http1.0 --http1.1 --http2 --http3 --ignore-asserts --include --insecure --interactive --ipv4 --ipv6 --jobs --json --limit-rate --max-filesize --max-redirs --max-time --netrc --netrc-file --netrc-optional --no-color --no-output --noproxy --output --parallel --path-as-is --proxy --repeat --report-html --report-json --report-junit --report-tap --resolve --retry --retry-interval --ssl-no-revoke --test --to-entry --unix-socket --user --user-agent --variable --variables-file --verbose --very-verbose --help --version' -- "$cur")) return fi diff --git a/completions/hurl.fish b/completions/hurl.fish index 5498ef234bd..0c933d6a86b 100644 --- a/completions/hurl.fish +++ b/completions/hurl.fish @@ -12,7 +12,6 @@ complete -c hurl -l cookie-jar -d 'Write cookies to FILE after running the sessi complete -c hurl -l curl -d 'Export each request to a list of curl commands' complete -c hurl -l delay -d 'Sets delay before each request' complete -c hurl -l error-format -d 'Control the format of error messages' -complete -c hurl -l fail-at-end -d 'Fail at end' complete -c hurl -l file-root -d 'Set root directory to import files [default: input file directory]' complete -c hurl -l location -d 'Follow redirects' complete -c hurl -l location-trusted -d 'Follow redirects but allows sending the name + password to all hosts that the site may redirect to' diff --git a/docs/spec/options/hurl/fail_at_end.option b/docs/spec/options/hurl/fail_at_end.option deleted file mode 100644 index 533957c5d20..00000000000 --- a/docs/spec/options/hurl/fail_at_end.option +++ /dev/null @@ -1,7 +0,0 @@ -name: fail_at_end -long: fail-at-end -help: Fail at end -help_heading: Run options -deprecated: true ---- - diff --git a/integration/hurl/tests_failed/fail_at_end.err b/integration/hurl/tests_failed/fail_at_end.err deleted file mode 100644 index 42eb2dabaae..00000000000 --- a/integration/hurl/tests_failed/fail_at_end.err +++ /dev/null @@ -1,17 +0,0 @@ -The option fail-at-end is deprecated. Use continue-on-error instead -error: Assert status code - --> tests_failed/fail_at_end.hurl:2:6 - | - | GET http://localhost:8000/fail-at-end - 2 | HTTP 400 - | ^^^ actual value is <200> - | - -error: Assert status code - --> tests_failed/fail_at_end.hurl:8:6 - | - | GET http://localhost:8000/fail-at-end - 8 | HTTP 400 - | ^^^ actual value is <200> - | - diff --git a/integration/hurl/tests_failed/fail_at_end.exit b/integration/hurl/tests_failed/fail_at_end.exit deleted file mode 100644 index b8626c4cff2..00000000000 --- a/integration/hurl/tests_failed/fail_at_end.exit +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/integration/hurl/tests_failed/fail_at_end.hurl b/integration/hurl/tests_failed/fail_at_end.hurl deleted file mode 100644 index f8f291a2d40..00000000000 --- a/integration/hurl/tests_failed/fail_at_end.hurl +++ /dev/null @@ -1,9 +0,0 @@ -GET http://localhost:8000/fail-at-end -HTTP 400 - -GET http://localhost:8000/fail-at-end -HTTP 200 - -GET http://localhost:8000/fail-at-end -HTTP 400 - diff --git a/integration/hurl/tests_failed/fail_at_end.ps1 b/integration/hurl/tests_failed/fail_at_end.ps1 deleted file mode 100755 index c52b524f4c8..00000000000 --- a/integration/hurl/tests_failed/fail_at_end.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Set-StrictMode -Version latest -$ErrorActionPreference = 'Stop' -hurl --fail-at-end tests_failed/fail_at_end.hurl diff --git a/integration/hurl/tests_failed/fail_at_end.py b/integration/hurl/tests_failed/fail_at_end.py deleted file mode 100644 index a823dc29b0e..00000000000 --- a/integration/hurl/tests_failed/fail_at_end.py +++ /dev/null @@ -1,8 +0,0 @@ -# coding=utf-8 -from app import app -from flask import Response - - -@app.route("/fail-at-end") -def fail_at_end(): - return Response("", status=200) diff --git a/integration/hurl/tests_failed/fail_at_end.sh b/integration/hurl/tests_failed/fail_at_end.sh deleted file mode 100755 index 9093c12e6fc..00000000000 --- a/integration/hurl/tests_failed/fail_at_end.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -set -Eeuo pipefail -hurl --fail-at-end tests_failed/fail_at_end.hurl diff --git a/packages/hurl/src/cli/options/commands.rs b/packages/hurl/src/cli/options/commands.rs index 642430e2900..6a30c656d93 100644 --- a/packages/hurl/src/cli/options/commands.rs +++ b/packages/hurl/src/cli/options/commands.rs @@ -158,15 +158,6 @@ pub fn error_format() -> clap::Arg { .num_args(1) } -pub fn fail_at_end() -> clap::Arg { - clap::Arg::new("fail_at_end") - .long("fail-at-end") - .help("Fail at end") - .help_heading("Run options") - .action(clap::ArgAction::SetTrue) - .hide(true) -} - pub fn file_root() -> clap::Arg { clap::Arg::new("file_root") .long("file-root") diff --git a/packages/hurl/src/cli/options/matches.rs b/packages/hurl/src/cli/options/matches.rs index 80d70dc1073..79fc034d6ff 100644 --- a/packages/hurl/src/cli/options/matches.rs +++ b/packages/hurl/src/cli/options/matches.rs @@ -111,10 +111,6 @@ pub fn connects_to(arg_matches: &ArgMatches) -> Vec { } pub fn continue_on_error(arg_matches: &ArgMatches) -> bool { - if has_flag(arg_matches, "fail_at_end") { - eprintln!("The option fail-at-end is deprecated. Use continue-on-error instead"); - return true; - } has_flag(arg_matches, "continue_on_error") } diff --git a/packages/hurl/src/cli/options/mod.rs b/packages/hurl/src/cli/options/mod.rs index 17baf01962a..f3917b991fc 100644 --- a/packages/hurl/src/cli/options/mod.rs +++ b/packages/hurl/src/cli/options/mod.rs @@ -238,9 +238,8 @@ pub fn parse() -> Result { .arg(commands::glob()) .arg(commands::netrc()) .arg(commands::netrc_file()) - .arg(commands::netrc_optional()) - // Deprecated options - .arg(commands::fail_at_end()); + .arg(commands::netrc_optional()); + let arg_matches = command.try_get_matches_from_mut(env::args_os())?; // If we've no file input (either from the standard input or from the command line arguments),