MuranoCLI 2.2.4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/.agignore +3 -0
  3. data/.gitignore +18 -1
  4. data/.rubocop.yml +222 -0
  5. data/.trustme.sh +185 -0
  6. data/.trustme.vim +24 -0
  7. data/Gemfile +23 -4
  8. data/LICENSE.txt +1 -1
  9. data/MuranoCLI.gemspec +43 -8
  10. data/README.markdown +9 -11
  11. data/Rakefile +187 -143
  12. data/TODO.taskpaper +2 -2
  13. data/bin/murano +51 -52
  14. data/docs/basic_example.rst +436 -0
  15. data/docs/completions/murano_completion-bash +3484 -0
  16. data/docs/demo.md +32 -32
  17. data/docs/develop.rst +391 -0
  18. data/lib/MrMurano.rb +21 -7
  19. data/lib/MrMurano/Account.rb +159 -174
  20. data/lib/MrMurano/Business.rb +381 -0
  21. data/lib/MrMurano/Config-Migrate.rb +32 -26
  22. data/lib/MrMurano/Config.rb +407 -128
  23. data/lib/MrMurano/Content.rb +191 -0
  24. data/lib/MrMurano/Gateway.rb +489 -0
  25. data/lib/MrMurano/Keystore.rb +48 -0
  26. data/lib/MrMurano/Passwords.rb +103 -0
  27. data/lib/MrMurano/ProjectFile.rb +121 -79
  28. data/lib/MrMurano/ReCommander.rb +114 -10
  29. data/lib/MrMurano/Setting.rb +90 -0
  30. data/lib/MrMurano/Solution-ServiceConfig.rb +89 -45
  31. data/lib/MrMurano/Solution-Services.rb +461 -166
  32. data/lib/MrMurano/Solution-Users.rb +70 -31
  33. data/lib/MrMurano/Solution.rb +372 -13
  34. data/lib/MrMurano/SolutionId.rb +73 -0
  35. data/lib/MrMurano/SyncRoot.rb +137 -0
  36. data/lib/MrMurano/SyncUpDown.rb +594 -284
  37. data/lib/MrMurano/Webservice-Cors.rb +71 -0
  38. data/lib/MrMurano/Webservice-Endpoint.rb +234 -0
  39. data/lib/MrMurano/Webservice-File.rb +193 -0
  40. data/lib/MrMurano/Webservice.rb +51 -0
  41. data/lib/MrMurano/commands.rb +18 -15
  42. data/lib/MrMurano/commands/business.rb +300 -6
  43. data/lib/MrMurano/commands/completion-bash.erb +166 -0
  44. data/lib/MrMurano/commands/{zshcomplete.erb → completion-zsh.erb} +0 -0
  45. data/lib/MrMurano/commands/completion.rb +76 -39
  46. data/lib/MrMurano/commands/config.rb +108 -44
  47. data/lib/MrMurano/commands/content.rb +115 -72
  48. data/lib/MrMurano/commands/cors.rb +29 -14
  49. data/lib/MrMurano/commands/devices.rb +286 -0
  50. data/lib/MrMurano/commands/domain.rb +52 -12
  51. data/lib/MrMurano/commands/gb.rb +24 -9
  52. data/lib/MrMurano/commands/globals.rb +64 -0
  53. data/lib/MrMurano/commands/init.rb +377 -155
  54. data/lib/MrMurano/commands/keystore.rb +92 -82
  55. data/lib/MrMurano/commands/link.rb +300 -0
  56. data/lib/MrMurano/commands/login.rb +74 -11
  57. data/lib/MrMurano/commands/logs.rb +63 -32
  58. data/lib/MrMurano/commands/mock.rb +57 -29
  59. data/lib/MrMurano/commands/password.rb +57 -39
  60. data/lib/MrMurano/commands/postgresql.rb +127 -94
  61. data/lib/MrMurano/commands/settings.rb +203 -0
  62. data/lib/MrMurano/commands/show.rb +79 -38
  63. data/lib/MrMurano/commands/solution.rb +423 -5
  64. data/lib/MrMurano/commands/solution_picker.rb +547 -0
  65. data/lib/MrMurano/commands/status.rb +195 -61
  66. data/lib/MrMurano/commands/sync.rb +78 -39
  67. data/lib/MrMurano/commands/timeseries.rb +71 -55
  68. data/lib/MrMurano/commands/tsdb.rb +113 -87
  69. data/lib/MrMurano/commands/usage.rb +57 -15
  70. data/lib/MrMurano/hash.rb +100 -10
  71. data/lib/MrMurano/http.rb +187 -43
  72. data/lib/MrMurano/makePretty.rb +16 -14
  73. data/lib/MrMurano/optparse.rb +2178 -0
  74. data/lib/MrMurano/progress.rb +138 -0
  75. data/lib/MrMurano/schema/resource-v1.0.0.yaml +32 -0
  76. data/lib/MrMurano/template/projectFile.murano.erb +16 -13
  77. data/lib/MrMurano/verbosing.rb +166 -29
  78. data/lib/MrMurano/version.rb +30 -1
  79. data/spec/Account-Passwords_spec.rb +21 -4
  80. data/spec/Account_spec.rb +69 -146
  81. data/spec/Business_spec.rb +290 -0
  82. data/spec/ConfigFile_spec.rb +1 -0
  83. data/spec/ConfigMigrate_spec.rb +12 -8
  84. data/spec/Config_spec.rb +40 -34
  85. data/spec/Content_spec.rb +363 -0
  86. data/spec/GatewayBase_spec.rb +54 -0
  87. data/spec/GatewayDevice_spec.rb +321 -0
  88. data/spec/GatewayResource_spec.rb +266 -0
  89. data/spec/GatewaySettings_spec.rb +120 -0
  90. data/spec/Http_spec.rb +18 -8
  91. data/spec/Mock_spec.rb +2 -2
  92. data/spec/ProjectFile_spec.rb +25 -14
  93. data/spec/Setting_spec.rb +110 -0
  94. data/spec/Solution-ServiceConfig_spec.rb +44 -5
  95. data/spec/Solution-ServiceEventHandler_spec.rb +23 -14
  96. data/spec/Solution-ServiceModules_spec.rb +47 -37
  97. data/spec/Solution-UsersRoles_spec.rb +10 -8
  98. data/spec/Solution_spec.rb +17 -8
  99. data/spec/SyncRoot_spec.rb +46 -20
  100. data/spec/SyncUpDown_spec.rb +437 -201
  101. data/spec/Verbosing_spec.rb +12 -4
  102. data/spec/{Solution-Cors_spec.rb → Webservice-Cors_spec.rb} +23 -20
  103. data/spec/{Solution-Endpoint_spec.rb → Webservice-Endpoint_spec.rb} +43 -41
  104. data/spec/{Solution-File_spec.rb → Webservice-File_spec.rb} +44 -33
  105. data/spec/Webservice-Setting_spec.rb +89 -0
  106. data/spec/_workspace.rb +4 -4
  107. data/spec/cmd_business_spec.rb +9 -4
  108. data/spec/cmd_common.rb +44 -1
  109. data/spec/cmd_content_spec.rb +43 -17
  110. data/spec/cmd_cors_spec.rb +4 -4
  111. data/spec/cmd_device_spec.rb +61 -16
  112. data/spec/cmd_domain_spec.rb +29 -6
  113. data/spec/cmd_init_spec.rb +281 -126
  114. data/spec/cmd_keystore_spec.rb +3 -3
  115. data/spec/cmd_link_spec.rb +98 -0
  116. data/spec/cmd_password_spec.rb +1 -1
  117. data/spec/cmd_setting_application_spec.rb +260 -0
  118. data/spec/cmd_setting_product_spec.rb +220 -0
  119. data/spec/cmd_status_spec.rb +223 -114
  120. data/spec/cmd_syncdown_spec.rb +115 -35
  121. data/spec/cmd_syncup_spec.rb +68 -15
  122. data/spec/cmd_usage_spec.rb +35 -8
  123. data/spec/fixtures/dumped_config +6 -4
  124. data/spec/fixtures/gateway_resource_files/resources.notyaml +12 -0
  125. data/spec/fixtures/gateway_resource_files/resources.yaml +13 -0
  126. data/spec/fixtures/gateway_resource_files/resources_invalid.yaml +13 -0
  127. data/spec/fixtures/mrmuranorc_deleted_bob +0 -2
  128. data/spec/fixtures/product_spec_files/lightbulb.yaml +20 -13
  129. data/spec/fixtures/{syncable_content → syncable_conflict}/services/devdata.lua +1 -1
  130. data/spec/fixtures/{syncable_content → syncable_conflict}/services/timers.lua +0 -0
  131. data/spec/spec_helper.rb +5 -0
  132. metadata +262 -171
  133. data/bin/mr +0 -8
  134. data/lib/MrMurano/Product-1P-Device.rb +0 -145
  135. data/lib/MrMurano/Product-Resources.rb +0 -205
  136. data/lib/MrMurano/Product.rb +0 -358
  137. data/lib/MrMurano/Solution-Cors.rb +0 -47
  138. data/lib/MrMurano/Solution-Endpoint.rb +0 -191
  139. data/lib/MrMurano/Solution-File.rb +0 -166
  140. data/lib/MrMurano/commands/assign.rb +0 -57
  141. data/lib/MrMurano/commands/businessList.rb +0 -45
  142. data/lib/MrMurano/commands/product.rb +0 -14
  143. data/lib/MrMurano/commands/productCreate.rb +0 -39
  144. data/lib/MrMurano/commands/productDelete.rb +0 -33
  145. data/lib/MrMurano/commands/productDevice.rb +0 -87
  146. data/lib/MrMurano/commands/productDeviceIdCmds.rb +0 -89
  147. data/lib/MrMurano/commands/productList.rb +0 -45
  148. data/lib/MrMurano/commands/productWrite.rb +0 -27
  149. data/lib/MrMurano/commands/solutionCreate.rb +0 -41
  150. data/lib/MrMurano/commands/solutionDelete.rb +0 -34
  151. data/lib/MrMurano/commands/solutionList.rb +0 -45
  152. data/spec/ProductBase_spec.rb +0 -113
  153. data/spec/ProductContent_spec.rb +0 -162
  154. data/spec/ProductResources_spec.rb +0 -329
  155. data/spec/Product_1P_Device_spec.rb +0 -202
  156. data/spec/Product_1P_RPC_spec.rb +0 -175
  157. data/spec/Product_spec.rb +0 -153
  158. data/spec/Solution-ServiceDevice_spec.rb +0 -176
  159. data/spec/cmd_assign_spec.rb +0 -51
