-
Notifications
You must be signed in to change notification settings - Fork 717
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
DRAFT: Add script to build tests #13029
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
Things left to do:
|
return (filename.endswith('.pass.sh') | ||
or filename.endswith('.fail.sh') or | ||
filename.endswith('.notapplicable.sh')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
str.endswith()
takes a tuple, so you can probably just
return (filename.endswith('.pass.sh') | |
or filename.endswith('.fail.sh') or | |
filename.endswith('.notapplicable.sh')) | |
return filename.endswith(('.pass.sh', '.fail.sh', '.notapplicable.sh')) |
Code Climate has analyzed commit 99e5f9b and detected 5 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 61.9% (0.0% change). View more on Code Climate. |
for i in range(n): | ||
end = start + chunk_size + (1 if i < remainder else 0) | ||
inters.append(iter(items[start:end])) | ||
start = end | ||
return inters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't mind interleaving the split, you could use python's array slicing "step" property.
Given 3 workers and a total of 10 rules, you can assign rules to them like this:
>>> a = [1,2,3,4,5,6,7,8,9,10]
>>> a[0::3]
[1, 4, 7, 10]
>>> a[1::3]
[2, 5, 8]
>>> a[2::3]
[3, 6, 9]
where the first (start
) number is worker index, and the second (step
) number is the total number of workers.
This is what we use in Contest to avoid any off-by-one problems and ensure no rule is left behind, while making things just simpler and evenly distributing rule complexity across all workers (as complex/simple rules tend to alphabetically bunch up).
Description:
This is a very rough draft a script that renders the Automatus tests for a given product. The script will be clean up once the general form is agreed upon.
Rationale:
Make testing with thin data streams possible.
Review Hints:
./build_product rhel10
python ./build-scripts/build_tests.py --build-config-yaml build/build_config.yml --product-yaml products/rhel10/product.yml --output build/rhel10/tests --resolved-rules-dir build/rhel10/rules