Skip to content

Commit

Permalink
Use variable name which shows where is taken from
Browse files Browse the repository at this point in the history
needles_dir takes a value which shows to the product dir. This changes tries
to make a better presentation on the value which is pass to the NEEDLES_DIR.

Signed-off-by: ybonatakis <[email protected]>
  • Loading branch information
b10n1k committed Jul 31, 2024
1 parent 5188e22 commit 2a99fc2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions t/40-script_openqa-clone-custom-git-refspec.t
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@ $expected_re = qr/${expected}/s;
test_once $args, $expected_re, 'clone-job command with multiple URLs in PR and job URL';

$ENV{curl_github} = qq{echo -e '{"head": {"label": "user:my/branch"}, "body": "Lorem ipsum"}'; true};
my $needles = 'products/sle/needles';
my $productdir = 'products/sle';
$ENV{curl_openqa}
= qq{echo -e '{"TEST": "my_test", "CASEDIR": "my/distri", "PRODUCTDIR": "distri/products/sle", "NEEDLES_DIR": "$needles"}'; true};
$dirs = "CASEDIR=https://github.com/user/repo.git#my/branch PRODUCTDIR=repo/products/sle NEEDLES_DIR=distri/$needles";
= qq{echo -e '{"TEST": "my_test", "CASEDIR": "my/distri", "PRODUCTDIR": "distri/products/sle", "NEEDLES_DIR": "$productdir"}'; true};
$dirs = "CASEDIR=https://github.com/user/repo.git#my/branch PRODUCTDIR=repo/products/sle NEEDLES_DIR=distri/$productdir";
$expected = $clone_job . '1169326 _GROUP=0 TEST\+=\@user/repo#my/branch BUILD=user/repo#9539 ';
$expected_re = qr/${expected}${dirs}/;
test_once $args, $expected_re, "PRODUCTDIR is correct when the source job's PRODUCTDIR is a relative directory";

$needles = "$needles";
$productdir = "$productdir";
$ENV{curl_openqa}
= qq{echo -e '{"TEST": "my_test", "CASEDIR": "/my/distri", "PRODUCTDIR": "products/sle", "NEEDLES_DIR": "$needles"}'; true};
$dirs = "CASEDIR=https://github.com/user/repo.git#my/branch PRODUCTDIR=repo/products/sle NEEDLES_DIR=$needles";
= qq{echo -e '{"TEST": "my_test", "CASEDIR": "/my/distri", "PRODUCTDIR": "products/sle", "NEEDLES_DIR": "$productdir"}'; true};
$dirs = "CASEDIR=https://github.com/user/repo.git#my/branch PRODUCTDIR=repo/products/sle NEEDLES_DIR=$productdir/needles";
$expected_re = qr/${expected}${dirs}/;
test_once $args, $expected_re, 'Correct PRODUCTDIR for relative non-prefixed dir';

Expand All @@ -128,7 +128,7 @@ test_once $args, $expected_re, "PRODUCTDIR is correct when the source job's PROD

$ENV{curl_openqa}
= qq{echo -e '{"TEST": "my_test", "CASEDIR": "https://github.com/user/repo", "PRODUCTDIR": "products/sle"}'; true};
$dirs = "CASEDIR=https://github.com/user/repo.git#my/branch PRODUCTDIR=repo/products/sle NEEDLES_DIR=$needles";
$dirs = "CASEDIR=https://github.com/user/repo.git#my/branch PRODUCTDIR=repo/products/sle NEEDLES_DIR=$productdir/needles";
$expected_re = qr/${expected}${dirs}/;
test_once $args, $expected_re, 'Correct NEEDLES_DIR when variable is not set';

Expand Down

0 comments on commit 2a99fc2

Please sign in to comment.