diff --git a/executors/node/executor.js b/executors/node/executor.js index 5838da1d..31c41a68 100644 --- a/executors/node/executor.js +++ b/executors/node/executor.js @@ -255,7 +255,10 @@ rl.on('line', function(line) { if (test_type == "segmenter") { outputLine = segmenter.testSegmenter(parsedJson); } else { - outputLine = {'error': 'unknown test type', + // UNSUPPORTED TEST TYPE! + outputLine = {'label': 'UNKNOWN', + 'error': 'unknown test type', + 'error_detail': 'Requested unsupported test type', 'test_type': test_type, 'unsupported_test': test_type}; } diff --git a/schema/collation/test_schema.json b/schema/collation/test_schema.json index bb65e68c..472c465f 100644 --- a/schema/collation/test_schema.json +++ b/schema/collation/test_schema.json @@ -111,7 +111,11 @@ "warning": { "description": "Present when data has a problem", "type": "string" - } + }, + "hash_id": { + "description": "Has value of the JSON string omtting label value", + "type": "integer" + } }, "required": [ "label", diff --git a/schema/lang_names/test_schema.json b/schema/lang_names/test_schema.json index dd956f83..b05c8d3e 100644 --- a/schema/lang_names/test_schema.json +++ b/schema/lang_names/test_schema.json @@ -55,6 +55,10 @@ "locale_label": { "description": "locale tag of the language being described ", "type": "string" + }, + "hash_id": { + "description": "Has value of the JSON string omtting label value", + "type": "integer" } }, "additionalProperties": false diff --git a/schema/likely_subtags/test_schema.json b/schema/likely_subtags/test_schema.json index d684b411..4d794bc2 100644 --- a/schema/likely_subtags/test_schema.json +++ b/schema/likely_subtags/test_schema.json @@ -85,6 +85,10 @@ "option": { "description": "Type of processing requested", "enum": ["maximize", "minimize", "minimizeFavorScript", "minimizeFavorRegion"] + }, + "hash_id": { + "description": "Has value of the JSON string omtting label value", + "type": "integer" } } }, diff --git a/schema/number_format/test_schema.json b/schema/number_format/test_schema.json index 5d325760..3ad92a2a 100644 --- a/schema/number_format/test_schema.json +++ b/schema/number_format/test_schema.json @@ -182,6 +182,10 @@ "default": "auto" } } + }, + "hash_id": { + "description": "Has value of the JSON string omtting label value", + "type": "integer" } }, "required": [ diff --git a/testdriver/testplan.py b/testdriver/testplan.py index 29909dca..acecd2a5 100644 --- a/testdriver/testplan.py +++ b/testdriver/testplan.py @@ -500,9 +500,12 @@ def send_one_line(self, input_line): capture_output=True, env=self.exec_env, shell=True) - if not result.returncode: + if result.returncode == 0: + # Command worked! return result.stdout else: + input = json.loads(input_line.replace('#EXIT', '').strip()) + # non-zero return code indicates some kind of problem logging.debug('$$$$$$$$$$$$$$$$ ---> return code: %s', result.returncode) logging.debug(' ----> INPUT LINE= >%s<', input_line) logging.debug(' ----> STDOUT= >%s<', result.stdout) @@ -512,19 +515,23 @@ def send_one_line(self, input_line): logging.error(' !!!!!! %s' % self.run_error_message) # Handle problems with decoding errors and other unknowns. - error_result = {'label': 'UNKNOWN', - 'input_data': input_line, - 'error': self.run_error_message + error_result = {'label': input['label'], + 'input_data': input, + 'error': self.run_error_message, + 'error_detail': 'severe error from subprocess ' + + str(result.returncode) } return json.dumps(error_result) except BaseException as err: - logging.error('Err = %s', err) - input = json.loads(input_line.replace('#EXIT', '').strip()) - error_result = {'label': input['label'], - 'input_data': input, - 'error': err - } - return json.dumps(error_result) - + try: + input = json.loads(input_line.replace('#EXIT', '').strip()) + logging.error('Err = %s', err) + error_result = {'label': input['label'], + 'input_data': input, + 'error': err + } + return json.dumps(error_result) + except BaseException as error: + logging.error('testplan.py: Error = %s. input_line = <%s>', err, input_line) return None