Selaa lähdekoodia

Merge pull request #10942 from AttilaVamos/HPCC-19122-improvement-7.0.0

HPCC-19122 Enable for user to specify workunit job name suffix.

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 7 vuotta sitten
vanhempi
commit
ede6715b17
3 muutettua tiedostoa jossa 20 lisäystä ja 1 poistoa
  1. 10 0
      testing/regress/README.rst
  2. 2 0
      testing/regress/ecl-test
  3. 8 1
      testing/regress/hpcc/util/ecl/file.py

+ 10 - 0
testing/regress/README.rst

@@ -62,6 +62,7 @@ Result:
 |                                 exclude subclass(es) of the suite. Default value is 'none'
 |        --handleEclccWarningFile, -w
 |                                 Create/overwrite/delete ECLCC warning file.
+|        --jobnamesuffix suffix   Specify workunit job name suffix.
 |
 
 Important!
@@ -146,6 +147,9 @@ Result:
 |                                 run subclass(es) of the suite. Default value is 'all'
 |        --excludeclass class[,class,...], -e class[,class,...]
 |                                 exclude subclass(es) of the suite. Default value is 'none'
+|        --handleEclccWarningFile, -w
+|                                 Create/overwrite/delete ECLCC warning file.
+|        --jobnamesuffix suffix   Specify workunit job name suffix.
 |        --target [target_cluster_list | all], -t [target_cluster_list | all]
 |                                 run the setup on target cluster(s). If target = 'all' then run setup on all clusters. If undefined the config 'defaultSetupClusters' value will be used.
 |
@@ -196,6 +200,9 @@ Result:
 |                                 run subclass(es) of the suite. Default value is 'all'
 |        --excludeclass class[,class,...], -e class[,class,...]
 |                                 exclude subclass(es) of the suite. Default value is 'none'
+|        --handleEclccWarningFile, -w
+|                                 Create/overwrite/delete ECLCC warning file.
+|        --jobnamesuffix suffix   Specify workunit job name suffix.
 |        --target [target_cluster_list | all], -t [target_cluster_list | all]
 |                                 run the setup on target cluster(s). If target = 'all' then run setup on all clusters. If undefined the config 'defaultSetupClusters' value will be used.
 |        --publish, -p            publish compiled query instead of run.
@@ -252,6 +259,9 @@ Result:
 |                                 run subclass(es) of the suite. Default value is 'all'
 |        --excludeclass class[,class,...], -e class[,class,...]
 |                                 exclude subclass(es) of the suite. Default value is 'none'
+|        --handleEclccWarningFile, -w
+|                                 Create/overwrite/delete ECLCC warning file.
+|        --jobnamesuffix suffix   Specify workunit job name suffix.
 |        --target [target_cluster_list | all], -t [target_cluster_list | all]
 |                                 run the setup on target cluster(s). If target = 'all' then run setup on all clusters. If undefined the config 'defaultSetupClusters' value will be used.
 |        --publish, -p            publish compiled query instead of run.

+ 2 - 0
testing/regress/ecl-test

@@ -167,6 +167,8 @@ class RegressMain:
                                 nargs=1,  default = ['none'],   metavar="class[,class,...]")
         executionParser.add_argument('--handleEclccWarningFile', '-w', help="Create/overwrite/delete ECLCC warning file.",
                                 action='store_true')
+        executionParser.add_argument('--jobnamesuffix', help="Specify workunit job name suffix.", default='',
+                                metavar="suffix")
 
         parser = argparse.ArgumentParser(prog=prog, description=description,  parents=[helperParser, commonParser,  executionParser])
 

+ 8 - 1
testing/regress/hpcc/util/ecl/file.py

@@ -56,6 +56,7 @@ class ECLFile:
             pass
 
     def __init__(self, ecl, dir_a, dir_ex, dir_r, dir_inc, cluster, args):
+        logging.debug("%3d. ECLFile(ecl:%s, cluster:%s).", self.taskId, ecl,  cluster)
         self.dir_ec = os.path.dirname(ecl)
         self.dir_ex = dir_ex
         self.dir_r = dir_r
@@ -84,6 +85,9 @@ class ECLFile:
         self.args = args
         self.eclccWarning = ''
         self.eclccWarningChanges = ''
+        self.jobNameSuffix = args.jobnamesuffix
+        if self.jobNameSuffix != '':
+            self.jobNameSuffix = '-' + self.jobNameSuffix
 
         #If there is a --publish CL parameter then force publish this ECL file
         self.forcePublish=False
@@ -501,7 +505,10 @@ class ECLFile:
         pass
         
     def setJobname(self,  timestamp):
-        self.jobname = self.basename + self.jobnameVersion +"-"+timestamp
+        self.jobname = self.basename + self.jobnameVersion
+        if len(timestamp) > 0:
+            self.jobname += "-" + timestamp
+        self.jobname += self.jobNameSuffix
 
     def getJobname(self):
         return self.jobname