grundprinzip commented on code in PR #37288:
URL: https://github.com/apache/spark/pull/37288#discussion_r929797109


##########
python/run-tests.py:
##########
@@ -107,20 +118,26 @@ def run_individual_python_test(target_dir, test_name, 
pyspark_python):
     env["PYSPARK_SUBMIT_ARGS"] = " ".join(spark_args)
 
     output_prefix = get_valid_filename(pyspark_python + "__" + test_name + 
"__").lstrip("_")
-    per_test_output = tempfile.NamedTemporaryFile(prefix=output_prefix, 
suffix=".log")
+
+    if keep_test_output:
+        # The location is unique because the test is already in a unique 
directory.

Review Comment:
   Ok, so what about we do the following:
   
   * I will add an argument that allows us to override the target directory so 
that we harmonize the way it's used today and not implicitly create the 
`target` name.
   
   The only thing I'm wondering though is from a developer feeling, you want to 
retain the output, but now you need to remember two things, one which is that 
the option is actually a path and you need to specify a path name.
   
   Whereas in the other case, the developer needs to remember to just specify 
`-k` to keep the output, and if it's supposed to survive `mvn clean` use 
`--target myothertarget`. I personally find the flag easier to use but I will 
not push back if you only want to use the target directory.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to