Problem/Motivation

Would like to have more real automated tests than the current LoadTest.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

dww created an issue. See original summary.

dww’s picture

Status: Active » Needs review

I started by stealing some group-related test traits from another module I maintain, entitygroupfield. Added some basic test coverage of creating a few groups + users, adding an article node (outside of any groups), configuring group_notify on the group type, then creating more articles in various groups, and making sure the right users got the right emails (at least the right email subjects).

Definitely not exhaustive coverage of all the configuration options, but it's a start.

Bonus, the act of doing this revealed that we're not defining the schema for our modified gnode content enabler plugin config settings. So the tests already found 1 bug. ;)

dww’s picture

https://git.drupalcode.org/project/group_notify/-/pipelines/664595 failed as expected (sort of). When we try to submit the form to configure group_notify for a given group type, we get a 500 instead of a 200, since that page throws an Exception about missing config schema.

So I spawned off #3558646: Missing schema for NotifyGroupNode configuration settings for resolving that part. That's now merged, so rebased in here.

Now the test is revealing other fun. Since we're actually hitting some group_notify code now, the 8.9 job with PHP 7.4 is failing with syntax errors. Tee hee.

And the 10.5.x job with PHP 8.3 is failing since it turns out Group V1 was never ported to support PHP 8.2, much less PHP 8.3. See #3349565: Deprecated function: Use of "static" in callables is deprecated - triggered when adding user to group. So I'm going to downgrade the PHP version for our default D10 job to PHP 8.1 in the 8.x-1.x branch.

dww’s picture

Assigned: dww » Unassigned

Okay, groovy. The 8.x-1.x version of this is now green on all 3 platforms:

https://git.drupalcode.org/project/group_notify/-/pipelines/664652

Meanwhile, I opened another branch to port this to the 2.0.x branch and Group API V3. See https://git.drupalcode.org/project/group_notify/-/merge_requests/12
That revealed I had messed up the V3 schema changes for #3558646: Missing schema for NotifyGroupNode configuration settings, so I pushed another commit to fix that.
Once that was done, the 2.0.x branch is now passing with Group 3.3.x on both D10.5 and D9.5:

https://git.drupalcode.org/project/group_notify/-/pipelines/664666

Going to leave this here for now and call it a night, but I'll plan to merge this tomorrow morning unless there are any concerns.

Super glad I did this, fleshed out all sorts of problems! 🎉

Cheers,
-Derek

  • dww committed ad85d5ec on 2.0.x
    task: #3558643 Add basic notification (Functional PHPUnit) test
    

  • dww committed 8a1dc7b8 on 8.x-1.x
    task: #3558643 Add basic notification (Functional PHPUnit) test, restore...

dww’s picture

Status: Needs review » Fixed

Merged. Huzzah! This gives me a lot more confidence that our pipelines will catch actual bugs now. Still a lot more to cover via #3164923: [META] Add test coverage for Group Notify but this is certainly better than what LoadTest.php alone tells us.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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