MuranoCLI 3.2.0.beta.1 → 3.2.0.beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -1
  3. data/.trustme.plugin +137 -0
  4. data/.trustme.sh +217 -117
  5. data/.trustme.vim +9 -3
  6. data/Gemfile +9 -3
  7. data/MuranoCLI.gemspec +8 -5
  8. data/Rakefile +1 -0
  9. data/dockers/Dockerfile.2.2.9 +6 -3
  10. data/dockers/Dockerfile.2.3.6 +6 -3
  11. data/dockers/Dockerfile.2.4.3 +6 -3
  12. data/dockers/Dockerfile.2.5.0 +6 -3
  13. data/dockers/Dockerfile.GemRelease +10 -8
  14. data/dockers/Dockerfile.m4 +23 -5
  15. data/dockers/docker-test.sh +65 -28
  16. data/docs/completions/murano_completion-bash +751 -57
  17. data/docs/develop.rst +10 -9
  18. data/lib/MrMurano/AccountBase.rb +95 -6
  19. data/lib/MrMurano/Commander-Entry.rb +9 -4
  20. data/lib/MrMurano/Config-Migrate.rb +2 -0
  21. data/lib/MrMurano/Config.rb +94 -26
  22. data/lib/MrMurano/Content.rb +1 -1
  23. data/lib/MrMurano/Exchange.rb +77 -42
  24. data/lib/MrMurano/Gateway.rb +1 -1
  25. data/lib/MrMurano/HttpAuthed.rb +20 -7
  26. data/lib/MrMurano/Logs.rb +10 -1
  27. data/lib/MrMurano/ProjectFile.rb +1 -1
  28. data/lib/MrMurano/ReCommander.rb +129 -73
  29. data/lib/MrMurano/Solution-ServiceConfig.rb +18 -11
  30. data/lib/MrMurano/Solution-Services.rb +78 -50
  31. data/lib/MrMurano/Solution-Users.rb +1 -1
  32. data/lib/MrMurano/Solution.rb +13 -63
  33. data/lib/MrMurano/SyncUpDown-Core.rb +185 -77
  34. data/lib/MrMurano/SyncUpDown-Item.rb +29 -4
  35. data/lib/MrMurano/SyncUpDown.rb +11 -11
  36. data/lib/MrMurano/Webservice-Cors.rb +1 -1
  37. data/lib/MrMurano/Webservice-Endpoint.rb +28 -17
  38. data/lib/MrMurano/Webservice-File.rb +103 -43
  39. data/lib/MrMurano/commands/domain.rb +1 -0
  40. data/lib/MrMurano/commands/element.rb +585 -0
  41. data/lib/MrMurano/commands/exchange.rb +211 -204
  42. data/lib/MrMurano/commands/gb.rb +1 -0
  43. data/lib/MrMurano/commands/globals.rb +17 -7
  44. data/lib/MrMurano/commands/init.rb +115 -101
  45. data/lib/MrMurano/commands/keystore.rb +1 -1
  46. data/lib/MrMurano/commands/logs.rb +2 -1
  47. data/lib/MrMurano/commands/postgresql.rb +17 -7
  48. data/lib/MrMurano/commands/service.rb +572 -0
  49. data/lib/MrMurano/commands/show.rb +7 -3
  50. data/lib/MrMurano/commands/solution.rb +2 -1
  51. data/lib/MrMurano/commands/solution_picker.rb +31 -15
  52. data/lib/MrMurano/commands/status.rb +205 -169
  53. data/lib/MrMurano/commands/sync.rb +70 -38
  54. data/lib/MrMurano/commands/token.rb +59 -14
  55. data/lib/MrMurano/commands/usage.rb +1 -0
  56. data/lib/MrMurano/commands.rb +2 -0
  57. data/lib/MrMurano/hash.rb +91 -0
  58. data/lib/MrMurano/http.rb +55 -6
  59. data/lib/MrMurano/makePretty.rb +47 -0
  60. data/lib/MrMurano/optparse.rb +60 -45
  61. data/lib/MrMurano/variegated/TruthyFalsey.rb +48 -0
  62. data/lib/MrMurano/variegated/ruby_dig.rb +64 -0
  63. data/lib/MrMurano/verbosing.rb +113 -3
  64. data/lib/MrMurano/version.rb +1 -1
  65. data/spec/Account_spec.rb +34 -20
  66. data/spec/Business_spec.rb +12 -9
  67. data/spec/Config_spec.rb +7 -1
  68. data/spec/Content_spec.rb +17 -1
  69. data/spec/GatewayBase_spec.rb +5 -2
  70. data/spec/GatewayDevice_spec.rb +4 -2
  71. data/spec/GatewayResource_spec.rb +4 -1
  72. data/spec/GatewaySettings_spec.rb +4 -1
  73. data/spec/HttpAuthed_spec.rb +73 -0
  74. data/spec/Http_spec.rb +32 -35
  75. data/spec/ProjectFile_spec.rb +1 -1
  76. data/spec/Solution-ServiceConfig_spec.rb +4 -1
  77. data/spec/Solution-ServiceEventHandler_spec.rb +6 -3
  78. data/spec/Solution-ServiceModules_spec.rb +4 -1
  79. data/spec/Solution-UsersRoles_spec.rb +4 -1
  80. data/spec/Solution_spec.rb +4 -1
  81. data/spec/SyncUpDown_spec.rb +1 -1
  82. data/spec/Webservice-Cors_spec.rb +4 -1
  83. data/spec/Webservice-Endpoint_spec.rb +9 -6
  84. data/spec/Webservice-File_spec.rb +17 -4
  85. data/spec/Webservice-Setting_spec.rb +6 -2
  86. data/spec/_workspace.rb +2 -0
  87. data/spec/cmd_common.rb +42 -13
  88. data/spec/cmd_content_spec.rb +17 -7
  89. data/spec/cmd_device_spec.rb +1 -1
  90. data/spec/cmd_domain_spec.rb +2 -2
  91. data/spec/cmd_element_spec.rb +400 -0
  92. data/spec/cmd_exchange_spec.rb +2 -2
  93. data/spec/cmd_init_spec.rb +59 -25
  94. data/spec/cmd_keystore_spec.rb +6 -3
  95. data/spec/cmd_link_spec.rb +10 -5
  96. data/spec/cmd_logs_spec.rb +1 -1
  97. data/spec/cmd_setting_application_spec.rb +18 -15
  98. data/spec/cmd_setting_product_spec.rb +7 -7
  99. data/spec/cmd_status_spec.rb +27 -17
  100. data/spec/cmd_syncdown_application_spec.rb +30 -3
  101. data/spec/cmd_syncdown_both_spec.rb +72 -18
  102. data/spec/cmd_syncup_spec.rb +71 -5
  103. data/spec/cmd_token_spec.rb +2 -2
  104. data/spec/cmd_usage_spec.rb +2 -2
  105. data/spec/dry_run_formatter.rb +27 -0
  106. data/spec/fixtures/dumped_config +8 -0
  107. data/spec/fixtures/exchange_element/element-show.json +1 -0
  108. data/spec/fixtures/exchange_element/swagger-mur-6407__10k.yaml +282 -0
  109. data/spec/fixtures/exchange_element/swagger-mur-6407__20k.yaml +588 -0
  110. data/spec/variegated_TruthyFalsey_spec.rb +29 -0
  111. metadata +51 -25
