-
Notifications
You must be signed in to change notification settings - Fork 16
Fix #327 and #326 Tests and docs for --cli-version and --path options #414
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,6 @@ Metrics/AbcSize: | |
Exclude: | ||
- 'lib/vagrant-service-manager/command.rb' | ||
- 'Rakefile' | ||
|
||
Lint/Eval: | ||
Enabled: false | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,10 +223,16 @@ Similarly, you can use `$ vagrant service-manager status openshift`, | |
|
||
If you need to install the client binary for a specified service, use: + | ||
|
||
`vagrant service-manager install-cli [service]` + | ||
`vagrant service-manager install-cli [service] [options]` + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
The possible options for service are `docker` and `openshift`. + | ||
|
||
The following options can be used: + | ||
|
||
`--cli-version value`:: Specify the version of the binary as value to be installed + | ||
`--path value`:: Specify the absolute or relative path as value where the binary should be installed + | ||
`-h, --help`:: Prints help for the specific command being run. | ||
|
||
As per default, binaries are downloaded to | ||
`$VAGRANT_HOME/data/service-manager/bin/<service>/<cli-version>`, where | ||
`$VAGRANT_HOME` defaults to `.vagrant.d` in your home directory. | ||
|
@@ -236,11 +242,11 @@ As per default, binaries are downloaded to | |
To install client binary for Docker: | ||
|
||
---------------------------------------------------------------------------------------------------- | ||
$ vagrant service-manager install-cli docker | ||
# Binary already available at /home/johndoe/.vagrant.d/data/service-manager/bin/docker/1.9.1/docker | ||
$ vagrant service-manager install-cli docker --cli-version 1.9.1 --path /home/johndoe/bin/docker | ||
# Binary already available at /home/johndoe/bin/docker | ||
# run binary as: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
# docker <command> | ||
export PATH=/home/johndoe/.vagrant.d/data/service-manager/bin/docker/1.9.1:$PATH | ||
export PATH=/home/johndoe/bin:$PATH | ||
|
||
# run following command to configure your shell: | ||
# eval "$(VAGRANT_NO_COLOR=1 vagrant service-manager install-cli docker | tr -d '\r')" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,14 @@ Feature: Command output from various OpenShift related commands in ADB | |
Then the exit status should be 0 | ||
And the binary "oc" should be installed | ||
|
||
When I run `bundle exec vagrant service-manager install-cli openshift --cli-version 1.3.0` | ||
Then the exit status should be 0 | ||
And the binary "oc" of service "openshift" should be installed with version "1.3.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 I created issue #415 to follow up on what's going on with CI and why we did not get test failures when some of the tests were clearly wrong. We need to get to the bottom of this, otherwise we cannot trust CI results, in particular since these tests are not run per default on the dev machine |
||
|
||
When I evaluate and run `bundle exec vagrant service-manager install-cli openshift --path #{ENV['VAGRANT_HOME']}/oc` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 I like how the tests look like now. Also nice to use the same path in the When and Then clause and that it gets transparently interpolated. |
||
Then the exit status should be 0 | ||
And the binary should be installed in path "#{ENV['VAGRANT_HOME']}/oc" | ||
|
||
When I successfully run `bundle exec vagrant reload` | ||
And I successfully run `bundle exec vagrant service-manager status openshift` | ||
Then the exit status should be 0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,19 @@ Feature: Command output from various OpenShift related commands in CDK | |
Then the exit status should be 0 | ||
And the binary "oc" should be installed | ||
|
||
When I run `bundle exec vagrant service-manager install-cli openshift --cli-version 1.3.0` | ||
Then the exit status should be 0 | ||
And the binary "oc" of service "openshift" should be installed with version "1.3.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 I think this is better |
||
|
||
When I evaluate and run `bundle exec vagrant service-manager install-cli openshift --path #{ENV['VAGRANT_HOME']}/oc` | ||
Then the exit status should be 0 | ||
And the binary should be installed in path "#{ENV['VAGRANT_HOME']}/oc" | ||
|
||
When I successfully run `bundle exec vagrant reload` | ||
And I successfully run `bundle exec vagrant service-manager status openshift` | ||
Then the exit status should be 0 | ||
And the service "openshift" should be running | ||
|
||
Examples: | ||
| box | provider | ip | | ||
| cdk | virtualbox | 10.10.10.42 | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,9 @@ Feature: Command behavior of client side tools installation | |
A supported service. For example: docker, kubernetes or openshift. | ||
|
||
Options: | ||
-h, --help print this help | ||
-h, --help print this help | ||
--cli-version binary version to install | ||
--path absolute or relative path where to install the binary | ||
|
||
Example: | ||
vagrant service-manager install-cli docker | ||
|
@@ -52,6 +54,14 @@ Feature: Command behavior of client side tools installation | |
Then the exit status should be 0 | ||
And the binary "docker" should be installed | ||
|
||
When I run `bundle exec vagrant service-manager install-cli docker --cli-version 1.12.1` | ||
Then the exit status should be 0 | ||
And the binary "docker" of service "docker" should be installed with version "1.12.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this step is also quite nice now. Allows us to do a dedicated check in its implementation |
||
|
||
When I evaluate and run `bundle exec vagrant service-manager install-cli docker --path #{ENV['VAGRANT_HOME']}/docker` | ||
Then the exit status should be 0 | ||
And the binary should be installed in path "#{ENV['VAGRANT_HOME']}/docker" | ||
|
||
Examples: | ||
| box | provider | ip | | ||
| adb | virtualbox | 10.10.10.42 | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,9 +160,11 @@ def self.fetch_existing_oc_binary_path_in_windows | |
path_string = ENV['PATH'] | ||
|
||
separator = ':' unless path_string.include?(';') | ||
path_string.split(separator).detect do |dir_path| | ||
oc_path_dir = path_string.split(separator).detect do |dir_path| | ||
File.exist? "#{dir_path}\\oc.exe" | ||
end | ||
|
||
oc_path_dir.nil? ? nil : oc_path_dir + '\oc.exe' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We let this sneak in for now ;-) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hferentschik I had already explained it 😄 So, in windows, devsuite download the oc binary and place it in Previously, I was only checking through the directory paths presents in $PATH and checking the existence of dir_path + '\oc.exe' file. On first detection, I return the dir_path only. However, I need the actual full path not Probably, I should have changed this line to
|
||
end | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,7 +104,9 @@ en: | |
A supported service. For example: docker, kubernetes or openshift. | ||
|
||
Options: | ||
-h, --help print this help | ||
-h, --help print this help | ||
--cli-version binary version to install | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we are not providing any short options for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hferentschik , no. Do you think it is mandatory? we have other options like --script-readable etc too which doesn't have short options There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Works for me. Just wanted to make sure we are not missing something. |
||
--path absolute or relative path where to install the binary | ||
|
||
Example: | ||
vagrant service-manager install-cli docker | ||
|
@@ -199,6 +201,8 @@ en: | |
# eval "$(VAGRANT_NO_COLOR=1 vagrant service-manager install-cli %{service} | tr -d '\r')" | ||
service_not_enabled: |- | ||
'%{service}' service is not enabled. | ||
invalid_binary_path: |- | ||
Directory path %{dir_path} is invalid or doesn't exist. | ||
unsupported_version: |- | ||
Something went wrong to find the correct download link. | ||
We recommend you to use '--cli-version' for your desired client version. | ||
|
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 guess this might be needed, right?
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.
Yes @hferentschik