Comments

rfay created an issue. See original summary.

rfay’s picture

Status: Active » Needs review
StatusFileSize
new22.44 KB

Status: Needs review » Needs work

The last submitted patch, 2: examples.field_example_phpunit_conversion_2821773_02.patch, failed testing.

martin107’s picture

Status: Needs work » Needs review
StatusFileSize
new4.02 KB
new22.33 KB

To express the test failure in conversational english

I looked in the file found this class and it had no testXYY() methods.

1) FieldExampleBrowserTestBase needs to be abstract

2) I fix the phpcs errors reported by testbot.

Lal_’s picture

The patch works fine.

mile23’s picture

Status: Needs review » Needs work

@AbhishekLal: If you've reviewed a patch you can go ahead and set the status to 'reviewed and tested by the community.'

None of the converted tests are removed.

Running the tests like this:

$ SIMPLETEST_BASE_URL=http://localhost:8888/ ./vendor/bin/phpunit -c core/ --testsuite functional --group field_example --stop-on-error

..results in fail/errors:

PHPUnit 4.8.35 by Sebastian Bergmann and contributors.

E

Time: 42.37 seconds, Memory: 36.00MB

There was 1 error:

1) Drupal\Tests\field_example\Functional\ColorBackgroundFormatterTest::testSingleValueField
Behat\Mink\Exception\ExpectationException: Current response status code is 404, but 200 expected.

/Users/paul/pj2/drupal/vendor/behat/mink/src/WebAssert.php:770
/Users/paul/pj2/drupal/vendor/behat/mink/src/WebAssert.php:130
/Users/paul/pj2/drupal/core/tests/Drupal/Tests/BrowserTestBase.php:717
/Users/paul/pj2/drupal/modules/examples/field_example/tests/src/Functional/FieldExampleBrowserTestBase.php:67

FAILURES!
Tests: 1, Assertions: 4, Errors: 1.

Examples always tests against the dev branch for the latest stable release. The current release is 8.3.2, so we should run tests against the core 8.3.x branch.

Re-running the test in #4.

martin107’s picture

Status: Needs work » Needs review
StatusFileSize
new20.6 KB
new16.55 KB

Thanks - files removed.

./vendor/bin/phpunit -c core/ --testsuite functional --group field_example --debug -vvv --stop-on-error

now shows as green.

  • Mile23 committed 9173b8f on 8.x-1.x authored by martin107
    Issue #2821773 by martin107, rfay, AbhishekLal: Convert field_example...
mile23’s picture

Status: Needs review » Fixed

Ahh, that same old TestDiscovery bug that ruins everyone's day (or at least mine):

php ./core/scripts/run-tests.sh --types PHPUnit-Functional --concurrency 10 --browser field_example

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

Fatal error: Uncaught Error: Cannot instantiate abstract class Drupal\Tests\field_example\Functional\FieldExampleBrowserTestBase in /Users/paul/pj2/drupal/core/scripts/run-tests.sh on line 785

[... etc ...]

Anyway, yah, that's unrelated.

Committed and pushed. Thanks!

Status: Fixed » Closed (fixed)

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