Test that rely on openapi validation should fail explicitly if dev requirements are not present.

Created on 31 January 2025, 3 months ago

Overview

I was running into weird test issues with a new test I was writing a functional phpunit test.

To determine if the problem was something my environment vs something wrong with the test I was writing, I ran \Drupal\Tests\experience_builder\Functional\XbConfigEntityHttpApiTest::testPattern and other tests locally on 0.x. These tests were also not passing and where giving errors like

Exception: Warning: Undefined array key "machineName"
Drupal\experience_builder\Entity\JavaScriptComponent::denormalizeFromClientSide()() (Line: 122)

I eventually figured out that debugging I removed the dev dependencies for OpenApi validation. It would very good if the tests failed with a obvious message when this happen.

Right now the test were failing because the requests were making to the production code with invalid shapes so the errors were not obvious

Proposed resolution

Make it obvious when this happens

User interface changes

πŸ“Œ Task
Status

Active

Version

0.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

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