@@ -6,22 +6,22 @@
6
6
  - Clone project: `git clone https://github.com/tadpol/GWE-Multitool.git demo01`
7
7
  - `cd demo01`
8
8
 
9
- - Pick a bussiness: `mr business list`
10
- - Set it: `mr config business.id ZZZZZZZZZ`
9
+ - Pick a business: `murano business list`
10
+ - Set it: `murano config business.id ZZZZZZZZZ`
11
11
 
12
- - Create a product: `mr product create myawesomeproduct`
13
- - Save the result: `mr config product.id YYYYYYYYY`
12
+ - Create a product: `murano product create myawesomeproduct`
13
+ - Save the result: `murano config product.id YYYYYYYYY`
14
14
 
15
- - Set the product definition: `mr config product.spec gwe-multitool.yaml`
16
- - Set the directory to look for specs. `mr config location.specs spec`
17
- - Sync the product definition up: `mr syncup -V --specs`
15
+ - Set the product definition: `murano config product.spec gwe-multitool.yaml`
16
+ - Set the directory to look for specs. `murano config location.specs spec`
17
+ - Sync the product definition up: `murano syncup -V --specs`
18
18
 
19
- - Create a solution: `mr solution create myawesomesolution`
20
- - Save the result: `mr config solution.id XXXXXX`
21
- - Assign the product to the solution: `mr assign set`
19
+ - Create an application: `murano application create myawesomesolution`
20
+ - Save the result: `murano config application.id XXXXXX`
21
+ - Assign the product to the application: `murano assign set`
22
22
 
