Problem/Motivation

While testing the upgrade path we are encountering different issues or scenario's that would be really nice to have test for. To make sure the upgrade path is really stable, we should add tests for a bunch of different scenario's..

Proposed resolution

Create fixtures for a bunch of different scenario's and test the upgrade path against all of them.

Remaining tasks

  • Define the scenario's
  • Create the fixtures
  • Make sure the tests are passing for all of them

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#8 2915738-8.patch336.49 KBwoprrr
#7 2915738-7.patch547.81 KBwoprrr
#4 2915738-2.patch221.42 KBmarcoscano

Comments

seanB created an issue. See original summary.

seanb’s picture

One of the scenario's we should test is #2916788: system_update_8402 does not affect media entities

marcoscano’s picture

Status: Active » Needs work
StatusFileSize
new221.42 KB

This patch is @phenaproxima's work from https://www.drupal.org/node/2915738#comment-12296884. It includes a requirements test, as well as a new fixture.

My review while testing it is:

+++ b/tests/src/Functional/CoreMediaUpdatePathRequirementsTest.php
@@ -0,0 +1,46 @@
+    // The fixture had the 1.x versions of several media type providers
+    // installed.
...
+    // The fixture had a generic media type, but Media Entity Generic is not
+    // present in the current code base.

If I understand correctly, this test assumes a codebase in a state that matches the fixture (drupal-8.3.7-media-suite). Can't we try to avoid that? It will quickly start to get very difficult to manage that while running tests. (By the way, I'm not sure if it's possible at all)

In other words, if you are running this test in a codebase with media_entity_instagram 2.x, the assert

$assert->pageTextContains('Some modules that depend on media entity were not updated or uninstalled.');

will fail.

However, if we are running tests that use the fixture 8.4 (that assumes different codebases), we'll need to update the codebase before running the test.

marcoscano’s picture

Title: Add more fixtures to test different scenario's of the upgrade path » Improve automated tests of Media Entity upgrade path to Media core
Category: Feature request » Task

Repurposing this to be more generic.

In https://www.drupal.org/project/media_entity/issues/2923400#comment-12357373 new tests were added to Media Entity 2.x to test upgrade scenarios, but we agreed there that the best place for them was in their own issue. So this is the one! Let's continue the conversation here.

woprrr’s picture

I will continue work on it and phenaproxima test can be easily associated with https://www.drupal.org/project/media_entity/issues/2923400#comment-12357373 tests. Can we consider to prepare a suite of DataProvider applicable on each providers (eg: UpgradeTestBase) and add one test in that suite by provider to add more module specific things. The Goal of this is to increase readability/following of each tests we need to write.

In each case we should process in setUp() the load of fixture before updb and then fire updb to test if our UX have survived ? Or we just need to add provider module and then test it individualy in media core context ?

In 2923400 I have purposed a createMedia() very abstract method to be used in ALL tests contexts.

woprrr’s picture

StatusFileSize
new547.81 KB

Hi there,

I worked a lot on that issue last days to reproduce and continue/merge all tests write here and #2923400: Source data for Image media entities lost during upgrade to core's Media module. First step to continue these tests we need to update the media suite fixture provided by @marcoscano to have a real revelant tests on top of 8.4. I attach a patch with the fixture updated (in same state/modules activated) with small contents added to be sure media with provider properly survive to upgrade path.

I have already talk a lot in media slack about somes troubles encountered during this update/upgrade with specific additional modules (entity browser / dropzonejs).

My first feedback :

  1. We need some clarifications about Dropzonejs module upgrade with media. We need to upgrade media first and switch/use dropzonejs after because we have some troubles during update_n ( #2915745: Make sure dropzonejs_eb_widget_update_8201 runs after media_entity update ).
  2. We also need to update media before upgrade entity browser too, drush mecu command doesn't see the potential fails during 8201 update (media upgrade).

Modules inside media suite tests (fixture).

This Scenario are referenced as Scenario 14 in "2880334 Media Entity upgrade path testcases" sheet.

Before upgrade installed in fixture:

Warning : Do not forget to download blazy/slick libraries first.

  • media_entity
  • media_entity_document
  • media_entity_image
  • media_entity_twitter
  • media_entity_instagram
  • media_entity_slideshow
  • entity_browser
  • video_embed_media
  • slick_media
  • dropzonejs
  • blazy

Composer friendly format :

    "drupal/ctools": "^3.0",
    "drupal/entity_browser": "1.x",
    "drupal/entity_embed": "^1.0@beta",
    "drupal/blazy": "^1.0@RC",
    "drupal/dropzonejs": "^1.0@alpha",
    "drupal/media_entity": "^1.6",
    "drupal/media_entity_document": "^1.1",
    "drupal/media_entity_image": "^1.2",
    "drupal/media_entity_instagram": "^1.4",
    "drupal/media_entity_slideshow": "^1.2",
    "drupal/media_entity_twitter": "^1.3",
    "drupal/video_embed_media": "^1.5",
    "drupal/slick_media": "^1.0",

To Upgrade the media suite needed modules :

  • entity_browser
  • video_embed_field
  • media_entity_twitter
  • media_entity_instagram
  • media_entity_slideshow
  • dropzonejs
  • blazy

Composer friendly format :

    "drupal/ctools": "^3.0",
    "drupal/entity_browser": "^2.0@alpha",
    "drupal/entity_embed": "^1.0@beta",
    "drupal/blazy": "^1.0@RC",
    "drupal/dropzonejs": "^2.0@alpha",
    "drupal/media_entity_instagram": "^2.0@alpha",
    "drupal/media_entity_slideshow": "^2.0@alpha",
    "drupal/media_entity_twitter": "^2.0@alpha",
    "drupal/media_entity_generic": "^1.0@alpha",
    "drupal/media_entity_actions": "^1.0@alpha",
    "drupal/video_embed_field": "^2.0@alpha",
    "drupal/slick_media": "^1.0",

I will continue the TESTS part today.

woprrr’s picture

StatusFileSize
new336.49 KB

Sorry problems during compress of fixture and exclude Mac os extensions.