Move migration tests to the Forum module

Created on 26 January 2023, over 2 years ago
Updated 10 February 2023, about 2 years ago

Problem/Motivation

Move and adjust migration tests as needed so that forum can be deprecated.

Steps to reproduce

Proposed resolution

Keep the references to forum in these files. Forum is in the tests because forum content exists in the source database and fields and the content type will be found.
\migrate_drupal_migration_plugins_alter - leave this. It alters the destination vid to be 'taxonomy_forums' as needed.
\Drupal\Tests\migrate_drupal\Kernel\d7\FieldDiscoveryTest
\Drupal\Tests\migrate_drupal\Kernel\dependencies\MigrateDependenciesTest
\Drupal\Tests\migrate\Unit\process\MakeUniqueEntityFieldTest::testMakeUniqueEntityFieldMigrated

Remaining tasks

Decide if the fixtures should be reduced in size. It may just need forum enabled and the variables.

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.1 ✨

Component

forum.module

Created by

πŸ‡³πŸ‡ΏNew Zealand quietone

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

Comments & Activities

  • Issue created by @quietone
  • πŸ‡³πŸ‡ΏNew Zealand quietone
  • Status changed to Needs review over 2 years ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Fix the failing test, it was just an entity count in \Drupal\Tests\migrate_drupal_ui\Functional\d6\Upgrade6Test

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Now, do two things
    1) Reduce the size of the test fixtures.
    2) Change the forum Kernel tests to use the fixture in the forum module, not migrate_drupal.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
    +++ b/core/modules/forum/tests/src/Functional/migrate_drupal/d6/Upgrade6Test.php
    @@ -48,44 +48,40 @@ protected function getSourceBasePath() {
    -      'block' => 36,
    -      'block_content' => 2,
    +      'block' => 32,
    +      'block_content' => 1,
           'block_content_type' => 1,
    -      'comment' => 6,
    -      // The 'standard' profile provides the 'comment' comment type, and the
    -      // migration creates 12 comment types, one per node type.
    -      'comment_type' => 14,
    -      'contact_form' => 5,
    +      'comment' => 4,
    +      'comment_type' => 8,
    +      'contact_form' => 2,
           'contact_message' => 0,
    

    Is there anyway we can make this more robust, the equivalent test in Aggregator fails everytime something in core changes

    This looks good to me, but I'm no expert in Migration tests

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    The changes to the entity counts are because I made new source fixtures for Forum. I did that by starting with the existing fixtures and then used the UI to remove non Forum related entities and config. For example, all the translations were removed and many, many fields. The fixtures are now more appropriate for testing Forum migration via the UI. They fixtures should now be easier to work with in the future. And as a bonus, the patch is 2MB smaller.

    The test will still, unfortunately, be effected by changes to the core standard profile. That is a side effect of testing the entity counts.

  • Status changed to RTBC over 2 years ago
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Ok thanks for that

    This looks good to me

  • πŸ‡¬πŸ‡§United Kingdom catch

    Committed a32ff78 and pushed to 10.1.x. Thanks!

    • catch β†’ committed a32ff78e on 10.1.x
      Issue #3336578 by quietone, larowlan: Move migration tests to the Forum...
  • Status changed to Fixed about 2 years ago
  • πŸ‡¬πŸ‡§United Kingdom catch
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024