Since the 'administer fields' permission is introduced, the FieldReplacementUI test fails.

CommentFileSizeAuthor
#77 title-n2813673-77.patch20.56 KBDamienMcKenna
#77 title-n2813673-77.interdiff.txt1.1 KBDamienMcKenna
#75 title-n2813673-75.patch20.68 KBDamienMcKenna
#72 title-n2813673-72.patch31.93 KBDamienMcKenna
#56 title-n2813673-56.patch392 bytesDamienMcKenna
#55 title-n2813673-55.patch334 bytesDamienMcKenna
#54 title-n2813673-54.patch366 bytesDamienMcKenna
#53 title-n2813673-53.patch20.77 KBDamienMcKenna
#53 title-n2813673-53.interdiff.txt2.49 KBDamienMcKenna
#52 interdiff-37-53.txt2.72 KBjoseph.olstad
#52 title-n2813673-53.patch44.89 KBjoseph.olstad
#51 interdiff-37-52.txt2.69 KBjoseph.olstad
#51 title-n2813673-52.patch44.92 KBjoseph.olstad
#50 interdiff-37-50.txt2.61 KBjoseph.olstad
#50 title-n2813673-50.patch44.92 KBjoseph.olstad
#48 title-n2813673-47.patch44.72 KBjoseph.olstad
#48 interdiff-37-47.txt2.42 KBjoseph.olstad
#44 interdiff_37_43.txt1.76 KBjoseph.olstad
#44 title-n2813673-43.patch44.38 KBjoseph.olstad
#43 interdiff_37_41.txt1.59 KBjoseph.olstad
#43 title-n2813673-41.patch44.35 KBjoseph.olstad
#40 interdiff_37_40.txt855 bytesjoseph.olstad
#40 title-n2813673-40.patch44.29 KBjoseph.olstad
#37 title-n2813673-37.patch20.09 KBDamienMcKenna
#37 title-n2813673-37.interdiff.txt2.58 KBDamienMcKenna
#34 title-n2813673-34.patch19.71 KBDamienMcKenna
#30 title-n2813673-30.patch2.09 KBDamienMcKenna
#30 title-n2813673-30.interdiff.txt2.23 KBDamienMcKenna
#27 title-test_fixes-2813673-27.patch1.31 KBplach
#15 title-test_fixes-2813673-15.review.txt803 bytesplach
#15 title-test_fixes-2813673-15.patch5.86 KBplach
#10 title-2813673-10-tests.patch3.16 KBczigor
#2 2813673-title-tests-fail.patch792 bytesStevel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Stevel created an issue. See original summary.

Stevel’s picture

Status: Active » Needs review
FileSize
792 bytes

This patch adds the needed permission to the user created by the test.

Pol’s picture

Status: Needs review » Needs work

Hi,

This patch make sense indeed.

Shouldn't we also update the info file of the module if we do this change ?

Thanks!

Stevel’s picture

Status: Needs work » Needs review

@Pol, I don't think the info file needs updating. The test continues to work under older versions of Drupal.

Pol’s picture

Status: Needs review » Reviewed & tested by the community

This patch is, according to me, valid.

I'm struggling to fix the tests, when this patch is included, I'm down to 13 fails only. (300 passes, 13 fails, 0 exceptions, and 103 debug messages)

A little help would be very welcome!

jyraya’s picture

@Pol,

I tested this patch with Drupal 7.52, 7.53 and the dev version against the latest title dev version. I get a full green.
Could you please confirm that you still have problems?

Otherwise, could we try to close this ticket as soon as possible because other patches on other issues get failed tests for no reason directly related to their scope; what slow down the acceptance process.

Pol’s picture

Hi,

I think this ticket should be committed ASAP to the module.
I wrote the maintainer to see how we could speed up things.

I'll let you know when I get a reply.

Thanks!

dxvargas’s picture

Priority: Normal » Critical

I confirm this patch works and I also had the confirmation from @Pol.
Here are the versions we used:
Drupal: 7.53
Title: 7.x-1.0-alpha8+0-dev
Entity: 7.x-1.8
Entity translation: 7.x-1.0-beta5

Before the patch:
*281* passes, *30* fails, 0 exceptions, and 98 debug messages

After the patch:
*311* passes, *0* fails, 0 exceptions, and 104 debug messages

So we confirm the RTBC. Thanks @Stevel and @jyraya!

I will raise the Priority to Critical, because this test is preventing another from being solved:
https://www.drupal.org/node/2757739 .

czigor’s picture

Priority: Critical » Normal

As per https://www.drupal.org/node/45111 this is definitely not critical but agree that it should be committed. +1RTBC from here.

czigor’s picture

This patch makes all tests green for me. It includes the patch in #2 as well.

