Functional Javascript test false postive and missing browser output

Created on 16 December 2024, 2 months ago

Problem/Motivation

The test-only job for MR 10539 for 🐛 Placing a block containing a form in navigation layout prevents layout builder from saving Active unexpectedly passed. Running the functional javascript test with the same changes locally fails as expected. While trying to investigate why the test was passing on CI, I noticed this warning in the job log https://git.drupalcode.org/issue/drupal-3493671/-/jobs/3689786

WARNING: ./sites/simpletest/browser_output: no matching files. Ensure that the artifact path is relative to the working directory (/builds/issue/drupal-3493671) 

In discussion on Slack, it was noted it is possible that there are no browser_output files for the test-only job because it is run directly with phpunit instead of runtests.sh.

I took another approach and created test only MR 10540. I was still not able to recreate the same failing results as on local, even after rewriting the tests in various ways. While looking at job logs, I noticed that job artifacts did not consistently contain browser_output files for the relevant test: Drupal\Tests\navigation\FunctionalJavascript\NavigationBlockUiTest, so it was not possible to see what was going on in the test run on CI.

The latest version of the test code also has an assertion that should definitely fail:

$this->assertSession()->pageTextContains('this should fail on purpose asdjfasd;jfasfjasa');

but the job still passed :

Steps to reproduce

Proposed resolution

Remaining tasks

  1. Identify whether browser-based tests in the test-only job are expected to produce browser output in the artifact
  2. Identify whether browser-based tests are expected to produce browser output even if the tests pass
  3. Identify whether there are false negatives or positives running browser-based tests from factors outside the tests themselves

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

phpunit

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024