Support from Acquia helps fund testing for Drupal Acquia logo

Comments

naveenvalecha created an issue. See original summary.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

timmillwood’s picture

Status: Active » Closed (outdated)

ModerationState entity doesn't exist anymore.

timmillwood’s picture

Title: EntityResource: Provide comprehensive test coverage for ModerationState entity » EntityResource: Provide comprehensive test coverage for Workflow entity
Issue summary: View changes
Status: Closed (outdated) » Active
Wim Leers’s picture

Issue tags: +Workflow Initiative

Thanks for updating this!

Wim Leers’s picture

Issue tags: +php-novice
Anonymous’s picture

Version: 8.3.x-dev » 8.4.x-dev
Status: Active » Needs review
FileSize
8.43 KB

Status: Needs review » Needs work

The last submitted patch, 7: 2843785-7.patch, failed testing. View results

Anonymous’s picture

Status: Needs work » Needs review
Wim Leers’s picture

Status: Needs review » Needs work

Let's add this test coverage only to 8.4.x, for the same reason as #2843770-11: EntityResource: Provide comprehensive test coverage for ResponsiveImageStyle entity:

Let's get this only committed to 8.4.x then. Reuploading #5, but only testing against 8.4.x, to not confuse committers.

Review:

  1. +++ b/core/core.link_relation_types.yml
    @@ -3,6 +3,12 @@
    +add-state-form:
    +  uri: https://drupal.org/link-relations/add-state-form
    +  description: A form where a state can be created.
    +add-transition-form:
    +  uri: https://drupal.org/link-relations/add-transition-form
    +  description: A form where a transition can be created.
    

    The Workflow module is experimental.

    Therefore these belong in core/modules/workflows/workflows.link_relation_types.yml.

  2. +++ b/core/core.link_relation_types.yml
    --- /dev/null
    +++ b/core/modules/hal/tests/src/Functional/EntityResource/Workflow/WorkflowHalJsonAnonTest.php
    

    The Workflow module is experimental.

    Therefore these belong in core/modules/workflows/tests/src/Functional/Rest.

So: move a few things, then this is ready :) Thanks!

Anonymous’s picture

Status: Needs work » Needs review
FileSize
7.92 KB
7.1 KB

@Wim Leers, thanks for the tip! Done.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

larowlan’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/modules/workflows/tests/src/Functional/Hal/WorkflowHalJsonAnonTest.php
@@ -0,0 +1,30 @@
+ * @group hal

+++ b/core/modules/workflows/tests/src/Functional/Hal/WorkflowHalJsonBasicAuthTest.php
@@ -0,0 +1,24 @@
+ * @group hal

+++ b/core/modules/workflows/tests/src/Functional/Hal/WorkflowHalJsonCookieTest.php
@@ -0,0 +1,19 @@
+ * @group hal

+++ b/core/modules/workflows/tests/src/Functional/Rest/WorkflowJsonAnonTest.php
@@ -0,0 +1,24 @@
+ * @group rest

+++ b/core/modules/workflows/tests/src/Functional/Rest/WorkflowJsonBasicAuthTest.php
@@ -0,0 +1,34 @@
+ * @group rest

+++ b/core/modules/workflows/tests/src/Functional/Rest/WorkflowJsonCookieTest.php
@@ -0,0 +1,29 @@
+ * @group rest

Are these correct after the move?

Anonymous’s picture

These correct for me, because @group allow to check all rest tests regardless of the location.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

@larowlan They're correct (they're consistent with others), but they actually should also have @group workflows is what you're saying. But in Drupal core, we apparently don't do multiple @groups anymore. There's no clear rules for this.

So, leaving it to you to decide what makes sense to you: either keep it as-is, or change all of those to @group workflows.

Sam152’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
2.07 KB
8.01 KB

We have test workflow type plugins we can use, so we aren't coupling workflows tests to content_moderation. Using them makes sense to me in this context.

Wim Leers’s picture

Oh, even better!

Actually, this is not just about test coverage. These functional tests are designed to mimic what actual developers in the real world do, what they expect to work, and guarantees that a given mistake results in a given helpful error message.

Because of that, I think I actually would prefer to use the "real" thing.

I don't feel strongly about this though.

Sam152’s picture

We'd want any workflow types someone might implement to also work and be covered. It's closer to testing the abstraction vs an implementation, but I don't feel that strongly about it either.

Content moderation is probably on the extreme side of how much is wrapped around the specific workflow type, but you could argue it should introduce its own test for those edge cases, if they exist, and workflows should just be testing the abstraction and functionality it provides.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community

#18: Works for me :)

Back to RTBC. Still up to @larowlan to make a choice wrt #15.

Wim Leers’s picture

Component: rest.module » content_moderation.module
Priority: Normal » Major
Issue tags: -Novice, -php-novice +API-First Initiative

This is actually a must-have for the Workflows module to reach beta-level stability, because this helps prevent BC breaks.

Sam152’s picture

Added this to the "must-have" in the roadmap #2843494: WI: Workflows module roadmap.

Wim Leers’s picture

#21: ❤️

  • larowlan committed 6002539 on 8.4.x
    Issue #2843785 by vaplas, Sam152, Wim Leers: EntityResource: Provide...
larowlan’s picture

Issue tags: +Needs followup

Updating credit to include Wim who provided reviews and mentoring here.

Can we get a follow up to move the tests back into rest module when workflow module is stable as per #10?

Committed as 6002539 and pushed to 8.4.x. Thanks!

Gotta love those all numeric shas.

larowlan’s picture

Status: Reviewed & tested by the community » Fixed
Wim Leers’s picture

Can we get a follow up to move the tests back into rest module when workflow module is stable as per #10?

Hm, actually, isn't it better like this? I'd love to eventually move all this REST test coverage into the respective modules at some point I think.

(It means everything is self-contained — imagine each core module being exposed as a separate composer package.)

larowlan’s picture

Issue tags: -Needs followup

Roger that

Wim Leers’s picture

I'd have been happy to open a follow-up if you disagreed — but if you agree, that's even better of course!

Status: Fixed » Closed (fixed)

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