data/Gemfile CHANGED
@@ -10,8 +10,10 @@ source 'http://rubygems.org'
10
10
  #gemspec
11
11
 
12
12
  gem 'certified', '1.0.0'
13
- gem 'commander', '~> 4.4.3'
13
+ # (lb): I forked commander to fix empty-string args issue; see murano-cli-commander.
14
+ # gem 'commander', '~> 4.4.4'
14
15
  gem 'dotenv', '~> 2.1.1'
16
+ gem 'dumb_delegator', '~> 0.8.0'
15
17
  gem 'eventmachine', '~> 1.2.5'
16
18
  gem 'faye-websocket', '~> 0.10.7'
17
19
  gem 'highline', '~> 1.7.8'
@@ -22,6 +24,7 @@ gem 'json', '~> 2.1.0'
22
24
  gem 'json-schema', '~> 2.7.0'
23
25
  gem 'mime-types', '~> 3.1'
24
26
  gem 'mime-types-data', '~> 3.2016.0521'
27
+ gem 'murano-cli-commander', '~> 4.4.7'
25
28
  #gem 'orderedhash', '~> 0.0.6'
26
29
  gem 'os', '~> 1.0.0'
27
30
  gem 'paint', '~> 2.0.0'
@@ -33,17 +36,20 @@ gem 'rainbow', '~> 2.2.2'
33
36
  # Windows build fails unless `rake` is packaged.
