Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for enabling and disabling modules and access to their content types #469

Closed
wants to merge 21 commits into from

Conversation

ekes
Copy link
Member

@ekes ekes commented May 26, 2024

Requires localgovdrupal/localgov_geo#118
Will fix #464

To do:

  • Should switch to use the user and group roles we define in the submodules.
  • Add tests for 'Trusted editor' role because users with this role are being given permission to create the content outside of the group.
  • Why does Log Out not work? It does outside of tests.

Bonus:

  • Use logout to compare member and admin: Adding tests for global (non-group path) creation of content when it's included in the access per domain.

…tent types.

Requires localgovdrupal/localgov_geo#118

Notes:

 - Should switch to use the user and group roles we define in the
   submodules.
 - Why does Log Out not work? It does outside of tests.

 - Adding tests for global (non-group path) creation of content when
   it's included in the access per domain.
Sometimes the repeated / from domain and path matter. Sometimes they
don't. Here they do.
@ekes ekes marked this pull request as ready for review June 1, 2024 13:20
@ekes
Copy link
Member Author

ekes commented Jun 1, 2024

Includes tests that will fail that are fixed by #470

@finnlewis finnlewis self-assigned this Jun 4, 2024
@finnlewis
Copy link
Member

Need to test this locally, as 10.3 is not installing on our automated workflows.

@ekes
Copy link
Member Author

ekes commented Jun 5, 2024

@stephen-cox What I noticed and was trying to fix with the commits there is that the project composer.json was requiring @stable so I made a branch that didn't. But when I put feature/4.x-drupal-10.3 5ca117f it errors:

In VersionParser.php line 521:
                                                                               
  Could not parse version constraint feature/4.x-drupal-10.3: Invalid version  
   string "feature/4.x-drupal-10.3"

However, if I put in dev-feature/4.x-drupal-10.3 or feature/4.x-drupal-10.3-dev it's going to append -dev to the string

run: echo "COMPOSER_REF=${GIT_BRANCH}-dev" >> $GITHUB_ENV

So I guess... well it would be nicest if it did the appending automatically but didn't version fail? But otherwise should the lines to add -dev go? I'm now not sure.

But I think it is the version constraint on drupal core in the project composer.json that was causing the issue for not running the tests.

@stephen-cox
Copy link
Member

@ekes @finnlewis I have fixed testing against Drupal 10.3 with: #482

Do we want to merge this PR? Otherwise you can merge the fix/test-10.3 branch into your feature branches.

@finnlewis
Copy link
Member

@stephen-cox this is the one we want to start with.

@stephen-cox
Copy link
Member

I've fixed the coding standards errors and there's another issue for the deprecated code issues #483

The tests look correct to me and are failing because they pick up genuine issues. Are we just adding tests here or are we trying to fix stuff?

There are a load of PRs just adding tests and they are now all mixed up as well, which is quite confusing.

If we're just adding tests can we create one PR for them and close all the others? We could then detail all the issues found so we can start fixing them.

@ekes
Copy link
Member Author

ekes commented Jul 12, 2024

Failing tests should be fixed in 470

Includes tests that will fail that are fixed by #470

@finnlewis
Copy link
Member

The tests look correct to me and are failing because they pick up genuine issues. Are we just adding tests here or are we trying to fix stuff?

Thanks @stephen-cox ! The intention was for those tests to fail here, so we can confirm #470 fixes them.

I've merged your commits from here to #470 / https://github.com/localgovdrupal/localgov_microsites_group/tree/feature/464-access-disabled-modules--plus

Let's close this one in favour of #470

We agree that the tests are testing the right thing, which did break, and hopefully will not break in the future.

@finnlewis finnlewis closed this Jul 18, 2024
@stephen-cox stephen-cox deleted the feature/464-access-tests-enable-disable-modules branch July 23, 2024 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add phpunit tests to cover enabling and disabling content types for a given microsite.
3 participants