<div dir="ltr">This worked great. Thanks for this and the upstream fix.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 26, 2016 at 6:25 AM, Sofer Athlan-Guyot <span dir="ltr"><<a href="mailto:sathlang@redhat.com" target="_blank">sathlang@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Matt,<br>
<span class=""><br>
Matt Fischer <<a href="mailto:matt@mattfischer.com">matt@mattfischer.com</a>> writes:<br>
<br>
> I ended up symlinking the r10k binary I have installed to the place it<br>
> wants it to be and it worked. I do have that in my Gemfile. Question<br>
> is, can we make this work without manual steps?<br>
<br>
</span>Well, I was thinking I had a smart way to fix as it was working on my<br>
env.  It turns out that it was only because of a strange setup that my<br>
"GEM_HOME=~/" trick was working.<br>
<br>
In the end, I discovered that bundler always set GEM_HOME and so the<br>
scripts of the puppet-openstack-integration always set GEM_BIN_DIR to<br>
the wrong path.<br>
<br>
I've created this bug report[1] and this fix[2].  It seems to be working<br>
well on my env.  It shouldn't change anything to the Openstack CI as the<br>
function is install_all is not used inside a proper ZUUL environment.<br>
<br>
One less pain,<br>
<br>
I discovered afterwards that you've already created the bug report<br>
there[3].  Sorry for the duplicate.<br>
<br>
As a side note, it's kind of hard to test it as the directory where the<br>
function is is recreated at each run of "bundle exec rake spec_prep"<br>
from gerrit/master. So here is what I did:<br>
 1. run it once and let it fail;<br>
 2. apply this:<br>
<br>
cat > /tmp/fix <<EOF<br>
--- lib/puppet-openstack_spec_helper/rake_tasks.rb.orig 2016-02-26 14:19:00.955396358 +0100<br>
+++ lib/puppet-openstack_spec_helper/rake_tasks.rb      2016-02-26 14:19:09.856505122 +0100<br>
@@ -49,7 +49,7 @@<br>
     zuul_branch = ENV['ZUUL_BRANCH']<br>
     zuul_url = ENV['ZUUL_URL']<br>
     repo = 'openstack/puppet-openstack-integration'<br>
-    rm_rf(repo)<br>
+#    rm_rf(repo)<br>
     if File.exists?('/usr/zuul-env/bin/zuul-cloner')<br>
       zuul_clone_cmd = ['/usr/zuul-env/bin/zuul-cloner']<br>
       zuul_clone_cmd += ['--cache-dir', '/opt/git']<br>
@@ -59,7 +59,7 @@<br>
       zuul_clone_cmd += ['git://<a href="http://git.openstack.org" rel="noreferrer" target="_blank">git.openstack.org</a>', "#{repo}"]<br>
       sh(*zuul_clone_cmd)<br>
     else<br>
-      sh("git clone <a href="https://git.openstack.org/#{repo}" rel="noreferrer" target="_blank">https://git.openstack.org/#{repo}</a> #{repo}")<br>
+#      sh("git clone <a href="https://git.openstack.org/#{repo}" rel="noreferrer" target="_blank">https://git.openstack.org/#{repo}</a> #{repo}")<br>
     end<br>
     script = ['env']<br>
     script += ["PUPPETFILE_DIR=#{Dir.pwd}/spec/fixtures/modules"]<br>
EOF<br>
<br>
running this (from your bundler env)<br>
<br>
   cat /tmp/fix | patch -d $(bundle show puppet-openstack_spec_helper) -p0<br>
<br>
and then, still from your bundler env, you can apply the patch:<br>
<br>
--- openstack/puppet-openstack-integration/functions.orig       2016-02-26 14:22:10.246709340 +0100<br>
+++ openstack/puppet-openstack-integration/functions    2016-02-26 14:22:<a href="tel:15.395772257" value="+15395772257">15.395772257</a> +0100<br>
@@ -48,7 +48,7 @@<br>
 # - ``SCRIPT_DIR`` must be set to script path<br>
 # - ``GEM_BIN_DIR`` must be set to Gem bin directory<br>
 install_all() {<br>
-  PUPPETFILE=${SCRIPT_DIR}/Puppetfile ${GEM_BIN_DIR}r10k puppetfile install -v<br>
+  PUPPETFILE=${SCRIPT_DIR}/Puppetfile r10k puppetfile install -v<br>
 }<br>
<br>
 # Install Puppet OpenStack modules and dependencies by using<br>
<br>
Kinda complicated ... certainly why I didn't bother earlier.<br>
<br>
[1] <a href="https://bugs.launchpad.net/puppet-openstack-integration/+bug/1550331" rel="noreferrer" target="_blank">https://bugs.launchpad.net/puppet-openstack-integration/+bug/1550331</a><br>
[2] <a href="https://review.openstack.org/285285" rel="noreferrer" target="_blank">https://review.openstack.org/285285</a><br>
[3] <a href="https://bugs.launchpad.net/puppet-keystone/+bug/1548872" rel="noreferrer" target="_blank">https://bugs.launchpad.net/puppet-keystone/+bug/1548872</a><br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> On Thu, Feb 18, 2016 at 4:57 PM, Alex Schultz <<a href="mailto:aschultz@mirantis.com">aschultz@mirantis.com</a>><br>
> wrote:<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
>     On Thu, Feb 18, 2016 at 3:26 PM, Matt Fischer<br>
>     <<a href="mailto:matt@mattfischer.com">matt@mattfischer.com</a>> wrote:<br>
><br>
><br>
>         Is anyone able to share the secret of running spec tests since<br>
>         the r10k transition? bundle install && bundle exec rake spec<br>
>         have issues because r10k is not being installed. Since I'm not<br>
>         the only one hopefully this question will help others.<br>
><br>
><br>
><br>
>         +<br>
>         PUPPETFILE=/etc/puppet/modules/keystone/openstack/puppet-openstack-integration/Puppetfile<br>
><br>
>         + /var/lib/gems/1.9.1/bin/r10k puppetfile install -v<br>
>         /etc/puppet/modules/keystone/openstack/puppet-openstack-integration/functions:<br>
>         line 51: /var/lib/gems/1.9.1/bin/r10k: No such file or<br>
>         directory<br>
>         rake aborted!<br>
><br>
><br>
><br>
>     I assume you were trying to run the tests on the keystone module<br>
>     so it should have been installed with the bundle install as it is<br>
>     listed in the Gemfile[0]. Are you sure your module is up to date?<br>
><br>
><br>
>     -Alex<br>
><br>
><br>
>     [0]<br>
>     <a href="https://github.com/openstack/puppet-keystone/blob/master/Gemfile#L26" rel="noreferrer" target="_blank">https://github.com/openstack/puppet-keystone/blob/master/Gemfile#L26</a><br>
><br>
><br>
>     __________________________________________________________________________<br>
><br>
>         OpenStack Development Mailing List (not for usage questions)<br>
>         Unsubscribe:<br>
>         <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
>         <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
><br>
><br>
><br>
><br>
>     __________________________________________________________________________<br>
><br>
>     OpenStack Development Mailing List (not for usage questions)<br>
>     Unsubscribe:<br>
>     <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
>     <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
><br>
><br>
><br>
><br>
> __________________________________________________________________________<br>
> OpenStack Development Mailing List (not for usage questions)<br>
> Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Sofer Athlan-Guyot<br>
</font></span></blockquote></div><br></div>