34
37
  gem 'rake', '~> 12.1.0'
35
38
  gem 'terminal-table', '~> 1.8.0'
39
+ gem 'tty-editor', '~> 0.4.0'
40
+ gem 'unicode-display_width', '~> 1.3.2'
36
41
  gem 'vine', '~> 0.4'
37
42
  gem 'whirly', '~> 0.2.4'
38
43
 
39
44
  group :test do
40
45
  #gem 'bundler', '~> 1.7.6'
41
46
  gem 'byebug', '~> 9.0.6'
42
- gem 'coderay', require: false
47
+ #gem 'coderay', require: false
43
48
  #gem 'rake', '~> 10.1.1'
44
49
  gem 'rspec', '~> 3.5'
45
50
  gem 'rubocop', '~> 0.49.1'
46
- gem 'simplecov', require: false
51
+ #gem 'simplecov', require: false
52
+ gem 'simplecov', '~> 0.16.1'
47
53
  gem 'webmock', '~> 2.3.0'
48
54
  gem 'websocket-driver', '~> 0.7.0'
49
55
  #gem 'vcr'
data/MuranoCLI.gemspec CHANGED
@@ -38,8 +38,10 @@ And so much more.
38
38
  s.require_paths = ['lib']
39
39
 
40
40
  s.add_runtime_dependency('certified', '1.0.0')
41
- s.add_runtime_dependency('commander', '~> 4.4.3')
41
+ # (lb): I forked commander to fix empty-string args issue; see murano-cli-commander.
42
+ # s.add_runtime_dependency('commander', '~> 4.4.4')
42
43
  s.add_runtime_dependency('dotenv', '~> 2.1.1')
44
+ s.add_runtime_dependency('dumb_delegator', '~> 0.8.0')
43
45
  # 2017-08-15: Getting warning when running --user-install gem in 2.4.0. [lb]:
44
46
  # Ignoring eventmachine-1.2.3 because its extensions are not built.
45
47
  # Try: gem pristine eventmachine --version 1.2.3
@@ -54,6 +56,7 @@ And so much more.
54
56
  s.add_runtime_dependency('json-schema', '~> 2.7.0')
55
57
  s.add_runtime_dependency('mime-types', '~> 3.1')
56
58
  s.add_runtime_dependency('mime-types-data', '~> 3.2016.0521')
59
+ s.add_runtime_dependency('murano-cli-commander', '~> 4.4.7')
57
60
  #s.add_runtime_dependency('orderedhash', '~> 0.0.6')
58
61
  s.add_runtime_dependency('os', '~> 1.0.0')
59
62
  s.add_runtime_dependency('paint', '~> 2.0.0')
@@ -61,15 +64,15 @@ And so much more.
61
64
  # It's included by json, so make sure it's the old one.
62
65
  s.add_runtime_dependency('public_suffix', '~> 2.0.5')
63
66
  s.add_runtime_dependency('rainbow', '~> 2.2.2')
67
+ # 2017-09-12: MRMUR-160/MRMUR-161: (lb): Windows build fails without `rake`.
68
+ s.add_runtime_dependency('rake', '~> 12.1.0')
64
69
  s.add_runtime_dependency('terminal-table', '~> 1.8.0')
