Problem/Motivation

See #2687783: Run Javascript tests without breaking contrib. We need to limit by type with all the different options that run-tests.sh takes to decide which tests to run.

Proposed resolution

If the option for example --directory does not automatically limit by type then remove tests which are not the correct type.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
FileSize
1.51 KB
alexpott’s picture

A more elegant approach...

alexpott’s picture

Issue summary: View changes

Test evidence...

 php ./core/scripts/run-tests.sh --color --non-html --url http://drupal8alt.dev/ --directory ./core/modules/node --types PHPUnit-Kernel

Drupal test run
---------------

Tests to be run:
  - Drupal\Tests\node\Kernel\Action\UnpublishByKeywordActionTest

Test run started:
  Tuesday, March 15, 2016 - 18:16

Test summary
------------

Drupal\Tests\node\Kernel\Action\UnpublishByKeywordActionTest   1 passes

Test run duration: 1 sec

 2687837  alex: ~/dev/sites/drupal8alt.dev > php ./core/scripts/run-tests.sh --color --non-html --url http://drupal8alt.dev/ --directory ./core/modules/node --types PHPUnit-Unit

Drupal test run
---------------

Tests to be run:
  - Drupal\Tests\node\Unit\Plugin\views\field\NodeBulkFormTest
  - Drupal\Tests\node\Unit\Plugin\migrate\source\d7\NodeTest
  - Drupal\Tests\node\Unit\Plugin\migrate\source\d7\NodeTypeTest
  - Drupal\Tests\node\Unit\Plugin\migrate\source\d6\NodeByNodeTypeTest
  - Drupal\Tests\node\Unit\Plugin\migrate\source\d6\NodeRevisionByNodeTypeTest
  - Drupal\Tests\node\Unit\Plugin\migrate\source\d6\NodeRevisionTest
  - Drupal\Tests\node\Unit\Plugin\migrate\source\d6\NodeTest
  - Drupal\Tests\node\Unit\Plugin\migrate\source\d6\NodeTypeTest
  - Drupal\Tests\node\Unit\Plugin\migrate\source\d6\ViewModeTest
  - Drupal\Tests\node\Unit\PageCache\DenyNodePreviewTest

Test run started:
  Tuesday, March 15, 2016 - 18:16

Test summary
------------

Drupal\Tests\node\Unit\Plugin\views\field\NodeBulkFormTest     1 passes
Drupal\Tests\node\Unit\Plugin\migrate\source\d7\NodeTest       3 passes
Drupal\Tests\node\Unit\Plugin\migrate\source\d7\NodeTypeTest   3 passes
Drupal\Tests\node\Unit\Plugin\migrate\source\d6\NodeByNodeTy   3 passes
Drupal\Tests\node\Unit\Plugin\migrate\source\d6\NodeRevision   3 passes
Drupal\Tests\node\Unit\Plugin\migrate\source\d6\NodeRevision   3 passes
Drupal\Tests\node\Unit\Plugin\migrate\source\d6\NodeTest       3 passes
Drupal\Tests\node\Unit\Plugin\migrate\source\d6\NodeTypeTest   3 passes
Drupal\Tests\node\Unit\Plugin\migrate\source\d6\ViewModeTest   3 passes
Drupal\Tests\node\Unit\PageCache\DenyNodePreviewTest           7 passes

Test run duration: 8 sec
Mixologic’s picture

Status: Needs review » Reviewed & tested by the community

This appears to work for the testbots. We've ran some tests that include this patch, and everything works as expected.

dawehner’s picture

Its so sad that this code itself cannot yet be tested properly.

Mixologic’s picture

Are you referring to the testbots or to run-tests.sh ?

  • catch committed a1d5f88 on 8.2.x
    Issue #2687837 by alexpott: run-tests.sh --types does not work with --...

  • catch committed 93e7179 on 8.1.x
    Issue #2687837 by alexpott: run-tests.sh --types does not work with --...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to all three 8.x branches, thanks!

  • catch committed c61815e on 8.0.x
    Issue #2687837 by alexpott: run-tests.sh --types does not work with --...

Status: Fixed » Closed (fixed)

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