Closed (fixed)
Project:
Fieldable Panels Panes (FPP)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Dec 2013 at 20:44 UTC
Updated:
18 Mar 2019 at 22:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
eft commentedpatch seems empty
Comment #2
indytechcook commentedAttaching correct patch. Sorry!
Comment #3
sumitmadan commentedWhere to add this file?
Comment #4
indytechcook commented@sumitmaden, just apply the patch and the file will be created. see https://drupal.org/patch/apply for more info.
Comment #5
timaholt commentedThere was an issue with the patch in #2, the delete function was erroneously still the bean_services_delete() function instead of the fieldable_panels_pane_services_delete() like it should have been. Fixed in new patch.
Comment #6
damienmckennaI believe this needs to have full support for revisions, as suggested by the @todo item in a comment? There are also some minor fixes needed in the comments, and at least one occasion where "Fieldable" is spelled "Fiedlable" ;)
Comment #7
manuel garcia commentedAddressing #6:
Comment #8
manuel garcia commentedFYI: I'm in the process of adding support to fpp into deploy_addon: #2915142: Add Manage Fieldable Panels Panes page
Anyone interested feel free to have a play / review / collaborate =)
Comment #9
damienmckennafieldable_panels_panes_services_update() still references 'bean_form', "bean" is mentioned in a few comments, and some of the function docblocks need the @return statement separated from the @params by an empty line. But it seems like it's getting close.
Comment #10
damienmckennaAlso, lets add some tests to make sure the functionality works - doesn't have to be overly extensive, just the basics.
Comment #11
manuel garcia commentedFair enough - here's a test verifying that the services do actually appear at the right place.
Comment #12
damienmckennaThanks Manuel!
The points about the bean comments and bean_form still stand, and that last one makes me wonder what might be broken.
Comment #13
manuel garcia commentedPrevious patch was failing with
Invalid permission administer services., not very familiar with how the bot works on d7 sorry (works on my local machine), so this may require a few tries to get the module dependencies right.While I'm at it, also addressing the bean comments and using the fpp edit form instead of the bean form for the update operation.
Comment #15
manuel garcia commentedLet's see if this is it...
Comment #17
manuel garcia commentedOK I'm blocked... not sure why the bot throws
Invalid permission administer services, we are enabling services module which is the one providing the permission... any clues why this is happening?Comment #18
damienmckennaAh! It's failing to enable all of the modules. Maybe the problem is because of testbot?
Comment #19
jonathan1055 commentedHaving been alerted to this issue via #2692407: Test_dependencies are downloaded before applying patches, rather than after I think you will need to commit just your change to .info.yml first, adding the test dependencies.
You may be able to avoid adding the new
files[] = tests/fpp.deploy.testuntil afterwards. Do you actually need this line, if the tests are in the correct folder and named according to standards?Comment #20
damienmckennaThere are no standards in D7 for automatically discovering test classes, so all tests have to specifically listed in the info file.
Comment #21
jonathan1055 commentedHmmm, well maybe, but I have just checked by deleting the two test
files[]lines from a contrib module I maintain. Executingrun-tests.sh --liststill lists the tests to be run, andrun-tests.sh --directory sites/all/modules/my_moduleruns all the tests for the module.Comment #22
damienmckennaThat's because the test classes are cached in the registry.
Comment #23
damienmckenna.. also the --directory option runs some extra magic whereby it ignores the info file entirely and just scans for files with the extension "test" (see run-tests.sh line 475 onwards).
Comment #24
jonathan1055 commentedYes, you are right, the test file information was cached, sorry. This must have been the cause for both my "sucesses" because the
--directoryoption in run-tests.sh searches for *.php in a /tests/ folder, and the D7 files are *.test, so this also fails to find any test files if they are not listed in the .info file. Sorry to distract the issue, back on task ...Comment #25
manuel garcia commentedWhile we figure out the testing part of this, I've gone ahead and started testing this manually, the patch is indeed not ready IMHO. Attached patch at least gets the callbacks getting called, and another fix to what looks to be a residual bug form starting off from the bean services integration.
I am not terribly familiar with fieldable panels panes array of permissions, but I'm guessing if we had global permissions like this, it would simplify things:
If anyone has a better suggestion I'm all ears :)
Comment #27
manuel garcia commentedOK, I decided to go TDD on this, and happy to say I made a lot of progress. Debugged every resource, they are all working now, and we have full test coverage for all the services resources (passes locally but the bot will complain because of #2692407: Test_dependencies are downloaded before applying patches, rather than after).
Sorry for the big interdiff, also fixed a lot of CS along the way...
Comment #28
manuel garcia commentedForgot to mention that we now just test services integration, so no need for test dependencies on deploy_addons etc.
Comment #30
damienmckennaThe tests give a small error:
I think this is back to the problem of needing to add a composer.json with the dependencies (#2916627: Add a composer.json file to document the dependencies) so that we can then indicate services is now needed.
Comment #31
manuel garcia commentedYeah tests fail because the bot can't detect there is a new testing dependancy. Submitted a patch to #2916627: Add a composer.json file to document the dependencies :)
Comment #32
manuel garcia commentedPostponing on #2916627: Add a composer.json file to document the dependencies
Comment #33
manuel garcia commentedBlocker is now in, let's see if the tests run properly now :)
Comment #35
manuel garcia commentedLet's actually make use of the new composer.json file..
Comment #37
manuel garcia commentedOK this is very strange, test console output throws error:
Call to undefined function services_endpoint_save() in <em class="placeholder">FppServicesTest->saveNewEndpoint()</em> (line <em class="placeholder">100</em> of <em class="placeholder">/var/www/html/sites/all/modules/fieldable_panels_panes/tests/fpp.services.test</em>)But that function is defined in
services.module, so that means that the services module is not enabled? I can see the module being pulled in using composer on the log, but only enabling simpletest. It should though, because we are listing it on our info file as a test dependency no?Comment #38
damienmckennaI'm not sure, it's confounding.
I wonder if the new dependency was committed to fieldable_panels_panes.info first? Might have to do that old trick.
BTW could you please update setUp() to follow the structure used in FPP's other tests? Thanks.
Comment #39
manuel garcia commentedJust cleaning up the test.
I'll submit a new patch to get the dependency on the info file first.
Comment #40
manuel garcia commentedCreated #3029146: Add test dependency for services module integration
Comment #41
damienmckennaNow that #3029146 has been committed, this needs a slight reroll.
Comment #42
manuel garcia commentedReroll of #39
Comment #43
damienmckennaI fixed the branch tests in #3036702: Fix tests for 7.x-1.x branch, so let's see how this patch works now.
Comment #44
manuel garcia commentedNice, thanks for the quick fix there @DamienMcKenna 🤞
Comment #46
damienmckennaThe tests fail because:
There was a new version of the Services module out this week, maybe there was an API change?
Comment #47
manuel garcia commentedThat function is still there https://cgit.drupalcode.org/services/tree/services.module?h=7.x-3.x#n447
It's the same error we were getting before #3029146: Add test dependency for services module integration got in... seems like the services module is still not being enabled for the test for some reason...
Comment #48
damienmckennaOh yeah, services needs to be added to the setUp() method.
Comment #49
manuel garcia commentedI thought that
ServicesWebTestCase::setup()would enable it but well, let's give that a try.Comment #51
damienmckennaSorry, I missed the fact that it was extending ServicesWebTestCase instead of FppTestHelper..
Comment #52
damienmckennaMinor adjustments, changed to using assertEqual() instead assertTrue() for some of the assertions.
Comment #54
damienmckennaLets get this in the next release.
Comment #55
damienmckennaPer a comment from dww in slack, there's something weird with the build system where it might take "up to 24 hours" for new test dependency to take effect, so I'll try again tomorrow.
Comment #56
dwwTry explicitly enabling services here and see if that helps.
Comment #57
dwwFor posterity:
https://www.drupal.org/docs/8/creating-custom-modules/let-drupal-8-know-...
(emphasis added).
Point is, if you have to wait, you first have to push a commit for test_dependencies into the .info file and then wait. ;)
-- sorry, read the backscroll and I now see #3029146: Add test dependency for services module integration.Comment #58
manuel garcia commentedThanks @dww for taking a look at this, was about to loose hope here :D
Re #56
We already tried that on #49, but it's actually not necessary since this test extends
ServicesWebTestCasewhich sets that up for us :)Comment #59
damienmckennaOk, I ran the tests again, theoretically plenty of time for any cached things to be cleared, and it made no difference, the test still fails.
Comment #60
dwwSorry, I've got no further ideas. The testbots have never been my area. I just saw a question in Slack and tried to help. I think this will require @mixologic to sort it out. :(
Comment #61
damienmckennaThanks for trying, @dww.
Comment #62
dwwHrm, but #49 was before #3029146: Add test dependency for services module integration right? I tried re-queuing #49 now that #3029146 is done for over 24 hours, just to see what happens. ;)
Meanwhile, some other possible thoughts:
A)
+test_dependencies[] = servicesYou might need to specify you want the 7.x-3.x branch. I think it should be smart enough to use the recommended branch, but it doesn't hurt to be explicit. This supports module dependencies:
(well, that's D8 syntax, not sure about D7).
B) The branch test for services 7.x-3.x-dev is currently failing:
https://www.drupal.org/pift-ci-job/1213343
You might be doomed until you help them upstream get their testing world in order.
C) Services itself depends on ctools. I have no idea if our test bot is smart enough to get that right. Perhaps you should add "ctools" to your test_dependencies, too, just in case.
Comment #63
damienmckennaThanks again dww.
Per the console output it's downloading Services 7.x-3.23, so that part should be fine.
CTools is listed as a main dependency of the module, so it shouldn't need to be listed as a test dependency too.
The weird part is that the services tests work fine locally for both of us, which wouldn't be the case if it was something in the Services tests, so it seems like something odd with drupalci. BICBW.
Comment #64
damienmckennaLet's add a dependencies item to getInfo(), and some other minor tweaks.
Comment #66
damienmckennaLet's see if manually enabling services fixes the problem.
Comment #67
damienmckennaComment #69
damienmckennaStill the same error.
Comment #70
manuel garcia commentedThanks @DamienMcKenna for trying to figure this one out... I'm out of ideas here, it's amazing it still throwing the same error :-s
Comment #71
damienmckennaMinor tweaks.
Comment #73
damienmckenna@mixologic worked out the problem - rest_service requires the libraries module. We'll probably have to do another commit to add it as a test_dependencies line first.
Comment #74
damienmckennaI'm adding the dependency in #3037423: Add libraries as a test dependency for #2163581, because it isn't actually running the new Services test in #73. This will need a reroll after #3037423 is committed.
Comment #77
damienmckennaRerolled.
Comment #79
damienmckennaThe tests are now *running*, but it's showing a bunch of errors.
Comment #80
damienmckennaI think I accidentally removed a line from setUp().
Comment #81
damienmckennaIT'S GREEN!
:-D
Comment #82
manuel garcia commentedwhohooo!!
:partyparrot:Comment #84
damienmckennaCommitted! Woohoo! Thanks everyone for all your work on this!
Comment #85
manuel garcia commented\o/
Comment #86
dwwGlad it worked! Yay for sorting it out.
p.s. I still don't understand d.o's issue "credit" system. The commit mentioned me, but this issue doesn't show up in the list at https://www.drupal.org/u/dww and the checkbox doesn't appear to be checked here. Are maintainers expected to manually keep these 2 in sync? *shrug*
Comment #87
damienmckennaComment #88
damienmckenna@dww: That might have been my mistake when I was submitting the form, sorry. Does it show now?
Comment #89
dwwIndeed it does, thanks!
I don't really care, I'm mostly trying to understand how it (doesn't) work(s). ;) But thanks for fixing this, anyway. *shrug*
Cheers,
-Derek