70
+ s.add_runtime_dependency('tty-editor', '~> 0.4.0')
65
71
  s.add_runtime_dependency('vine', '~> 0.4')
66
72
  s.add_runtime_dependency('whirly', '~> 0.2.4')
67
- # LATER/2017-09-12: See MRMUR-160 and MRMUR-161:
68
- # Windows build fails unless `rake` is packaged.
69
- s.add_runtime_dependency('rake', '~> 12.1.0')
70
73
 
71
74
  # `bundle install --with=test`
72
- s.add_development_dependency('bundler', '~> 1.7.6')
75
+ #s.add_development_dependency('bundler', '~> 1.7.6')
73
76
  s.add_development_dependency('byebug', '~> 9.0.6')
74
77
  #s.add_development_dependency('coderay', '~> ???')
75
78
  #s.add_development_dependency('rake', '~> 12.1.0')
data/Rakefile CHANGED
@@ -86,6 +86,7 @@ desc 'Run Rubocop linter'
86
86
  task :rubocop do
87
87
  sh %(rubocop -D -c .rubocop.yml)
88
88
  end
89
+ task lint: :rubocop
89
90
 
90
91
  desc 'Clean out junk from prior hot tests'
91
92
  task :test_clean_up do
@@ -15,7 +15,8 @@ RUN \
15
15
  >> /etc/apt/sources.list \
16
16
  && apt-get -qq update \
17
17
  && apt-get install -y sudo
18
- RUN echo "jenkins ALL= NOPASSWD: /bin/chmod" >> /etc/sudoers
18
+
19
+ RUN echo "jenkins ALL= NOPASSWD: ALL" >> /etc/sudoers
19
20
 
20
21
  WORKDIR /app
21
22
  COPY . /app
@@ -25,9 +26,9 @@ RUN /bin/chown -R jenkins /app
25
26
  USER jenkins
26
27
 
27
28
  RUN cd /app && \
28
- gem install bundler && \
29
+ sudo gem install bundler && \
29
30
  gem install rspec && \
30
- bundler install && \
31
+ bundle install --with test && \
31
32
  rake build
32
33
 
33
34
  RUN gem install \
@@ -35,3 +36,5 @@ RUN gem install \
35
36
  'require "/app/lib/MrMurano/version.rb"; puts MrMurano::VERSION' \
36
37
  ).gem
37
38
 
39
+ # vim:tw=0:ts=4:sw=4:noet:ft=conf:
40
+
@@ -15,7 +15,8 @@ RUN \
15
15
  >> /etc/apt/sources.list \
16
16
  && apt-get -qq update \
17
17
  && apt-get install -y sudo
18
- RUN echo "jenkins ALL= NOPASSWD: /bin/chmod" >> /etc/sudoers
18
+
19
+ RUN echo "jenkins ALL= NOPASSWD: ALL" >> /etc/sudoers
19
20
 
20
21
  WORKDIR /app
21
22
  COPY . /app
@@ -25,9 +26,9 @@ RUN /bin/chown -R jenkins /app
25
26
  USER jenkins
26
27
 
27
28
  RUN cd /app && \
28
- gem install bundler && \
29
+ sudo gem install bundler && \
29
30
  gem install rspec && \
30
- bundler install && \
31
+ bundle install --with test && \
31
32
  rake build
32
33
 
33
34
  RUN gem install \
@@ -35,3 +36,5 @@ RUN gem install \
35
36
  'require "/app/lib/MrMurano/version.rb"; puts MrMurano::VERSION' \
36
37
  ).gem
37
38
 
39
+ # vim:tw=0:ts=4:sw=4:noet:ft=conf:
40
+
@@ -15,7 +15,8 @@ RUN \
15
15
  >> /etc/apt/sources.list \
16
16
  && apt-get -qq update \
17
17
  && apt-get install -y sudo
18
- RUN echo "jenkins ALL= NOPASSWD: /bin/chmod" >> /etc/sudoers
18
+
19
+ RUN echo "jenkins ALL= NOPASSWD: ALL" >> /etc/sudoers
19
20
 
20
21
  WORKDIR /app
