AnandInguva commented on code in PR #28385:
URL: https://github.com/apache/beam/pull/28385#discussion_r1343212860


##########
sdks/python/scripts/run_tox.sh:
##########
@@ -53,18 +53,27 @@ if [[ "$JENKINS_HOME" != "" ]]; then
   export PY_COLORS=1
 fi
 
-if [[ ! -z $2 ]]; then
+# Determine if the second argument is SDK_LOCATION or posargs
+if [[ -f "$1" ]]; then  # Check if the argument corresponds to a file
   SDK_LOCATION="$1"
-  shift;
-  tox -c tox.ini run --recreate -e "$TOX_ENVIRONMENT" --installpkg 
"$SDK_LOCATION" -- "$@"
-else
-  tox -c tox.ini run --recreate -e "$TOX_ENVIRONMENT"
+  shift
+fi
+
+# If SDK_LOCATION is identified and there are still arguments left, those are 
posargs.
+if [[ ! -z "$SDK_LOCATION" ]]; then
+  if [[ $# -gt 0 ]]; then  # There are posargs
+    tox -c tox.ini run --recreate -e "$TOX_ENVIRONMENT" --installpkg 
"$SDK_LOCATION" -- "$@"
+  else
+    tox -c tox.ini run --recreate -e "$TOX_ENVIRONMENT" --installpkg 
"$SDK_LOCATION"
+  fi
+else  # No SDK_LOCATION; all arguments are posargs
+  tox -c tox.ini run --recreate -e "$TOX_ENVIRONMENT" -- "$@"
 fi
 
 exit_code=$?
 # Retry once for the specific exit code 245.
 if [[ $exit_code == 245 ]]; then
-  tox -c tox.ini run --recreate -e "$TOX_ENVIRONMENT"
+  tox -c tox.ini run --recreate -e "$TOX_ENVIRONMENT" --installpkg 
"$SDK_LOCATION"

Review Comment:
   I think we should revert back to the original logic. This was unintended 
change. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to