Problem/Motivation

Follow up to #3100386: Create contrib update module test cases that use semantic versioning

This issue creates tests for contrib modules that move from legacy releases, such as 8.x-8.0, to semver releases, such as 9.0.0.

Proposed resolution

Create tests for the following cases

  1. Legacy releases to semver where both legacy and the semver majors are support
  2. Legacy releases to semver where legacy is not supported.

Remaining tasks

Tests

User interface changes

NOne

API changes

None

Data model changes

None

Release notes snippet

None

Issue fork drupal-3127168

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

tedbow created an issue. See original summary.

tedbow’s picture

Status: Active » Needs review
StatusFileSize
new240.6 KB
new21.44 KB

Here is on patch on #3100386-35: Create contrib update module test cases that use semantic versioning

I think 3127168-2-do-not-test.patch shows that breaking this off from #3100386 makes sense

tedbow’s picture

Assigned: tedbow » Unassigned

Unassigning myself

+++ b/core/modules/update/tests/src/Functional/UpdateSemverContribTest.php
@@ -49,4 +49,69 @@ protected function setProjectInstalledVersion($version) {
+  /**
+   * Test updates from legacy versions to the semver versions.
+   */
+  public function testUpdatesLegacyToSemver() {

We could still work on this method while waiting on #3100386: Create contrib update module test cases that use semantic versioning so I won't postpone it for now.

dww’s picture

Priority: Normal » Major

Agreed on splitting this out. Seems it should be at least major though, since the parent is critical and this is essential functionality we quickly want coverage of.

A few concerns/nits for 3127168-2-do-not-test.patch:

  1. +++ b/core/modules/update/tests/modules/update_test/semver_test.1.0-legacy-unsupported.xml
    @@ -168,5 +168,83 @@
    +<release>
    
    +++ b/core/modules/update/tests/modules/update_test/semver_test.1.0.xml
    @@ -168,5 +168,83 @@
    +<release>
    
    +++ b/core/modules/update/tests/modules/update_test/semver_test.9.1.0.xml
    @@ -0,0 +1,250 @@
    +<release>
    

    Missing a space in front.

  2. +++ b/core/modules/update/tests/modules/update_test/semver_test.1.0-legacy-unsupported.xml
    @@ -168,5 +168,83 @@
    +    <tag>SEMVER_TEST-8-x-7-1</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-7-1-beta1</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-7-1-alpha1</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-7-0</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-7-0-beta1</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-7-0-alpha1</tag>
    
    +++ b/core/modules/update/tests/modules/update_test/semver_test.1.0.xml
    @@ -168,5 +168,83 @@
    +    <tag>SEMVER_TEST-8-x-7-1</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-7-1-alpha1</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-7-0</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-7-0-beta1</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-7-0-alpha1</tag>
    
    +++ b/core/modules/update/tests/modules/update_test/semver_test.9.1.0.xml
    @@ -0,0 +1,250 @@
    +    <tag>SEMVER_TEST-8-x-8-1</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-8-1-alpha1</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-8-0</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-8-0-beta1</tag>
    ...
    +    <tag>SEMVER_TEST-8-x-8-0-alpha1</tag>
    

    #3113798: Remove unused (and generally wrong) <tag> markup from Update module test XML fixtures or fix.

  3. +++ b/core/modules/update/tests/modules/update_test/semver_test.1.0.xml
    index 00000000000..c4f8a66fccf
    --- /dev/null
    
    --- /dev/null
    +++ b/core/modules/update/tests/modules/update_test/semver_test.9.1.0.xml
    
    +++ b/core/modules/update/tests/modules/update_test/semver_test.9.1.0.xml
    +++ b/core/modules/update/tests/modules/update_test/semver_test.9.1.0.xml
    @@ -0,0 +1,250 @@
    
    @@ -0,0 +1,250 @@
    +<?xml version="1.0" encoding="utf-8"?>
    +<project xmlns:dc="http://purl.org/dc/elements/1.1/">
    

    Until we prioritize #3115435: Make clear why each XML update.module fixture is created the way it is, every update manager issue that adds new test fixtures is adding technical debt since it's making more work for ourselves at #3115435. Since this is a brand new fixture for this issue, let's document it as part of this issue.

  4. +++ b/core/modules/update/tests/modules/update_test/semver_test.9.1.0.xml
    @@ -0,0 +1,250 @@
    +    <!-- This release is not in a supported branch; therefore it should not be recommended. -->
    +    <name>Semver Test 9.2.0</name>
    +    <version>9.2.0</version>
    +    <tag>9.2.0</tag>
    +    <status>published</status>
    +    <release_link>http://example.com/semver_test-9-2-0-release</release_link>
    +    <download_link>http://example.com/semver_test-9-2-0.tar.gz</download_link>
    +    <date>1584195300</date>
    +    <terms>
    +      <term><name>Release type</name><value>New features</value></term>
    +      <term><name>Release type</name><value>Bug fixes</value></term>
    +    </terms>
    +  </release>
    

    Any reason this one is indented 2 spaces, every other one only 1? Oh, at the bottom of the file there are a few more indented 2 spaces. Can we pick an indentation and be consistent about it?

  5. +++ b/core/modules/update/tests/src/Functional/UpdateSemverContribTest.php
    @@ -49,4 +49,69 @@ protected function setProjectInstalledVersion($version) {
    +   * Test updates from legacy versions to the semver versions.
    

    Tests?

  6. +++ b/core/modules/update/tests/src/Functional/UpdateSemverContribTest.php
    @@ -49,4 +49,69 @@ protected function setProjectInstalledVersion($version) {
    +        foreach ($installed_versions as $install_version) {
    

    as $installed_version might make more sense for the scope of this foreach.

  7. +++ b/core/modules/update/tests/src/Functional/UpdateSemverContribTest.php
    @@ -49,4 +49,69 @@ protected function setProjectInstalledVersion($version) {
    +            if ($legacy_major === 8) {
    +              continue;
    +            }
    

    A comment for why we continue/skip this case would be helpful.

  8. +++ b/core/modules/update/tests/src/Functional/UpdateSemverContribTest.php
    @@ -49,4 +49,69 @@ protected function setProjectInstalledVersion($version) {
    +            // @todo Determine if both 8.0.0 and 8.0.1 should be expected as
    +            // "Also available" releases in
    +            // https://www.drupal.org/project/node/3100115.
    

    I thought our convention was:

    "@todo In https://.../node/x determine ..." and to indent subsequent lines of the same @todo.

Thanks,
-Derek

dww’s picture

Status: Needs review » Needs work

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

kunal.sachdev made their first commit to this issue’s fork.

kunal.sachdev’s picture

Opened a merge request , there are no changes from the patch file yet though.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone made their first commit to this issue’s fork.

quietone’s picture

Status: Needs work » Needs review

Two fixtures were missed in the original conversion of the patch. With those restored the test was passing locally. And then I did the cleanup from #4.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new90 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

quietone’s picture

Status: Needs work » Needs review

smustgrave made their first commit to this issue’s fork.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Very nice additional test @quietone!

Added a small nitpicky change but additional test coverage appears fine to me.

longwave’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 6c1d6a5b5e to 11.x and 6313a810fb to 10.3.x. Thanks!

  • longwave committed 6313a810 on 10.3.x
    Issue #3127168 by quietone, tedbow, dww: Create contrib Update test for...

  • longwave committed 6c1d6a5b on 11.x
    Issue #3127168 by quietone, tedbow, dww: Create contrib Update test for...

Status: Fixed » Closed (fixed)

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