23
23
  # What got configured?
24
- `mr config --dump`
24
+ `murano config --dump`
25
25
 
26
26
 
27
27
 
@@ -30,23 +30,23 @@
30
30
 
31
31
  # <voice type='orc'>Work Work</voice>
32
32
 
33
- - What is going to change? `mr status`
34
- - Sync solution code up: `mr syncup -V`
33
+ - What is going to change? `murano status`
34
+ - Sync solution code up: `murano syncup -V`
35
35
 
36
36
  - Change a file
37
- - What is going to change? `mr status`
38
- - Details of change: `mr diff`
37
+ - What is going to change? `murano status`
38
+ - Details of change: `murano diff`
39
39
 
40
40
 
41
41
 
42
42
 
43
43
  # Devices
44
- - Add a real device: `mr product device enable 42:42:42:42:42:42`
45
- - !!!cheet and activate by hand: `mr product device activate 42:42:42:42:42:42`
46
- - Which resources are there? `mr product spec pull`
44
+ - Add a real device: `murano product device enable 42:42:42:42:42:42`
45
+ - !!!cheat and activate by hand: `murano product device activate 42:42:42:42:42:42`
46
+ - Which resources are there? `murano pull --resources && cat specs/resources.yaml`
47
47
  - What did the device write to that one resource?