Note that running the tests on a drupal install with an 'en' English url prefix breaks tests due to #2724773: Translation tests fail on site with english language prefix (global $language_url is not reset in tests).

Pol’s picture

Hi,

Why these changes, tests are green with the patch from #2, what are the changes added in patch #10 ?

Thanks!

czigor’s picture

I'm testing with latest HEAD from drupal core, entity_translation and title and I get 13 fails with the patch in #2. The patch in #10 makes everything green.

@Pol: you said you got 13 fails as well, how did you fix that?

czigor’s picture

Status: Reviewed & tested by the community » Needs review
Related issues: +#2724773: Translation tests fail on site with english language prefix (global $language_url is not reset in tests)
Pol’s picture

Hi,

Ok thanks for the clarification, I hope Plach will commit this asap.

Regarding the 13 fails, they are gone, check messages in #2757739: Token value is not sanitized, when replaced from title field.

plach’s picture

Thanks for your contributions, guys!

I'm seeing a few changes in the latest patch that are a bit concerning as they may imply an undesired behavior change. I'm going to commit the attached patch, that is making tests green here in my local environment. It's basically a few hunks from #10 plus some cosmetic / coding standard fixes. I'd suggest to review only https://www.drupal.org/files/issues/title-test_fixes-2813673-15.review.txt for the actual changes.

Let's see whether the bot is happy now. We can push more changes if something is still broken.

  • plach committed 91b2d02 on 7.x-1.x authored by czigor
    Issue #2813673 by plach, czigor, Stevel: Tests broken since new...

Status: Needs review » Needs work

The last submitted patch, 15: title-test_fixes-2813673-15.patch, failed testing.

plach’s picture

Unfortunately it seems we have DrupalCI issues atm, so I cannot tell whether this is fixed:

https://dispatcher.drupalci.org/job/default/298540/console