21
22
  COPY . /app
@@ -25,9 +26,9 @@ RUN /bin/chown -R jenkins /app
25
26
  USER jenkins
26
27
 
27
28
  RUN cd /app && \
28
- gem install bundler && \
29
+ sudo gem install bundler && \
29
30
  gem install rspec && \
30
- bundler install && \
31
+ bundle install --with test && \
31
32
  rake build
32
33
 
33
34
  RUN gem install \
@@ -35,3 +36,5 @@ RUN gem install \
35
36
  'require "/app/lib/MrMurano/version.rb"; puts MrMurano::VERSION' \
36
37
  ).gem
37
38
 
39
+ # vim:tw=0:ts=4:sw=4:noet:ft=conf:
40
+
@@ -15,7 +15,8 @@ RUN \
15
15
  >> /etc/apt/sources.list \
16
16
  && apt-get -qq update \
17
17
  && apt-get install -y sudo
18
- RUN echo "jenkins ALL= NOPASSWD: /bin/chmod" >> /etc/sudoers
18
+
19
+ RUN echo "jenkins ALL= NOPASSWD: ALL" >> /etc/sudoers
19
20
 
20
21
  WORKDIR /app
21
22
  COPY . /app
@@ -25,9 +26,9 @@ RUN /bin/chown -R jenkins /app
25
26
  USER jenkins
26
27
 
27
28
  RUN cd /app && \
28
- gem install bundler && \
29
+ sudo gem install bundler && \
29
30
  gem install rspec && \
30
- bundler install && \
31
+ bundle install --with test && \
31
32
  rake build
32
33
 
33
34
  RUN gem install \
@@ -35,3 +36,5 @@ RUN gem install \
35
36
  'require "/app/lib/MrMurano/version.rb"; puts MrMurano::VERSION' \
36
37
  ).gem
37
38
 
39
+ # vim:tw=0:ts=4:sw=4:noet:ft=conf:
40
+
@@ -1,9 +1,10 @@
1
- FROM ruby:2.2.9-jessie
1
+ FROM ruby:2.3.6-jessie
2
2
 
3
3
  USER root
4
4
 
5
- ENV LANGUAGE en_US.UTF-8
6
- ENV LANG en_US.UTF-8
5
+ ENV LANGUAGE C.UTF-8
6
+ ENV LANG C.UTF-8
7
+ ENV LC_ALL C.UTF-8
7
8
 
8
9
  RUN useradd -m -s /bin/bash --uid 1001 -G root jenkins
9
10
 
@@ -13,6 +14,7 @@ RUN \
13
14
  && echo "deb-src http://ftp.us.debian.org/debian/ jessie main contrib non-free" \
14
15
  >> /etc/apt/sources.list \
15
16
  && apt-get -qq update \
17
+ && apt-get install -y sudo \
16
18
  && apt-get install -y curl \
17
19
  && apt-get install -y bzip2 \
18
20
  && apt-get install -y tar
@@ -24,11 +26,11 @@ RUN /bin/chown -R jenkins /app
24
26
 
25
27
  USER jenkins
26
28
 
27
- RUN cd /app && \
28
- gem install bundler && \
29
- gem install rspec && \
30
- bundler install && \
31
- rake build
29
+ RUN cd /app
30
+ RUN gem install bundler
31
+ RUN gem install rspec
32
+ RUN bundle install
33
+ RUN rake build
32
34
 
33
35
  RUN gem install \
