-
-
Notifications
You must be signed in to change notification settings - Fork 13
Serial flag python #430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sven-oly
wants to merge
19
commits into
unicode-org:main
Choose a base branch
from
sven-oly:serial_flag_python
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Serial flag python #430
Changes from 2 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e755a6c
Starting to add serial flag for schema testing
sven-oly febe481
Merge branch 'unicode-org:main' into serial_flag_python
sven-oly c6f5b22
--a
sven-oly 7da5f8f
Merge remote-tracking branch 'upstream/main' into serial_flag_python
sven-oly cd0a3e1
Merge remote-tracking branch 'origin/serial_flag_python' into serial_…
sven-oly 4a3f16e
Restructuring command line arguments for Schema processing
sven-oly f322376
Merge remote-tracking branch 'upstream/main' into serial_flag_python
sven-oly 4571c4f
Adding serial running to schema validation
sven-oly 4fe9432
Update generator with schema_base
sven-oly b79ab7a
Simplifying some code
sven-oly de30571
Fix path for check_schemas.py
sven-oly 71bd8d6
Synch
sven-oly fd64f76
Remove diff
sven-oly 054a861
Remove file
sven-oly de19fb8
Revising as suggested
sven-oly a630a03
Fix error in return values
sven-oly c3f75c1
Reply to gemini comment
sven-oly 7491a1f
Merge branch 'main' into serial_flag_python
a08251f
Remove extra output
sven-oly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,10 @@ | |
| import schema_validator | ||
| from schema_files import ALL_TEST_TYPES | ||
|
|
||
| # To get commanlin arguments | ||
| sys.path.append('../testdriver') | ||
| from ddtargs import schemaArgs | ||
|
|
||
|
|
||
| class ValidateSchema: | ||
| def __init__(self, schema_base='.'): | ||
|
|
@@ -61,17 +65,26 @@ def save_schema_validation_summary(self, validation_status): | |
|
|
||
|
|
||
| def parallel_validate_schema(validator, file_names): | ||
| num_processors = multiprocessing.cpu_count() | ||
| logging.info('Schema validation: %s processors for %s schema validations', num_processors, len(file_names)) | ||
|
|
||
| processor_pool = multiprocessing.Pool(num_processors) | ||
| # How to get all the results | ||
| result = None | ||
| try: | ||
| result = processor_pool.map(validator.validate_schema_file, file_names) | ||
| except multiprocessing.pool.MaybeEncodingError as error: | ||
| pass | ||
| return result | ||
| if not validator.options.run_serial: | ||
|
||
| num_processors = multiprocessing.cpu_count() | ||
| logging.info('Schema validation: %s processors for %s schema validations', | ||
| num_processors, len(file_names)) | ||
|
|
||
| processor_pool = multiprocessing.Pool(num_processors) | ||
| # How to get all the results | ||
| result = None | ||
| try: | ||
| result = processor_pool.map(validator.validate_schema_file, file_names) | ||
| except multiprocessing.pool.MaybeEncodingError as error: | ||
| pass | ||
| return result | ||
| else: | ||
| results = [] | ||
| logging.info('check_schemas running serially on %s files!', | ||
| len(filenames)) | ||
| for file_name in file_names: | ||
| results.append(validator.validate_schema_file(file_name)) | ||
| return results | ||
|
|
||
|
|
||
| def main(args): | ||
|
|
@@ -83,6 +96,8 @@ def main(args): | |
| # Todo: use setters to initialize validator | ||
| validator.schema_base = '.' | ||
|
|
||
| validator.options = SchemaArgs(args).getOptions() | ||
|
|
||
| if len(args) > 1: | ||
| schema_base = args[1] | ||
| else: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.