48
- `mr product device read 42:42:42:42:42:42 update_interval`
49
- - `mr product device write 42:42:42:42:42:42 update_interval 300`
48
+ `murano product device read 42:42:42:42:42:42 update_interval`
49
+ - `murano product device write 42:42:42:42:42:42 update_interval 300`
50
50
 
51
51
 
52
52
 
@@ -71,8 +71,8 @@ See GWE.
71
71
  # Debugging
72
72
 
73
73
  ## Logs
74
- - `mr logs`
75
- - `mr logs --follow`
74
+ - `murano logs`
75
+ - `murano logs --follow`
76
76
 
77
77
 
78
78
 
@@ -81,29 +81,29 @@ See GWE.
81
81
 
82
82
  ## Keystore
83
83
  ### What is in the Keystore?
84
- `mr keystore list`
84
+ `murano keystore list`
85
85
 
86
86
  ### Write and Read a Key
87
- - `mr keystore set test greebled`
88
- - `mr keystore get test`
87
+ - `murano keystore set test greebled`
88
+ - `murano keystore get test`
89
89
 
90
90
  ### Write to a Set
91
- - `mr keystore command sadd myset greebled`
91
+ - `murano keystore command sadd myset greebled`
92
92
  Or any other supported Redis command.
93
93
 
94
94
  ### Remove just the ones with 'socketmap'
95
- `mr keystore list | grep socketmap | xargs -L1 mr keystore delete`
95
+ `murano keystore list | grep socketmap | xargs -L1 murano keystore delete`
96
96
 
97
97
 
98
98
 
99
99
 
100
100
  ## TSDB
101
101
 
102
- - `mr tsdb list metrics`
103
- - `mr tsdb list tags`
104
- - `mr tsdb query @sn=1 temp0`
105
- - `mr tsdb query @sn=1 temp0 --limit=4`
106
- - `mr tsdb query @sn=1 --limit=10 -c outformat=csv --epoch ms`
102
+ - `murano tsdb list metrics`
103
+ - `murano tsdb list tags`
104
+ - `murano tsdb query @sn=1 temp0`
105
+ - `murano tsdb query @sn=1 temp0 --limit=4`
106
+ - `murano tsdb query @sn=1 --limit=10 -c outformat=csv --epoch ms`
107
107
 
108
108
 
109
109
 
