-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assign correct CASEDIR based on TEST_GIT_URL on clone function #278
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment
Just adding the original patch I suggested to get you going for reference: diff --git a/_common b/_common
index a86f421..a975f42 100644
--- a/_common
+++ b/_common
@@ -255,3 +255,7 @@ find_latest_published_tumbleweed_image() {
echo "$image"
}
+fetch-vars-json() {
+ local tid=$1
+ runcurl "${curl_args[@]}" -sS "$host_url/tests/$tid"/file/vars.json || return $?
+}
diff --git a/openqa-investigate b/openqa-investigate
index b7d4f16..93b9c3a 100755
--- a/openqa-investigate
+++ b/openqa-investigate
@@ -53,6 +53,8 @@ clone() {
if [[ $refspec ]]; then
casedir=$(echo "$clone_job_data" | runjq -r '.job.settings.CASEDIR') || return $?
[[ $casedir == null ]] && casedir=''
+ vars=$(fetch-vars-json "$origin") || return $?
+ git_url=$(echo "$vars" | runjq -r '.TEST_GIT_URL') || return $?
repo=${casedir:-'https://github.com/os-autoinst/os-autoinst-distri-opensuse.git'}
clone_settings+=("CASEDIR=${repo%#*}#${refspec}")
fi
diff --git a/test/02-investigate.t b/test/02-investigate.t
index b203e2f..115e45d 100644
--- a/test/02-investigate.t
+++ b/test/02-investigate.t
@@ -128,6 +128,11 @@ openqa-cli() {
fi
}
+fetch-vars-json() {
+ local tid=$1
+ echo '{"TEST_GIT_URL": "..."}'
+}
+
clone_call=echo
_clone_call() {
echo "$@" >&2
@@ -139,6 +144,12 @@ testlabel="vim:investigate"
has "$got" "* *$testlabel*: " "Expected markdown output of job urls for unsupported clusters"
has "$got" '_TRIGGER_JOB_DONE_HOOK=1' "job is cloned with _TRIGGER_JOB_DONE_HOOK"
+try clone 10023 10024 foo refspec 2>&1
+is "$rc" 0 "Successful clone"
+testlabel="vim:investigate:foo"
+diag "!!!!!!!!!!!!!! $got"
+has "$got" '...'
+
clone_call=echo
try investigate 10027
is "$rc" 0 'success regardless of actually triggered jobs' I did have a reason to suggest creating a new function |
a53c00e
to
2d2ba38
Compare
2d2ba38
to
673a998
Compare
When TEST_GIT_URL is used the CASEDIR should assign the repo based on this variable. As such the investigation uses the correct test repo to clone jobs. Signed-off-by: ybonatakis <[email protected]>
673a998
to
72df157
Compare
btw, this was about https://progress.opensuse.org/issues/152681 |
When TEST_GIT_URL is used the CASEDIR should assign the repo based on this variable. As such the investigation uses the correct test repo to clone jobs.