The patches here will no longer apply, so failures are expected, however not even branch tests are completing atm :(

czigor’s picture

Now locally I get this test result for HEAD:

Admin settings 16 passes, 25 fails, 0 exceptions, and 5 debug messages
Field replacement 87 passes, 83 fails, 0 exceptions, and 37 debug messages
Replaced fields translation 38 passes, 67 fails, 19 exceptions, and 13 debug messages

Pol’s picture

With Entity Translation:HEAD ?

czigor’s picture

@Pol Still everything on HEAD, yes. But found out that on the web UI tests pass, on CLI they fail.

plach’s picture

I have all green with the latest -dev versions of Drupal core, ET, Entity and Title. Both via run-tests.sh and UI.

Let's wait for the bot to see whether at least he's happy.

I suspect that due to the way tests are written right now, they may somehow be affected by the host installation.

czigor’s picture

Pol’s picture

mmmh... running out of idea :(

plach’s picture

Actually branch tests are failing but with different numbers than #19. From looking at the errors I suspect this has something to do with the installation profile. Let's try the attached patch.

Status: Needs review » Needs work

The last submitted patch, 27: title-test_fixes-2813673-27.patch, failed testing.

joseph.olstad’s picture

for possible hints to fix this for the title module tests, see
entity_translation git diff 0cd07cf4769a92 a8ae1e78c57c6

diff --git a/tests/entity_translation.test b/tests/entity_translation.test
index 2a647be..b552ed1 100644
--- a/tests/entity_translation.test
+++ b/tests/entity_translation.test
@@ -64,6 +64,7 @@ class EntityTranslationTestCase extends DrupalWebTestCase {
       $this->admin_user = $this->drupalCreateUser(array_merge(array(
         'bypass node access',
         'administer nodes',
+        'administer fields',
         'administer languages',
         'administer content types',
         'administer blocks',
DamienMcKenna’s picture

Minor changes to the setUp() methods.

Oddly enough, all of the tests pass locally, but they still fail on drupalci trying to enable the modules.

joseph.olstad’s picture

Try changing:

$admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer taxonomy'));

to:

$admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer taxonomy', 'administer fields'));
DamienMcKenna’s picture

The fact that so many of the setUp() methods are failing when just enabling the modules is kind of messed up :-\ I need to check the console output.

DamienMcKenna’s picture

Status: Needs review » Needs work

I wonder if we need to get the test dependencies committed first, then work on the tests themselves?

DamienMcKenna’s picture

Lets split the tests into pieces so they're individually easier to maintain. Also, lets list the dependencies required for the tests.

DamienMcKenna’s picture

The tests still pass locally.

I don't suppose a maintainer could test this locally and then commit it? :) I'm happy to help get this issue finished but I think we've hit an infrastructure problem.

Stevel’s picture

Status: Needs review » Needs work

The dependencies should also be listed in the getInfo() method, so that the tests are skipped when these modules are not available (e.g. in local testing).

Also, testbot installs drupal/modules/dependencies before applying the patch, so yes, to run the tests, the dependencies have to be committed first.

DamienMcKenna’s picture

Status: Needs review » Needs work

The last submitted patch, 37: title-n2813673-37.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Stevel’s picture

TitleAdminSettingsTestCase probably needs to load the taxonomy module in setUp(), since a permission from it is used. That should fix at least most of the errors.

joseph.olstad’s picture

joseph.olstad’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 40: title-n2813673-40.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

joseph.olstad’s picture

Status: Needs work » Needs review
FileSize
44.35 KB
1.59 KB

not sure why my patch is so much bigger than 37..

joseph.olstad’s picture

FileSize
44.38 KB
1.76 KB

The last submitted patch, 43: title-n2813673-41.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Status: Needs review » Needs work

The last submitted patch, 44: title-n2813673-43.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

joseph.olstad’s picture

Status: Needs work » Needs review
joseph.olstad’s picture

FileSize
2.42 KB
44.72 KB

new patch

Status: Needs review » Needs work

The last submitted patch, 48: title-n2813673-47.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

joseph.olstad’s picture

ok, I think this might help.

joseph.olstad’s picture

in 2016 I fixed similar issue in webform_localization by re-ordering the modules in setUp.

taxonomy should come last so that it actually gets installed first.

joseph.olstad’s picture

DamienMcKenna’s picture

Still the same number of errors. Putting the cleaner code back.

DamienMcKenna’s picture

Same results, as expected.

Lets go back to the step we know we need - this adds the test dependencies to the info file.

DamienMcKenna’s picture

Duh, don't need to list taxonomy as a test dependency X-)

DamienMcKenna’s picture

One other small tweak - there's no need to list title.module as a files[] line as there are no classes defined in it.

joseph.olstad’s picture

taxonomy , why?

joseph.olstad’s picture

The last submitted patch, 52: title-n2813673-53.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

DamienMcKenna’s picture

I'm working on getting the drupalci test suite to run locally so I can confirm whether committing #56 will solve the initial problems.

joseph.olstad’s picture

+    /* Reset the permissions cache prior to calling drupalCreateUser
+     * see notes here: https://api.drupal.org/comment/28739#comment-28739
+     */
+    $this->checkPermissions(array(), TRUE);

Do this, will probably help the permissions issues. do this right before drupalCreateUser

DamienMcKenna’s picture

I really don't think that matters, given that the tests work a-ok locally.

DamienMcKenna’s picture

Just to be clear - it doesn't matter what we do with permissions, etc if the modules aren't being enabled correctly, that's the source of the problems.

  • plach committed fd7ec44 on 7.x-1.x authored by DamienMcKenna
    Issue #2813673 by joseph.olstad, DamienMcKenna, plach, czigor, Stevel:...
plach’s picture

Committed and pushed #56, thanks for your efforts here, hugely appreciated!

The last submitted patch, 34: title-n2813673-34.patch, failed testing. View results

The last submitted patch, 53: title-n2813673-53.patch, failed testing. View results

The last submitted patch, 54: title-n2813673-54.patch, failed testing. View results

The last submitted patch, 55: title-n2813673-55.patch, failed testing. View results

Status: Needs review » Needs work

The last submitted patch, 56: title-n2813673-56.patch, failed testing. View results

plach’s picture

Status: Needs work » Fixed

Whoo-hoo, tests are passing again! Awesome work!

https://www.drupal.org/node/11063/qa

DamienMcKenna’s picture

Status: Fixed » Needs review
FileSize
31.93 KB

Thanks. I'd still like to get the other test refactoring included, so here's that patch.

DamienMcKenna’s picture

All green, now that's more like it :)

plach’s picture

Status: Needs review » Needs work

TitleTranslationTestCase.test is missing from the patch.

Aside from that, is there any actual change to the test code? If not can we have a simple rename patch? You may need to add the following lines to your git config:

[diff]
  renames = copies
DamienMcKenna’s picture

Status: Needs work » Needs review
FileSize
20.68 KB

Whoops! Thanks for noticing the missing file.

This patch makes a few changes:

  • Each class is split into its own file.
  • The test dependencies are listed in getInfo().
  • The $profile variable is overridden properly.
  • The setUp() method's prototype is updated to the proper format.
  • The setUp() method's modules listing is streamlined.
plach’s picture

+++ b/tests/TitleAdminSettingsTestCase.test
@@ -0,0 +1,80 @@
+    $modules[] = 'locale';
...
+    // Other dependencies.
+    $modules[] = 'entity';
+    $modules[] = 'entity_translation';

Why are we adding these dependencies?

DamienMcKenna’s picture

Good question. I'm not sure =) Must have been a copy/paste mistake.

This removes the unnecessary dependencies from that one test.

plach’s picture

Status: Needs review » Fixed

Committed and pushed, thanks!

DamienMcKenna’s picture

Woohoo, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.