Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan created an issue. See original summary.

larowlan’s picture

Issue tags: +Novice
larowlan’s picture

Title: Move Drupal\simpletest\RandomGeneratorTrait and Drupal\simpletest\SessionTestTrait into Drupal\Tests namespace » Move Drupal\simpletest\RandomGeneratorTrait, Drupal\simpletest\WebAssert and Drupal\simpletest\SessionTestTrait into Drupal\Tests namespace
dpopdan’s picture

Assigned: Unassigned » dpopdan
Issue tags: +DCTransylvania
dpopdan’s picture

Status: Active » Needs review
FileSize
3.72 KB

Status: Needs review » Needs work

The last submitted patch, 5: 2702281-move-traits-on-simpletest-5.patch, failed testing.

larowlan’s picture

We need to leave the old classes there, just as stubs.

dpopdan’s picture

Status: Needs work » Needs review
FileSize
11.15 KB

Unfortunately the classes were modified since my last patch, so it won't apply correctly and I am not sure that an interdiff would help in this case. @larowlan I am not sure that I understood correctly what you mean with keep them as stub, can you explain it better please ?

dpopdan’s picture

Assigned: dpopdan » Unassigned
dawehner’s picture

IMHO waiting for #2469721: Add functionality to store browser output to BrowserTestBase would make a bit of sense ...

One question about the patch, why does it not remove some code?

Status: Needs review » Needs work

The last submitted patch, 8: 2702281-move-traits-on-simpletest-8.patch, failed testing.

Torenware’s picture

Would you consider adding UserCreateTrait as well? Or does that need to be a different issue? Looks to be a very simple port, since there aren't much in the way of dependencies on SimpleTest, it turns out. See #2690403: Fatal error: Class 'Drupal\field\Tests\FieldUnitTestBase' not found

larowlan’s picture

@Torenware - thats a new issue - but feel free to post link to it here to illicit some reviews.

dawehner’s picture

Issue tags: +Needs reroll

.

edurenye’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
5.77 KB

Rerolled.

Do we need to do it also for 8.1.x?

dawehner’s picture

I doubt this will land in 8.0.x or 8.1.x now, so maybe deprecated as of 8.2.x ...

edurenye’s picture

Set deprecated in Drupal 8.2.0

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Cool, thank you!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

The deprecated traits should be gutted and use the new traits so we don't have code duplication - which is exactly what traits are supposed to help prevent :)

Torenware’s picture

@alexpott --

The deprecated traits should be gutted and use the new traits so we don't have code duplication

This is OK only as long as you are willing to create some real pain for people writing tests for Contrib modules.

The test bot is set up to use the current dev version, which is now 8.2.x. But people who actually use contrib modules are using 8.1.x now. If you remove the old traits from the 8.2 tree now, then THERE IS NO SIMPLE WAY TO WRITE A TEST THAT USES THESE TRAITS THAT WILL RUN ON 8.1 AND STILL PASS THE TEST BOT. You are effectively forcing people to rewrite their tests to not use these traits. So the code duplication you are ostensibly preventing in Core is going to be forced onto Contrib people. That, or you are effectively asking Contrib people to maintain multiple versions of their 8.x modules, which is ridiculous.

This does not strike me as good for the community. Core does not exist for its own sake. Core exists so people can use it.

Please consider the possibility that a little code duplication in Core might do one hell of a lot to prevent code duplication in a lot of other projects by a lot of other teams.

larowlan’s picture

Assigned: Unassigned » larowlan

working on this

larowlan’s picture

Status: Needs work » Needs review
FileSize
7.92 KB
12.34 KB

"The deprecated traits should be gutted and use the new traits"

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

The patch says these classes will be removed from 9.0.x, so the concerns of #20 should be addressed

alexpott’s picture

@Torenware I think you need to reconsider the -- you gave me in #20 as @larowlan has shown that I didn't want to create pain for anyone. In fact now everyone wins - we have the traits outside of Simpletest, the old traits still work and we only have to maintain the code in one place.

alexpott’s picture

Discussed with @dawehner and we couldn't see a reason to not do this in 8.1.1 as maintaining a single core test code base makes life simpler and there are no bc breaks here.

I was going to commit this but then there were lots of unused uses and an unnecessary trait name replacement.

dawehner’s picture

Thank you alex! Still RTBC for me

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed a1c9c81 and pushed to 8.1.x and 8.2.x. Thanks!

  • alexpott committed ef6c84d on 8.2.x
    Issue #2702281 by edurenye, dpopdan, larowlan, alexpott, dawehner: Move...

Status: Fixed » Closed (fixed)

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

rosinegrean’s picture

Issue tags: -DCTransylvania