-
Notifications
You must be signed in to change notification settings - Fork 87
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
Allow --hostname
to receive a comma separated list of hosts and work on them in parallel
#195
Conversation
Note, spec tests on my development machine were not passing 100%, but neither were they 100% on the master branch, either. My testing showed about the same level of pass/fail on both branches, so I assumed my branch passing at the same rate as the master branch meant that I could check the passing tests box. |
Looks like my changes broke testing in Travis-CI, though. So, I'll have to go back and look through those to see what's busted. |
f1a3a74
to
f0582a2
Compare
f0582a2
to
14ccbd4
Compare
14ccbd4
to
f543fe9
Compare
Now all tests pass, except that Travis is having some issue with Bundler in the Ruby 2.4 Rubocop tests:
|
Thanks for submitting this. I'll see if I can get Travis passing, perhaps by updating rake or something. |
Hey @EdgeJ I think I got this figured out - it looks like the error you ran in to was widespread and well known across the platform a while back. The thing that ultimately got the build passing in my branch was to remove this line from
Want to give that a try in your branch to see if that gets you ✅ ? |
Fixes issues with Rubocop checks failing in CI.
@kpaulisse that did the trick! |
Cool, I'll get to reviewing the code soon then. Glad to hear it worked. |
I would suggest you change |
@EdgeJ I'm attempting to try your changes. I've built the ruby gem from your git repository When I run oc-d from the command line with a single node it works as expected However, when I add a second comma separated node, I receive Any ideas? |
@BarnumD I see what the issue is. Before the |
935fac6
to
ad94847
Compare
ad94847
to
395ba13
Compare
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.
Thank you for submitting this PR. I apologize that it took so long to be reviewed. This will be included in octocatalog-diff release 1.5.4 later this week. (I made a follow-up commit on that branch to make it so that parallel
doesn't get used when only a single hostname is supplied, but of course when there are 2 or more hosts specified, the parallel
logic you wrote will be invoked.)
Overview
This pull request changes the hostname option to accept a string of multiple, comma separated hosts to diff and runs the diffs in parallel.
This changeset allows for octocatalog-diff to run against multiple hosts without having to resort to using some sort of loop (e.g. bash for loop) to iterate against the hosts. My team currently uses octocatalog-diff in a CI setup to verify changes against multiple hosts before pushing up changes to our production branch, and it is currently both slow and somewhat inelegant to implement.
These changes allow users to set up a CI system to run against many hosts to get a better picture of how changes might affect the overall environment by adding multiple hosts to the
-n
or--hostname
option in a comma separated list, e.g.This also uses the
parallel
gem to do the diffing in parallel to greatly speed up the operation from either using shell loops or simply using ruby iteration (i.e.nodes.each do
). By my calculations (using the Unixtime
utility and running against two hosts), this results in a speedup of 2x:Checklist
rake
in your checkout directory, or review the CI job triggered whenever you push to a pull request.rake coverage:spec
or ignoring untestable sections of code with# :nocov
comments. If you need help getting to 100% coverage please ask; however, don't just submit code with no tests..gem
file into the vendor/cache directory./cc [related issues] [teams and individuals, making sure to mention why you're CC-ing them]