Conversation
|
There is an error in CI: |
|
I'll work on this now. I pushed too soon! |
schema/check_schemas.py
Outdated
| num_processors = multiprocessing.cpu_count() | ||
| logging.info('Schema validation: %s processors for %s schema validations', num_processors, len(file_names)) | ||
| def validate_all_schema(validator, file_names): | ||
| if not validator.options.run_serial: |
There was a problem hiding this comment.
flip the "then" and "else" branches so that you can avoid using not in your condition test.
schema/check_test_output.py
Outdated
|
|
||
| # file_base + output_path | ||
| test_output_path = schema_options.schema_base | ||
| print('!!! TEST OUTPUT PATH %s' % (test_output_path)) |
There was a problem hiding this comment.
no prints. only logging, and if necessary
schema/schema_validator.py
Outdated
|
|
||
| # Check for all the possible files | ||
| json_file_pattern = os.path.join(self.test_data_base, '*', '*.json') | ||
| logging.info('JSON FILE_PATTERN: %s', json_file_pattern); |
There was a problem hiding this comment.
for here and elsewhere (above & below): change log level to debug if this is not useful to see in a log file (ex: looking at a CI run)
schema/schema_validator.py
Outdated
| result = p.map(self.check_test_data_against_schema, schema_test_data) | ||
| return result | ||
| def check_all_test_data_schema(self, schema_test_data): | ||
| if not self.run_serial: |
schema/schema_validator.py
Outdated
| for test_data in schema_test_data: | ||
| results.append(self.check_test_data_against_schema(test_data)) |
There was a problem hiding this comment.
could turn the instantiation + initialization of results into a FP-style map. Not sure how Python does that.
schema/schema_validator.py
Outdated
| return results, test_validation_plans | ||
| else: | ||
| logging.info('JSON test output serially validation on %s files!', len(test_validation_plans)) | ||
| for test_data in test_validation_plans: |
There was a problem hiding this comment.
ditto. also, does results need to be initialized before you call .append on it?
schema/schema_validator.py
Outdated
| num_processors = mp.cpu_count() | ||
| logging.info('JSON test output validation: %s processors for %s plans', num_processors, | ||
| len(test_validation_plans)) | ||
| if not self.run_serial: |
| results = self.parallel_check_test_data_schema(schema_test_info) | ||
| results = self.check_all_test_data_schema(schema_test_info) | ||
|
|
||
| for result_data in results: |
There was a problem hiding this comment.
can replace the instantiation, for loop, and if with an FP-style map + filter.
|
Craig Cornelius seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
#386