A large majority of the 8.x codebase is now covered by automated testing, and we have been adding extra tests as we discover new places or add new functionality. This issue will track the full test coverage analysis, as there are definitely some areas of code which are not tested.

The equivalent issue for 7.x is #2112869: 7.x test coverage

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Status: Active » Needs review
FileSize
2.43 KB

The section of the status report provided by Scheduler is not covered by tests. A patch on #2781433: Replace deprecated usage of Drupal::url in .install status report passed when manual testing showed several faults in the code. This new test file checks some text and verifies the accuracy of the hrefs in the two links provided.

  • jonathan1055 committed c9df840 on 8.x-1.x
    Issue #2712465 by jonathan1055: Add test for Status Report page
    
jonathan1055’s picture

I have now written tests to cover all of the actions, conditions and events we provide for interaction with Rules. However, until #2775519: Automated testing for 3rd-party modules integrating with Rules is resolved I cannot commit them to our codebase.

jonathan1055’s picture

Issue summary: View changes

I committed the three Rules Integration Test files.

jonathan1055’s picture

I have added a small test to the Revisioning file to test the 'touch' option (alter created date to match publish_on date). Also in this patch is some tidy up:

  1. Use $this->nodeStorage instead of defining $node_storage
  2. Add REQUEST_TIME as second parameter to strtotime() calls so that the result is consistent throughout the test
  3. Remove calls to t( ) which should not be used in automated simpletests. Use printf() instead where parameter values are needed

Adding the test for the 'touch' option in 8.x is a pre-requisite to adding it in 7.x, which I want to do as part of my testing of the Drupal Coverage Coremodule on the DCC test site.

  • jonathan1055 committed 7cae32c on 8.x-1.x
    Issue #2712465 by jonathan1055: Test the 'publish touch' option
    
jonathan1055’s picture

Title: Perform test coverage analysis for 8.x » 8.x test coverage

Committed, so now I can do the same on #2112869-13: 7.x test coverage

jonathan1055’s picture

We now have a test file for the admin settings page - added in #2831429: Date format placeholders not replaced in error message

jonathan1055’s picture

I have divided the 'node delete' test into two functions.

  • jonathan1055 committed 212ad33 on 8.x-1.x
    Issue #2712465 by jonathan1055: Divide the "node delete" test into two...
jonathan1055’s picture

The SchedulerBasicTest needs a few changes:

  • Remove the direct database->update calls (which are not a good thing to do) by setting the $node->$key value then using $node->save()
  • Remove the unnecessary login to adminUser and just log in to schedulerUser
  • Remove the setting of body text which had been used in assertions but got left in by mistake

  • jonathan1055 committed a88ca7a on 8.x-1.x
    Issue #2712465 by jonathan1055: Remove direct DB code and tidy up...
jonathan1055’s picture

The SchedulerDefaultTimeTest needs a few changes:

  • Remove calls to date() and use \Drupal::service('date.formatter') instead
  • Add new assertions to check the error message when saving an invalid default time
  • Remove separate function assertDefaultTime() and put the code into the main test function
  • Replace $this->assertText with $this->assertSession()->pageTextContains
  • Replace $this->assertNoText with $this->assertSession()->pageTextNotContains

  • jonathan1055 committed bd43b86 on 8.x-1.x
    Issue #2712465 by jonathan1055: Fix @todos in DefaultTimeTest
    

  • jonathan1055 committed e3f5d92 on 8.x-1.x
    Issue #2712465 by jonathan1055: Remove @todo comment in DefaultTimeTest
    

  • jonathan1055 committed a696baa on 8.x-1.x
    Issue #2712465 by jonathan1055: Split RulesEventsTest into three test...
jonathan1055’s picture

The above commit splits testRulesEvents() into three separate test functions testRulesEventsNone() when no scheduler dates exist in the node, testRulesEventsPublish() for testing the publish events when the node has publish date and testRulesEventsUnpublish() for the unpublish events. This is so that if one part fails we still get good info on the other parts. Or if something major is wrong then we get three test failures.

  • jonathan1055 committed 06915e6 on 8.x-1.x
    Issue #2712465 by jonathan1055: Expand RulesActionsTest to cover...
jonathan1055’s picture

Status: Needs review » Active

The commit in #19 expands the tests to cover setting the Scheduler dates via Rules actions when creating a new node, not just when editing an existing node.

jonathan1055’s picture

Title: 8.x test coverage » 8.x-1.x test coverage
Assigned: jonathan1055 » Unassigned