-
Notifications
You must be signed in to change notification settings - Fork 90
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
Plugins: Test harness, test fixture, docs, and local-type example #356
Conversation
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
…ection setup Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
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.
Thanks @clintoncwolfe ! Nice examples here
docs/plugins.md
Outdated
|
||
Required. Use the `name` call to register your plugin. Pass a String, which should have the 'train-' portion removed. | ||
|
||
#### option |
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.
These still need filled out I think.
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.
I need help on this - I don't know what is needed. I've filled out a skeleton, with TODOs.
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.
Looks great @clintoncwolfe, just a few spelling/grammatical things.
You can probably ignore the train-test-fixture
feedback...not sure where to put it.
|
||
### Installing Train Plugins outside of InSpec | ||
|
||
If you need a train plugin installed, and `inspec plugin` is not available to you, you can install a train plugin like any other gem. Just be sure to use the `gem` binary that comes with the application you wish to extend. For example, to add a Train Plugin to a ChefDK installation, use: |
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.
I'm not sure we support adding gems to ChefDK
. It is intended to be a bundled distribution.
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.
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.
ChefDK should always have train
but the example is fine imo.
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.
I only worry that a user will add a gem and pull in a dep that will break ChefDK in some way.
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 deps have issues it should not install and error just like a bundle but retain functionality. If they want to install a new Train on their DevKit that is their call.
test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/platform.rb
Show resolved
Hide resolved
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Signed-off-by: Jared Quick <jquick@chef.io>
docs/plugins.md
Outdated
|
||
#### local? | ||
|
||
TODO | ||
This flag helps Train decide what detection to use for OS based platforms. This should be set to `true` if your transport target resides in the same instance you are running train from. This setting is not needed for API transports or transports who do not use platform detection. |
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.
I love the anthropomorphism, but might go with that do not use
here.
docs/plugins.md
Outdated
Platform detection is used if you do not specify a platform method for your transport. Currently it is only used for OS (Unix, Windows) platforms. The detection system will run a series of commands on your target to try and determine what platform it is. This information can be found here [OS Specifications](https://github.com/inspec/train/blob/master/lib/train/platforms/detect/specifications/os.rb). | ||
|
||
When using a API or a fixed platform for your transport its suggested you skip the detection process and specify a direct platform. Here is an example: |
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.
an API
? EDIT: Actually I'm not even sure here...English is hard.
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.
it's
though I'm sure of 😄
Signed-off-by: Jared Quick <jquick@chef.io>
Signed-off-by: Jared Quick <jquick@chef.io>
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.
Thanks @clintoncwolfe
Signed-off-by: Jared Quick <jquick@chef.io>
This PR contains few changes to Train itself, but adds many things to the source tree.
Related: inspec/inspec#3444
Related: inspec/inspec#3421
attn: @chris-rock
NOTE: until this is merged (and a gem is built), you will need to check out this branch, then locally edit examples/plugins/train-local-rot13/Gemfile to add this line:
Without this, the example plugin's tests will not be able to find the lib/train/plugin_test_helper.rb (which exists on this branch, not yet in a gem).