Skip to content

Commit

Permalink
Merge pull request apache#6234: [BEAM-5218] Set test name in the pipe…
Browse files Browse the repository at this point in the history
…line name
  • Loading branch information
tweise authored Aug 27, 2018
2 parents 7b46660 + 8137c5e commit b99ce83
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from __future__ import absolute_import
from __future__ import print_function

import inspect
import logging
import platform
import signal
Expand Down Expand Up @@ -149,7 +150,16 @@ def _maybe_kill_subprocess(cls):
time.sleep(0.1)

def create_options(self):
options = PipelineOptions()
def get_pipeline_name():
for _, _, _, method_name, _, _ in inspect.stack():
if method_name.find('test') != -1:
return method_name
return 'unknown_test'

# Set the job name for better debugging.
options = PipelineOptions.from_dictionary({
'job_name': get_pipeline_name() + '_' + str(time.time())
})
options.view_as(PortableOptions).job_endpoint = self._get_job_endpoint()
return options

Expand Down

0 comments on commit b99ce83

Please sign in to comment.