There are some Drupal 9 compatibility related issues. Which needs to be fixed.

➜ contrib git:(8.8.x) ✗ drupal-check seckit
7/7 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

------ ------------------------------------------------------------------------------------------------------
Line src/Tests/SecKitTestCaseTest.php
------ ------------------------------------------------------------------------------------------------------
13 Class Drupal\seckit\Tests\SecKitTestCaseTest extends deprecated class Drupal\simpletest\WebTestBase:
in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Instead,
use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340.
55 Call to method setUp() of deprecated class Drupal\simpletest\WebTestBase:
in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Instead,
use \Drupal\Tests\BrowserTestBase. See https://www.drupal.org/node/3030340.
------ ------------------------------------------------------------------------------------------------------

[ERROR] Found 2 errors

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pranit84 created an issue. See original summary.

pranit84’s picture

This patch fixes the drupal-check related issues.

➜ contrib git:(8.8.x) ✗ drupal-check seckit
7/7 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

[OK] No errors

pranit84’s picture

pranit84’s picture

Status: Active » Needs review
joshi.rohit100’s picture

Seems we already had issue for this - https://www.drupal.org/project/seckit/issues/3042610

joshi.rohit100’s picture

Status: Needs review » Needs work
  1. +++ b/src/Tests/SecKitTestCaseTest.php
    @@ -385,8 +385,8 @@ class SecKitTestCaseTest extends WebTestBase {
    +    $this->drupalGet('admin/config/system/seckit', [], ['Origin: ' . $base_root]);
    

    This seems not correct as drupalPostForm() submits the form while drupalGet() takes to that page.

  2. +++ b/src/Tests/SecKitTestCaseTest.php
    @@ -400,8 +400,8 @@ class SecKitTestCaseTest extends WebTestBase {
    +    $this->drupalGet('admin/config/system/seckit', [], ['Origin: http://www.example.com']);
    

    Same here.

andypost’s picture

voleger’s picture

  1. index d84a53a..d425d24 100644
    --- a/src/Tests/SecKitTestCaseTest.php
    
    --- a/src/Tests/SecKitTestCaseTest.php
    +++ b/src/Tests/SecKitTestCaseTest.php
    

    The test has to be moved to the /tests/src/Functional/SecKitTestCaseTest.php location

  2. +++ b/src/Tests/SecKitTestCaseTest.php
    @@ -3,14 +3,14 @@
     namespace Drupal\seckit\Tests;
    

    Namespace also need to be changed

Kristen Pol’s picture

Issue tags: +Drupal 9 readiness
Kristen Pol’s picture

Title: Drupal 9 readiness related issues should be fixed. » Drupal 9 compatibility related issues should be fixed.
Issue summary: View changes
Issue tags: -Drupal 9 readiness +Drupal 9 compatibility

Per a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing title and tag cleanup here based on that discussion.

sidharthap’s picture

Status: Needs work » Needs review
FileSize
26.89 KB

Addressing #8 and #6 comments. attaching a new patch moving the file to test directory.

sidharthap’s picture

voleger’s picture

Status: Needs review » Postponed
alexpott’s picture

Status: Postponed » Needs review
FileSize
21.14 KB
21.66 KB

There's no need to wait for a fix to core - also maybe a fix to core is not really necessary as there is a way to add headers to any request made by the test system. Here's a patch that converts the test

alexpott’s picture

Should be green.

alexpott’s picture

Yeah right @alexpott... third time's a charm.

andypost’s picture

Yay! Only 39 cs bugs left...

alexpott’s picture

Well most of those exist in HEAD too... but I guess we can fix them here too. This should help... let's see where we are after this.

andypost’s picture

selva.swamy@gmail.com’s picture

Status: Needs review » Needs work
Issue tags: +ContributionWeekend2020

Getting below issue for this patch when running drupal-check on latest version from GIT

7/7 [============================] 100%

------ -------------------------------------------------------------------------
Line tests\src\Functional\SecKitTestCaseTest.php
------ -------------------------------------------------------------------------
Class PHPUnit\Framework\TestCase not found and could not be autoloaded.
------ -------------------------------------------------------------------------

[ERROR] Found 1 error

DamienMcKenna’s picture

Title: Drupal 9 compatibility related issues should be fixed. » Drupal 9 compatibility related issues for Security Kit module
jenlampton’s picture

I believe that if you add drupal 9 as an option to the composer.json file in this project you can get a nice little Compatible with Drupal 9 badge in the Project information section on the module page.

Screenshot of the Project information section with Compatible with Drupal 9 highlighted

Below is a code sample from a module that has the badge.

"require": {
        "php": "^7.1",
       "drupal/core": "^8 || ^9"
  },

It also looks like it may possible to get the badge by adding the 'core_version_requirement' key in the modules info.yml file, which, in turn, will add the version to the require section of composer.json. Example follows.

core_version_requirement: ^8 || ^9

Do you want to include this change in the patch here or open a separate issue?

sidharthap’s picture

sidharthap’s picture

Status: Needs work » Needs review
suzymasri’s picture

Patch #23 worked for me. It would be great if we can have it merged so we're able to use/test it on D9 projects :)

DamienMcKenna’s picture

The composer.json file is not required in order to get the badge, see the relevant change notice for details.

DamienMcKenna’s picture

FYI to add the D9 support badge you have to edit the project page and fill in the "Drupal 9 porting info" field; per Gábor, the intended automation around the D9 compatibility hasn't been completed, so we need to edit these fields for now.

Manuel Garcia’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks good, and since the composer.json change is not strictly necessary, I believe this is ready to go.

aspilicious’s picture

Status: Reviewed & tested by the community » Needs work

Patch does not apply with composer patches

aspilicious’s picture

Status: Needs work » Needs review
FileSize
24.84 KB

Hmm, patch did apply but not in composer...
Re-uploading to see if it works. I don't need any credits.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

It applies on latest dev and everything is green. So I can confirm this one is good to go.

  • mcdruid committed 2e3afd6 on 8.x-1.x
    Issue #3074080 by alexpott, sidharthap, pranit84, andypost, aspilicious...
mcdruid’s picture

Status: Reviewed & tested by the community » Fixed

Pushed this to 8.x-1.x initially; I understand we may want to create a new branch but this seemed to include some fixes/cleanup that are good to have in the existing branch too.

Fixed one typo in a comment on commit s/is/if.

Thanks everyone!

mcdruid’s picture

Ah, I'm not actually certain we want this in 8.x-1.x with:

-core: 8.x
+core_version_requirement: ^8.8 || ^9

...as that means 8.7 is out of luck, IIUC.

I will try to look at fixing that; probably with a new branch.

aspilicious’s picture

All major modules are doing this, so it's fine.

naveenvalecha’s picture

@mcdruid
Can you cut a new D9 supported release?

mcdruid’s picture

I made an RC1 yesterday on a new semver branch:

https://www.drupal.org/project/seckit/releases/2.0.0-rc1

I am still getting my head around how the new branches etc.. are supposed to work though, so please let me know if I've missed anything.

ressa’s picture

Thanks @mcdruid, I can confirm that the latest release of the Security Kit module can be added with composer require drupal/seckit:^2.0 and that it also passes the Upgrade Status Drupal 9 compatibility check, without errors and only two warnings:

Upgrade Status report

Contributed projects

Security Kit 2.0.0-rc1

Scanned on Thu, 06/11/2020 - 09:28.
2 warnings found.

Check manually

Errors without Drupal source version numbers including parse errors and use of APIs from dependencies.
File name Line Error
web/modules/contrib/seckit/tests/src/Functional/SecKitTestCaseTest.php Class PHPUnit\Framework\TestCase not found.
web/modules/contrib/seckit/tests/src/Functional/SecKitTestCaseTest.php 14 Class PHPUnit\Framework\TestCase not found.
mcdruid’s picture

Thanks @ressa, however are those messages about PHPUnit a false positive?

See, for example: https://www.drupal.org/project/upgrade_status/issues/3137754

If it is an actual problem with the module, I'm not sure I understand what needs to be fixed.

ressa’s picture

I believe I didn't have drupal/core-dev installed at that point, @mcdruid. But since they are warnings, they are perhaps not that important, at least from a Upgrade Status point of view? I suppose you don't see the warnings, perhaps because you have PHPUnit installed?

Status: Fixed » Closed (fixed)

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