Move testing of help topic rendering into child of GenericModuleTestBase

Created on 10 August 2019, over 5 years ago
Updated 17 October 2023, about 1 year ago

Problem/Motivation

As part of #3066512: Add checks for syntax and display of help topic Twig template files β†’ , we are adding a test that installs all the modules and themes, and then verifies that all help topics can be rendered. That test class is core/modules/help/tests/src/Functional/HelpTopicsSyntaxTest.php.

As part of πŸ“Œ Finalize the merge of Help Topics into Help Fixed , we wanted to move the test of help topic rendering into \Drupal\Tests\system\Functional\Module\InstallUninstallTest, in the assertHelp() method

That method is currently verifying that modules and themes implementing hook_help (which we'll be removing/deprecating someday but now required to pass doc-gate), and it should instead verify that all of the help topics for that module can be viewed. We'll need additional tests to do the same for themes and install profiles, which cannot have hook_help but can have help topics. I haven't yet investigated where those should live.

There was intent to unify discovery of enabled modules but core now using module_list

Proposed resolution

Just remove the TODO as it makes no sense to merge tests until fate of hook_help() in 🌱 Deprecate hook_help() and combine with Topics Active

Outdated suggestion was

I think we need to do the following:

a) As in the current HelpTopicsSyntaxTest, with all the core modules and themes installed, run the syntax checks on all the help topics that exist. This will ensure correct syntax of all of the topics, and also that all the Related topics links exist.

b) With a given module, its dependencies, and the core required modules being the only modules installed, verify that all of the module's topics can still be viewed (same for themes). This will make sure that we aren't relying on another module/theme somehow that isn't actually a dependency, such as trying to make a link to a route that doesn't exist unless a certain module is installed... This may not be necessary if πŸ“Œ Make a way for help topics to generate links only if they work and are accessible Fixed is taken care of.

Remaining tasks

patch/review/commit

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
HelpΒ  β†’

Last updated 22 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States jhodgdon Spokane, WA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡«πŸ‡·France andypost

    Gonna check it as help topics are merged to help module

  • πŸ‡«πŸ‡·France andypost

    There's still TODO in HelpTopicsSyntaxTest so the issue still actional

  • πŸ‡«πŸ‡·France andypost

    summary outdated, still makes sense to check supplied topics in common test which installs every module

  • Status changed to Needs review over 1 year ago
  • last update over 1 year ago
    29,566 pass
  • πŸ‡«πŸ‡·France andypost

    There's \Drupal\Tests\system\Functional\Module\InstallUninstallTest::assertHelpwhich is checking required hook_help() implementation for core modules.

    I think we should leave the test as is because
    - it's purpose to do syntax checks of topics, which is unrelated to system module
    - the test already self explaining but InstallUninstallTest doc-block is totally unclear and doing more then decumented

    Install/uninstall core module and confirm table creation/deletion.

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    For the IS update.

    Change you made looks simple enough.

  • Status changed to Needs review over 1 year ago
  • πŸ‡«πŸ‡·France andypost

    Trying to run tests locally

    Testing Drupal\Tests\help\Functional\HelpTopicsSyntaxTest
    Test 'Drupal\Tests\help\Functional\HelpTopicsSyntaxTest::testHelpTopics' started
    Test 'Drupal\Tests\help\Functional\HelpTopicsSyntaxTest::testHelpTopics' ended
    
    
    Time: 06:11.269, Memory: 4.00 MB
    
    OK (1 test, 13382 assertions)
    ...
    real	6m12,258s
    user	0m0,040s
    sys	0m0,022s
    

    Second one can't complete (fails installing mysql as I'm using sqlite)

    Testing Drupal\Tests\system\Functional\Module\InstallUninstallTest
    Test 'Drupal\Tests\system\Functional\Module\InstallUninstallTest::testInstallUninstall' started
    Test 'Drupal\Tests\system\Functional\Module\InstallUninstallTest::testInstallUninstall' ended
    
    
    Time: 12:53.326, Memory: 4.00 MB
    
    There was 1 error:
    
    1) Drupal\Tests\system\Functional\Module\InstallUninstallTest::testInstallUninstall
    Behat\Mink\Exception\ExpectationException: Current response status code is 404, but 200 expected.
    
    ...
    real	12m55,073s
    user	0m0,038s
    sys	0m0,045s
    
    
  • Status changed to RTBC over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Don't mind marking this for you.

  • last update over 1 year ago
    29,571 pass
  • Status changed to Needs work over 1 year ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I looked at the patch and see that this is not moving a test. Setting back to needs work for a title update.

    On the other hand the comment being removed states

    so that it will test with only one module at a time installed and not duplicate the effort

    As I read that it means that the intention was to test each module without other modules installed.

    Looking at the history I find support of that interpretation.

    The @todo comment was added in #3066512-15: Add checks for syntax and display of help topic Twig template files β†’ . The following comment in the issue states,

    c) Write a test that would install all the non-hidden and non-test modules at once, and verify all the help topics can be rendered. This would not be as rigorous as testing with the modules individually installed, because it might mask problems in routes not being defined, but it would be better than nothing.

    It does seem that this is to add more testing. Is there a reason not to add this level of testing?

  • Status changed to Postponed about 1 year ago
  • πŸ‡«πŸ‡·France andypost

    Proper parent is 🌱 Deprecate hook_help() and combine with Topics Active

    when we consider to require help topics instead of hook_help() this action becomes doable

  • Status changed to Active about 1 year ago
  • πŸ‡«πŸ‡·France andypost

    There's GenericModuleTestBase now

Production build 0.71.5 2024