34
36
  pkg/MuranoCLI-$(ruby -e \
@@ -34,6 +34,20 @@ ENV LANGUAGE C.UTF-8
34
34
  ENV LANG C.UTF-8
35
35
  ENV LC_ALL C.UTF-8
36
36
 
37
+ dnl # Some DEBUGGING tricks:
38
+ dnl # RUN ls -la /app
39
+ dnl # RUN ruby -v
40
+ dnl # # Show: $GEM_HOME, $GEM_PATH, $GEM_ROOT, $BUNDLE_PATH, $BUNDLE_HOME, etc.
41
+ dnl # RUN set | grep -e '^RUBY' -e '^GEM' -e '^BUNDLE'
42
+ dnl # RUN gem env
43
+ dnl # RUN ruby -rubygems -e 'puts Gem.dir'
44
+ dnl # ...
45
+ dnl # RUN command -v bundler
46
+ dnl # RUN bundler -v
47
+ dnl #
48
+ dnl # In any case, gems are installed to:
49
+ dnl # /usr/local/bundle/gems
50
+ dnl #
37
51
  dnl # Jenkins runs the Execute Shell script on Docker as the 'jenkins' user,
38
52
  dnl # but Docker is confused unless we create that user now and assign it the
39
53
  dnl # UID that gets used. ((lb): This is hacky; Ops might fix this eventually.)
@@ -62,7 +76,11 @@ RUN \
62
76
  >> /etc/apt/sources.list \
63
77
  && apt-get -qq update \
64
78
  && apt-get install -y sudo
65
- RUN echo "jenkins ALL= NOPASSWD: /bin/chmod" >> /etc/sudoers
79
+
80
+ dnl # NOTE: It's just easier to give the jenkins user full sudo...
81
+ dnl # RUN echo "jenkins ALL= NOPASSWD: /bin/chmod" >> /etc/sudoers
82
+ dnl # RUN echo "jenkins ALL= NOPASSWD: /usr/local/bundle/bin/gem" >> /etc/sudoers
83
+ RUN echo "jenkins ALL= NOPASSWD: ALL" >> /etc/sudoers
66
84
  dnl # If you have complainst about sudoers, try:
67
85
  dnl # RUN visudo -c
68
86
 
@@ -88,9 +106,9 @@ dnl #
88
106
  USER jenkins
89
107
 
90
108
  RUN cd /app && \
91
- gem install bundler && \
109
+ sudo gem install bundler && \
92
110
  gem install rspec && \
93
- bundler install && \
111
+ bundle install --with test && \
94
112
  rake build
95
113
 
96
114
  dnl # Install Murano CLI.
@@ -100,5 +118,5 @@ RUN gem install \
100
118
  'require "/app/lib/MrMurano/version.rb"; puts MrMurano::VERSION' \
101
119
  ).gem
102
120
 
103
- dnl # vim:tw=0:ts=4:sw=4:noet:ft=conf:
104
- dnl
121
+ # vim:tw=0:ts=4:sw=4:noet:ft=conf:
122
+
@@ -43,15 +43,17 @@
43
43
  # Jenkins sets a few environs, like ${WORKSPACE}, and we pull in a few
44
44
  # more from the Jenkins Environment Injector Plugin.
45
45
 
46
- [[ -z ${WORKSPACE} ]] && echo "ERROR: Expected WORKSPACE to be set" && exit 1
47
-
48
- [[ -z ${MURANO_USERNAME} ]] && echo "ERROR: Please set MURANO_USERNAME" && exit 1
49
- [[ -z ${MURANO_PASSWORD} ]] && echo "ERROR: Please set MURANO_PASSWORD" && exit 1
50
- [[ -z ${MURANO_BUSINESS} ]] && echo "ERROR: Please set MURANO_BUSINESS" && exit 1
46
+ must_verify_environs () {
47
+ [[ -z ${WORKSPACE} ]] && echo "ERROR: Expected WORKSPACE to be set" && exit 1
48
+ [[ -z ${MURANO_USERNAME} ]] && echo "ERROR: Please set MURANO_USERNAME" && exit 1
49
+ [[ -z ${MURANO_PASSWORD} ]] && echo "ERROR: Please set MURANO_PASSWORD" && exit 1
50
+ [[ -z ${MURANO_BUSINESS} ]] && echo "ERROR: Please set MURANO_BUSINESS" && exit 1
51
+ }
51
52
 
52
53
  # Create a basic Murano CLI config indicating the Murano account credentials.
53
54
 
