Closed pnikolov closed 7 years ago
Nice! Did you see the tests that @Hermanverschooten added? I think we could catch that there, too! https://github.com/trailblazer/trailblazer-loader/blob/master/test/trailblazer/loader_test.rb
Thanks!!
This is with trailblazer-rails
(v0.2.3
).
I am trying to figure out a test which will fail on Linux hosts, now I see that the new test I committed fails only on Mac OS...
I remember testing with 0 and -1, and that -1 returned the files in the wrong order, because it would force a resort. The sort goes
Yes, I saw the previous pull request. But on Mac OS X hosts is seems that the used sorting does not do the job. I can supply you with further debug information. Having this:
a!=operation, b=operation, return 0 leave them as is
Leads to the following loading order - having the callback after the operations:
"app/models/user.rb",
"app/concepts/user/operation/create.rb",
"app/concepts/user/operation/index.rb",
"app/concepts/user/callback.rb",
"app/concepts/user/operation/show.rb",
"app/concepts/user/contract/create.rb",
"app/concepts/user/operation/update.rb",
"app/concepts/user/contract/update.rb",
"app/concepts/user/cell/table.rb",
"app/concepts/user/policy.rb",
"app/concepts/user/scope.rb",
"app/concepts/user/cell/row.rb"
The test test_ordering_mac_osx
fails on Mac and passes on Linux/Windows when 0 is returned, and passes on Mac/Linux/Windows when -1 is return in case of a!=operation, b=operation
Ok, and now? @Hermanverschooten?
Closing this as I "think" this is fixed with recent changes. :beers:
@apotonick I can confirm this issue is still relevant as I am having a problem running it on my macOS but on the ubuntu is running fine.
@apotonick What is the status on this one?
@apotonick What is the status on this one?
I don't know, I don't have a Mac. It's open-source and super simple code, go try and fix it yourself, it's fun!
Please upgrade to 0.1.1. Thanks @pnikolov ! :beers:
Issue is occurring on Mac OS X 10.11.2 when operation files fail to load after callbacks.
The proposed modification sorts the files of a concept correctly so operation files are shifted to the end of the loading order list.
The proposed solution is tested both on Linux and OS X.