@@ -0,0 +1,391 @@
1
+ #########################
2
+ MuranoCLI Developer Guide
3
+ #########################
4
+
5
+ =========================
6
+ Introduction to MuranoCLI
7
+ =========================
8
+
9
+ Login example
10
+ -------------
11
+
12
+ Use MuranoCLI to logon for the first time.::
13
+
14
+ $ murano login
15
+ No Murano user account found; please login
16
+ User name: user@domain.tld
17
+ Couldn't find password for user@domain.tld
18
+ Password: XXXX
19
+
20
+ MuranoCLI creates two files in your home directory.::
21
+
22
+ $ cat ~/.murano/config
23
+ [user]
24
+ name = user@domain.tld
25
+
26
+ $ cat ~/.murano/passwords
27
+ ---
28
+ bizapi.hosted.exosite.io:
29
+ user@domain.tld: "XXXXXXXXXXXXXXXX"
30
+
31
+ $ murano login --show-token
32
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
33
+
34
+ Create a business
35
+ -----------------
36
+
37
+ FIXME: Show the ``murano init`` command.
38
+
39
+ Work on a business
40
+ ------------------
41
+
42
+ View a list of businesses you've created.::
43
+
44
+ $ murano business list
45
+ +------------------+-------+--------------------+
46
+ | bizid | role | name |
47
+ +------------------+-------+--------------------+
48
+ | abcdef1234567890 | owner | Business Name |
49
+ | 1234567890abcdef | admin | ACME IoT |
50
+ +------------------+-------+--------------------+
51
+
52
+ Pick a business to work on.::
53
+
54
+ # From the `murano business list` list:
55
+ $ murano config business.id abcdef1234567890
56
+
57
+ MuranoCLI will remember the business you've chosen.::
58
+
59
+ $ cat /exo/clients/exosite/.murano/config
60
+ [business]
61
+ id = ct7rmoz3hu34ygb9
62
+
63
+ MuranoCLI options
64
+ -----------------
65
+
66
+ To see all options that MuranoCLI *really* supports, make a dump.
67
+
68
+ .. code-block:: bash
69
+
70
+ $ murano config --dump
71
+
72
+ [tool]
73
+ verbose = false
74
+ debug = false
75
+ ...
76
+
77
+ ============================
78
+ Developer Setup Instructions
79
+ ============================
80
+
81
+ Fork and clone the project
82
+ --------------------------
83
+
84
+ Fork the project into your account. Visit:
85
+
86
+ https://github.com/exosite/MuranoCLI.git
87
+
88
+ After forking, clone your repo and set its upstream.
89
+
90
+ NOTE: This guide assumes you are working out of the directory,
91
+ ``/exo/clients/exosite``.
92
+
93
+ .. code-block:: bash
94
+
95
+ cd /exo/clients/exosite
96
+
97
+ git clone git@github.com:{username}/MuranoCLI.git
98
+
99
+ cd MuranoCLI
100
+
101
+ git remote add upstream git@github.com:exosite/MuranoCLI.git
102
+ # Add other developers' repos. E.g.,
103
+ git remote add tadpol git@github.com:tadpol/MuranoCLI.git
104
+ git remote add landonb git@github.com:landonb/MuranoCLI.git
105
+
106
+ Checkout a branch
107
+ -----------------
108
+
109
+ Checkout an existing branch...
110
+
111
+ .. code-block:: bash
112
+
113
+ git checkout feature/ticket_name_and_number
114
+
115
+ ... or create a new branch.
116
+
117
+ .. code-block:: bash
118
+
119
+ # Create a new topic branch.
120
+ git checkout -b feature/totally_awesome
121
+ # Push the new topic branch and setup remote tracking [-u].
122
+ git push -u origin feature/totally_awesome
123
+
124
+ Rebase when merging co-workers' changes
125
+ ---------------------------------------
126
+
127
+ While working on your branch, you'll want to periodically grab
128
+ changes from other folks. So long as you're the only one working
129
+ on your branch, rebase your work to keep the git history sane.
130
+
131
+ .. code-block:: bash
132
+
133
+ git fetch upstream
134
+ git checkout feature/murcli
135
+ git rebase upstream/feature/okami
136
+ git push origin feature/murcli
137
+
138
+ NOTE: Do not rebase onto a branch being actively worked on by
139
+ other people, like ``master`` or ``develop``, or you'll screw
140
+ up everybody's histories and force people to clone anew.
141
+
142
+ Beware of Ruby Version Management
143
+ ---------------------------------
144
+
145
+ To build and run the code, you might be able to run whatever
146
+ ruby is currently installed. But you'll probably eventually
147
+ run into problems with different ruby projects using different
148
+ versions of different libraries. So you'll probably want to
149
+ use a ruby version manager, such as
150
+ `Ruby Version Manager <https://rvm.io/>`__,
151
+ or `chruby <https://github.com/postmodern/chruby>`__
152
+ or `rbenv <https://github.com/rbenv/rbenv>`__.
153
+
154
+ - If you're having problems building or running MuranoCLI,
155
+ ``gem env`` is a good way to see how the ruby environment
156
+ variables are set.
157
+
158
+ - One important setting to check is the gem directory.
159
+ This should be somewhere writable by your user, like $HOME.
160
+ E.g.,
161
+
162
+ ``$ ruby -rubygems -e 'puts Gem.user_dir'``
163
+
164
+ ``/home/user/.gem/ruby/2.3.0``
165
+
166
+ - Other interesting environs:
167
+
168
+ ``GEM_HOME``, ``GEM_PATH``, and ``GEM_ROOT``.
169
+
170
+ Example ``chruby`` usage
171
+ ^^^^^^^^^^^^^^^^^^^^^^^^
172
+
173
+ If you use ``chruby``, tell it what version of ruby you want:
174
+
175
+ .. code-block:: bash
176
+
177
+ cd /exo/clients/exosite/MuranoCLI
178
+ echo "ruby-2.3" > .ruby-version
179
+
180
+ (You can also do this for ``rvm``, which recognizes the
181
+ same ``.ruby-version`` files.)
182
+
183
+ Now tell chruby to load the version of ruby you want:
184
+
185
+ .. code-block:: bash
186
+
187
+ cd /exo/clients/exosite/MuranoCLI
188
+ chruby $(cat .ruby-version)
189
+
190
+ Install dependencies
191
+ --------------------
192
+
193
+ To install the project, you'll need
194
+ `bundler
195
+ <https://github.com/bundler/bundler>`__.
196
+
197
+ Run these commands once from any directory:
198
+
199
+ .. code-block:: bash
200
+
201
+ gem install bundler
202
+
203
+ gem install rspec
204
+
205
+ gem install byebug
206
+
207
+ gem install rubocop
208
+
209
+ Prepare MuranoCLI
210
+ -----------------
211
+
212
+ Install the gems listed in the MuranoCLI Gemfile:
213
+
214
+ .. code-block:: bash
215
+
216
+ cd /exo/clients/exosite/MuranoCLI
217
+ bundle install --path $(ruby -rubygems -e 'puts Gem.dir') --with test
218
+
219
+ Build and Install MuranoCLI
220
+ ---------------------------
221
+
222
+ Build and install the Gem locally to your local gem directory.
223
+
224
+ .. code-block:: bash
225
+
226
+ cd /exo/clients/exosite/MuranoCLI
227
+
228
+ rake install:user
229
+
230
+ Verify that it installed.
231
+
232
+ .. code-block:: bash
233
+
234
+ murano -v
235
+
236
+ Troubleshooting: check that ``murano`` doesn't reference something else.
237
+
238
+ .. code-block:: bash
239
+
240
+ command -v murano
241
+
242
+ Prepare to Test
243
+ ---------------
244
+
245
+ Create Config File
246
+ ^^^^^^^^^^^^^^^^^^
247
+
248
+ So the tests know what Business to use, setup a config file.
249
+
250
+ ([lb] also likes to see what ``murano`` and ``curl`` calls happen,
251
+ so I enable ``curldebug`` and redirect the verbose output to a file,
252
+ ``curlfile``.)
253
+
254
+ ::
255
+
256
+ [user]
257
+ name = user@exosite.com
258
+
259
+ [net]
260
+ host = bizapi.hosted.exosite.io
261
+
262
+ [business]
263
+ id = xxxxxxxxxxxxxxxx
264
+
265
+ [tool]
266
+ #curldebug = false
267
+ curldebug = true
268
+
269
+ curlfile = "/exo/clients/exosite/MuranoCLI/curldebug.out"
270
+
271
+ Save the file outside the MuranoCLI repo, e.g., to
272
+ ``/exo/clients/exosite/.murano.test``
273
+
274
+ Set Environs
275
+ ^^^^^^^^^^^^
276
+
277
+ You'll need to setup a few environs first.
278
+
279
+ You could simply export the values explicitly::
280
+
281
+ export MURANO_CONFIGFILE="/exo/clients/exosite/.murano.test"
282
+ export MURANO_PASSWORD="XXXXXXXXXXXXXXXX"
283
+
284
+ Or you could do something fancier using MuranoCLI to find them, e.g.,::
285
+
286
+ cat > test-murano.sh << EOF
287
+ cat #!/bin/bash
288
+ export MURANO_CONFIGFILE="$(pwd)/.murano.test"
289
+ MURANO_USER=`murano password current`
290
+ MURANO_HOST=`murano config net.host`
291
+ export MURANO_PASSWORD=`ruby -ryaml -e "puts YAML.load_file(File.join(Dir.home,'.murano','passwords'))['$MURANO_HOST']['$MURANO_USER']"`
292
+ echo "Testing using ${MURANO_USER}@${MURANO_HOST} with PWD ${MURANO_PASSWORD} and CFG ${MURANO_CONFIGFILE}"
293
+ rspec "$@"
294
+ EOF
295
+
296
+ chmod 755 test-murano.sh
297
+ ./test-murano.sh
298
+
299
+ Cleanup Solutions
300
+ ^^^^^^^^^^^^^^^^^
301
+
302
+ Before running tests, or if tests are interrupted, delete all solutions
303
+ under your business.
304
+
305
+ .. code-block:: bash
306
+
307
+ cd /exo/clients/exosite/MuranoCLI
308
+
309
+ rake test_clean_up
310
+
311
+ Run Tests
312
+ ---------
313
+
314
+ Run All Rspec Tests
315
+ ^^^^^^^^^^^^^^^^^^^
316
+
317
+ .. code-block:: bash
318
+
319
+ rspec
320
+
321
+ Run Single Rspec Test
322
+ ^^^^^^^^^^^^^^^^^^^^^
323
+
324
+ E.g.,
325
+
326
+ .. code-block:: bash
327
+
328
+ rspec ./spec/cmd_syncup_spec.rb
329
+
330
+ Run Tagged Rspec Test
331
+ ^^^^^^^^^^^^^^^^^^^^^
332
+
333
+ The test might look like::
334
+
335
+ it "status", :not_in_okami do
336
+
337
+ And running it would look like::
338
+
339
+ rspec --tag '~not_in_okami' ./spec/cmd_syncup_spec.rb
340
+
341
+ Run Specific "Example" from Rspec Test
342
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
343
+
344
+ Run just one test within a file.
345
+
346
+ The test file might look like::
347
+
348
+ RSpec.describe 'murano status', :cmd, :needs_password do
349
+ ...
350
+ context "with ProjectFile" do
351
+ ...
352
+ it "status" do
353
+ ...
354
+
355
+ And you could run just that test with::
356
+
357
+ rspec ./spec/cmd_status_spec.rb -e "murano status with ProjectFile status"
358
+
359
+ Run All Tests and Capture Colorful Output to HTML
360
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
361
+
362
+ .. code-block:: bash
363
+
364
+ sudo apt-get install aha
365
+
366
+ rspec --format html \
367
+ --out report/index-$( \
368
+ ruby -e 'require "/exo/clients/exosite/MuranoCLI/lib/MrMurano/version.rb"; \
369
+ puts MrMurano::VERSION').html
370
+ --format documentation \
371
+ --tag '~not_in_okami' \
372
+ | aha --black > MuranoCLI.rspec.html
373
+
374
+ Rerun Failing Tests
375
+ ^^^^^^^^^^^^^^^^^^^
376
+
377
+ .. code-block:: bash
378
+
379
+ rspec --tag '~not_in_okami' --only-failures
380
+
381
+ Uninstall MuranoCLI
382
+ -------------------
383
+
384
+ E.g.,
385
+
386
+ .. code-block:: bash
387
+
388
+ gem uninstall MuranoCLI --version 3.0.0.alpha.2
389
+
390
+ gem uninstall MuranoCLI --version 2.2.4.alpha
391
+