-
Notifications
You must be signed in to change notification settings - Fork 53
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
(maint) Allow setting of abs subdomain #189
(maint) Allow setting of abs subdomain #189
Conversation
Codecov Report
@@ Coverage Diff @@
## main #189 +/- ##
=======================================
Coverage ? 77.46%
=======================================
Files ? 2
Lines ? 142
Branches ? 0
=======================================
Hits ? 110
Misses ? 32
Partials ? 0 Continue to review full report at Codecov.
|
b3b5f83
to
6ecac5b
Compare
Need to fix the spec for ruby 2.5, and finish some manual bolt task runs. |
6ecac5b
to
74400b0
Compare
Provisioning and tearing down relying on default abs-prod:
Switching ABS_SUBDOMAIN to abs_stage and provisioning and tearing down (after switching out the .fog token to match, and removing the /tmp/spec/fixtures/litmus_inventory.yaml...):
|
@jpartlow I've approved the other two 🙂 Please could you merge and rebase this PR, then i'll approve. |
The abs.rb is refactored into a class that is executed only if the task file is the executing program. This allows the spec to load the task and manipulate the class while mocking externals. The webmock gem is used to provide HTTP::Net mocking. The spec is not exhaustive, but hopefully covers enough to validate that the refactor didn't break the task, and that the bug I added in puppetlabs#182 is patched. It could be expanded, and could serve as a template for adding specs for other tasks in the module. It does look to expose an edge case bug of calling the provision task with an inventory directory specified that contains a pre-existing inventory file.
The provision::abs task was hardcoded to abs-prod.k8s.infracore.puppet.net. This made it impossible to use the task to test a new vm available from abs-stage.k8s.infracore.puppet.net prior to making it live in abs-prod. Since the allowed parameters for the task tie into the api expected by Litmus, I added another environment variable here to allow selection of the subdomain. I didn't allow selection of the entire fqdn because having your vm source change entirely based on a hidden env variable seemed dubious to me.
Later versions require Ruby 3. This looks to be a github_changelog_generator dependency. There may be a better solution here? Possibly dropping github_changelog_generator?
74400b0
to
119a5f4
Compare
The provision::abs task was hardcoded to
abs-prod.k8s.infracore.puppet.net. This made it impossible to use the
task to test a new vm available from abs-stage.k8s.infracore.puppet.net
prior to making it live in abs-prod.
Since the allowed parameters for the task tie into the api expected by
Litmus, I added another environment variable here to allow selection of
the subdomain. I didn't allow selection of the entire fqdn because
having your vm source change entirely based on a hidden env variable
seemed dubious to me.
This is based on top of #186 for test coverage. We could either merge this and close that, or merge that and I'll rebase this...