54
- cat > "${WORKSPACE}/test.run.muranocfg" <<-EOCFB
55
+ create_basic_config () {
56
+ cat > "${WORKSPACE}/test.run.muranocfg" <<-EOCFB
55
57
  [user]
56
58
  name = ${MURANO_USERNAME}
57
59
  [business]
@@ -59,37 +61,72 @@ cat > "${WORKSPACE}/test.run.muranocfg" <<-EOCFB
59
61
  [net]
60
62
  host = bizapi-staging.hosted.exosite.io
61
63
  EOCFB
62
- export MURANO_CONFIGFILE="${WORKSPACE}/test.run.muranocfg"
64
+ export MURANO_CONFIGFILE="${WORKSPACE}/test.run.muranocfg"
65
+ }
63
66
 
64
67
  # Switch to the project directory and run tests.
65
68
 
66
- cd /app
69
+ prepare_to_test () {
70
+ cd /app
67
71
 
68
- # Instead of `rake test_clean_up -t`, call CLI directly with --no-color.
72
+ # Instead of `rake test_clean_up -t`, call CLI directly with --no-color.
69
73
 
70
- echo "Removing existing solutions from Murano account."
74
+ echo "Removing existing solutions from Murano account."
71
75
 
72
- ruby -Ilib bin/murano solutions expunge -y --no-progress --no-color --ascii
76
+ ruby -Ilib bin/murano solutions expunge -y --no-progress --no-color --ascii
73
77
 
74
- # Fix the PATH to avoid the error:
75
- #
76
- # /tmp/jenkins8459777890102160498.sh: line 81: rspec: command not found
77
- PATH=${PATH}:/usr/local/bundle/bin
78
+ # Fix the PATH to avoid the error:
79
+ #
80
+ # /tmp/jenkins8459777890102160498.sh: line 81: rspec: command not found
81
+ PATH=${PATH}:/usr/local/bundle/bin
82
+
83
+ # (lb): Sometimes the host drive directories mount as root:root with 2755
84
+ # permissions. But sometimes not. If it starts happening again, you'll see
85
+ # Errno::EACCES: Permission denied. Uncomment the sudoers code in Dockerfile.
86
+ sudo chmod 2777 /app/report
87
+ sudo chmod 2777 /app/coverage
88
+ }
89
+
90
+ execute_tests () {
91
+ cd /app
92
+
93
+ echo "############################################################################################"
94
+ echo "Testing \"$(murano -v)\" on \"$(ruby -v)\""
95
+ echo "############################################################################################"
96
+
97
+ # Hint: Add `--example "<...>"` to limit the test suite.
98
+
99
+ set +e
100
+
101
+ local rspec_rsp
102
+
103
+ rspec \
104
+ --format html \
105
+ --out /app/report/index-${RVERS}.html \
106
+ --format documentation
107
+
108
+ rspec_rsp=$?
109
+
110
+ # BizAPI oftentimes timesout on a few tests, so try again.
111
+ if [[ ${rspec_rsp} -ne 0 ]]; then
112
+ rspec \
113
+ --format html \
114
+ --out /app/report/index-${RVERS}.html \
115
+ --format documentation \
116
+ --only-failures
78
117
 
79
- # (lb): Sometimes the host drive directories mount as root:root with 2755
80
- # permissions. But sometimes not. If it starts happening again, you'll see
81
- # Errno::EACCES: Permission denied. Uncomment the sudoers code in Dockerfile.
82
- sudo chmod 2777 /app/report
83
- sudo chmod 2777 /app/coverage
118
+ rspec_rsp=$?
119
+ fi
84
120
 
85
- echo "############################################################################################"
86
- echo "Testing \"$(murano -v)\" on \"$(ruby -v)\""
87
- echo "############################################################################################"
121
+ exit ${rspec_rsp}
122
+ }
88
123
 
89
- # Hint: Add `--example "<...>"` to limit the test suite.
124
+ main () {
125
+ must_verify_environs
126
+ create_basic_config
127
+ prepare_to_test
128
+ execute_tests
129
+ }
90
130
 
91
- rspec \
92
- --format html \
93
- --out /app/report/index-${RVERS}.html \
94
- --format documentation
131
+ main "${@}"
95
132