Problem/Motivation

I read tests weren't passing in the issue queue. I attempted to run them for myself and found that they were in fact not really working. Seems like something we should solve so that we can start moving forward with more trusted future releases.

Proposed resolution

Get tests running properly on d.o

Remaining tasks

  • Get tests passing locally
  • Get test passing on d.o

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Issue fork acl-3191157

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

EclipseGc created an issue. See original summary.

eclipsegc’s picture

Status: Active » Needs review

Ok, so let's talk about this a bit. A couple things of note:

  1. ACL's testing relies on certain semi-deprecated things that are contained in a separate library these days, so I added a composer.json file (which should have been done eventually anyway) and added phpspec/prophecy-phpunit to the require-dev section.
  2. MOST of the changes here are getting rid of deprecations for the sake of making testing look clean. Strictly speaking, they aren't necessary, but I was in the guts of it anyway and getting rid of the deprecation warnings makes the whole things so much easier to read. Doing the effort was a real debugging quality of life improvement.
  3. One of my two biggest concerns is the MigrateAclList78Test.php file. When phpunit tries to do test isolation, it ends up serializing this file, and for whatever reason (I couldn't nail it down) that blows up because of the Database Connection object being present. That's really mystifying frankly though, and tracking it down proved elusive. However, I was comparing it to the MigrateAclList67Test.php file, and couldn't really justify the extra code in the setup of the 78 test. So I removed it and added the same $this->migrateContent() call I found in the 67 test and... tests pass and I no longer get the serialization error. This leaves me scratching my head for a whole lot of reasons and I'm sure we'll need to unpack this a bit yet.
  4. Finally, I had to downgrade from PHPUnit 9.5 to 9.4 which works just fine for manually running tests locally, but I'm unsure how that's going to fly on d.o... so we may need to deal with that.

In any event, I'd like to get Forum Access up and running in a D9 site I'm doing, and... that needs ACL, so here I am :-D. I hope this is on the right path.

Eclipse

eclipsegc’s picture

Ok, so this is passing on 8.9 and 9.1. I'd really like to discuss #3.3

Eclipse

eclipsegc’s picture

So let's revisit my bullet points in #3

  1. ACL's testing relies on certain semi-deprecated things: Ok this is only true in D9, and only matters when trying to get my own testing going. It doesn't matter on D.o so I removed the require-dev dependency in the composer.json. Composer.json is still a baseline expectation for all modules, so I left the composer.json there.
  2. MOST of the changes here are getting rid of deprecations for the sake of making testing look clean. Again, only true in D9. Unfortunately these changes break tests in D8, so I reverted some of it, but other bits were protected $modules even in D8, so kind of split the difference.
  3. MigrateAclList78Test.php This is still a concern I'd like to address.
  4. downgrade from PHPUnit 9.5 to 9.4 Again this was only relevant to my local D9 setup and testing. There was nothing in the PR to deal with this anyway, so I'm just calling on that d.o had us covered.
salvis’s picture

Thank you very much for jumping in, EclipseGc!

Re 3: I don't know why @id.tarzanych did it that way. I'm sending him an email...

eclipsegc’s picture

Great! If we can get this nailed down I'll go look at forum_access and see if I can get it working on D9 as well.

eclipsegc’s picture

Any response to your email wrt this test?

Thanks

salvis’s picture

No, so far no response.

salvis’s picture

Status: Needs review » Fixed

Finally — thank you, EclipseGc

salvis’s picture

Assigned: eclipsegc » Unassigned

All tests are green!!!

gisle’s picture

Great! Thank you, EclipseGc for cracking this one.

Status: Fixed » Closed (fixed)

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