From c7aec34f5968094037ccbbe6c74cee8694664cfb Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 10 Jul 2024 11:12:56 +0100 Subject: [PATCH] Bug 37302: Set test to failed if swagger-cli missing Signed-off-by: David Nind Signed-off-by: Tomas Cohen Arazi --- xt/api.t | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xt/api.t b/xt/api.t index 3165f8ff6e5..8ffa0ec5c0b 100755 --- a/xt/api.t +++ b/xt/api.t @@ -91,14 +91,13 @@ subtest 'The spec passes the swagger-cli validation' => sub { plan tests => 1; -SKIP: { - skip "Skipping tests, swagger-cli missing", 1 - unless can_run('swagger-cli'); - + if ( can_run('swagger-cli') ) { my $spec_dir = "$FindBin::Bin/../api/v1/swagger"; my $var = qx{swagger-cli validate $spec_dir/swagger.yaml 2>&1}; is( $?, 0, 'Validation exit code is 0' ) or diag $var; + } else { + ok( 0, "Test skipped, swagger-cli missing" ); } }; -- 2.39.2