Fairly certain now it happens because of the removal of the lib task on
that PR you link. It used to run migrations twice, once on units, and
yet again on 'lib', but now 'units' runs the lib task twice.

You can reproduce by running this:

  #!/bin/sh
  rm db/foreman_test.sqlite3 db/development.sqlite3
  bundle exec rake db:drop db:create db:migrate
  bundle exec rake db:migrate
  bundle exec rake db:migrate:status
  bundle exec rake jenkins:unit jenkins:integration TESTOPTS=-v

with this patch (https://github.com/theforeman/foreman/pull/3916) and
you'll see the problem is that plugins believe there are pending
migrations. This is false though, as bundle exec rake db:migrate:status
confirms it in the script.

I'm now checking if the pending_migrations method is wrong and how can I
fix it to detect that better.


On 10/04, Daniel Lobato wrote:
> Remove your test db, then try RAILS_ENV=test ruby -I'test'
> test/unit/foreman/access_permissions_test.rb and you'll see it
> happening. I think it's just because tests are loaded earlier than
> permissions from plugins now.
>
> On Tue, Oct 4, 2016 at 12:39 PM, Ivan Necas <[email protected]> wrote:
> > So far, I can tell this PR
> > https://github.com/theforeman/foreman/pull/3843 introduced the
> > behaviour
> >
> > as it's green on
> > http://ci.theforeman.org/job/test_plugin_matrix/2059/database=mysql,ruby=2.3,slave=fast/
> > and red on following commit
> > http://ci.theforeman.org/job/test_plugin_matrix/2060/database=mysql,ruby=2.3,slave=fast/
> >
> > Perhaps the change is the access permissions test was in lib, and not
> > it's part of the unit
> >
> > Still no idea why it happens in jenkins only
> >
> > -- Ivan
> >
> > On Mon, Oct 3, 2016 at 10:35 PM, Ivan Necas <[email protected]> wrote:
> >> The only think I can tell so far is that I can't reproduce this
> >> locally and I have no
> >> idea on what might be different from my vs. jenkins environment that 
> >> causes this
> >> to happen.
> >>
> >> -- Ivan
> >>
> >> On Mon, Oct 3, 2016 at 10:28 PM, Stephen Benjamin <[email protected]> 
> >> wrote:
> >>> Tasks, salt and a bunch of plugins are failing tests, has anyone has a 
> >>> chance to look into it?  e.g.:
> >>>
> >>>   http://ci.theforeman.org/job/test_plugin_matrix/2015/#showFailuresLink
> >>>
> >>> This most recent failure has me thinking again about the difficulties of 
> >>> being a plugin maintainer
> >>> for Foreman.
> >>>
> >>> Would it be possible to get a standard plugin in Foreman's test matrix 
> >>> for PR? Perhaps tasks is a good
> >>> candidate.  Not on all databases/rubies, but something might help gain 
> >>> awareness of the impact of
> >>> certain changes on plugins. Katello is there, but it doesn't run all 
> >>> (any?) of Foreman's tests.
> >>>
> >>> Along side that, we should be tracking what plugin maintainers need to do 
> >>> to update from one release
> >>> to the next.
> >>>
> >>> It really is a recurring problem for me, that Salt is constantly broken 
> >>> due to incompatibilities
> >>> introduced in Foreman.   We do a poor job of tracking them.  Maybe if I'm 
> >>> lucky someone is nice
> >>> enough to send a mail to foreman-dev. Or if the planets align, someone 
> >>> opens a PR to foreman_salt
> >>> and fixes it. But more often than not, my project just goes red and I 
> >>> have to figure out why.
> >>> But this is just a side thing, and I rarely get to immediately look at 
> >>> failures.  They end up piling
> >>> up.
> >>>
> >>> Very frustrating, as when I do find time to work on it, it's not to do 
> >>> something cool, but just
> >>> to figure out what changed in core and how to fix it in the plugin :-\
> >>>
> >>>
> >>> - Stephen
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups 
> >>> "foreman-dev" group.
> >>> To unsubscribe from this group and stop receiving emails from it, send an 
> >>> email to [email protected].
> >>> For more options, visit https://groups.google.com/d/optout.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "foreman-dev" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to [email protected].
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Daniel Lobato
>
> @dlobatog
> daniellobato.me
>
> GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30

--
Daniel Lobato Garcia

@dLobatog
blog.daniellobato.me
daniellobato.me

GPG: http://keys.gnupg.net/pks/lookup?op=get&search=0x7A92D6DD38D6DE30
Keybase: https://keybase.io/elobato

-- 
You received this message because you are subscribed to the Google Groups 
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: PGP signature

Reply via email to