Validation results comparison assertions (ValidationTestTrait::assertValidationResultsEqual) do not currently provide enough detail to be valuable or actionable, returning failure messages like this:

Failed asserting that actual size 2 matches expected size 1.

This issue will replace the above with this, for example:

Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
         )
         'summary' => 'There is not enough disk space to
create a staging area.'
     )
+    1 => Array &3 (
+        'severity' => 1
+        'messages' => Array &4 (
+            0 => 'Xdebug is enabled, which may have a negative
performance impact on Package Manager and any modules that use it.'
+        )
+        'summary' => null
+    )
 )

Array diffs aren't pretty on the command line, but the important details are all there. The improvement in PhpStorm is stark:

CommentFileSizeAuthor
PhpStorm-Validation_Result_Diff.png200.68 KBtraviscarden
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

TravisCarden created an issue. See original summary.

tedbow’s picture

@TravisCarden great idea! This has been a pain point for me

tedbow’s picture

Issue tags: +core-mvp
tedbow’s picture

Issue tags: -core-mvp

actually, testing improvement could be done after we are in core, we would still be experimental so we don't have to be perfect. I do think we should do it now but I won't want to say this blocks core mvp

traviscarden’s picture

Status: Active » Needs review
tedbow’s picture

Status: Needs review » Reviewed & tested by the community

I think this is good. This is going to save me a lot of time setting a breakpoint inside \Drupal\Tests\package_manager\Traits\ValidationTestTrait::assertValidationResultsEqual

  • tedbow committed e1a0bf4 on 8.x-2.x authored by TravisCarden
    Issue #3320815 by TravisCarden: Make validation result comparison test...
tedbow’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

tedbow’s picture

Issue tags: +core-mvp