Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 297150

Decide default theme for testing

$
0
0

Problem/Motivation

Today, the default theme when writing tests is classy, which is likely deprecated in the future #3050378: Replace Classy with a starterkit theme. For this, and various other reasons Classy is decoupled from the testing infrastructure: #2352949: Deprecate using Classy as the default theme for the 'testing' profile. Until now, we assume there isn't a default value in Drupal 9 and it is required for all test cases not specifying installation profile to specify which theme they use in their tests. However, “no default” is just one of the possible choices.

The 3 possible choices:

ThemeProsConsWhen best fit?
None
  • Explicit: no surprises, full control
  • Higher chance the test authors choose the most appropriate theme for the test case
Boilerplate: every test must specify itN/A
starkNo boilerplateHigher probability of breaking between minor releases
  • Contrib / custom tests that DO NOT depend on core markup
  • Core tests because they should be updated at the time when markup changes occur
stable9No boilerplateHigher probability of breaking between major releases
  • Contrib / custom tests that DO depend on core markup
  • Contrib / custom tests that are not using markup for testing

(In Drupal 9, the default would be stable9, in Drupal 10, it would be stable10, and so on.)

Default: opt-in vs opt-out?

There might be a way to be both explicit and provide a default value. We could set a default value that is set only if the test case has explicitly opted into the default. One option would be provide TESTING_DEFAULT_THEME constant which would allow test cases to use the current default value. This would remove the need to manually update testing theme on major releases.

Drupal 9
const TESTING_DEFAULT_THEME = ‘stable9’;
const CORE_TESTING_DEFAULT_THEME = ‘stark’;
Drupal 10
const TESTING_DEFAULT_THEME = ‘stable10’;
const CORE_TESTING_DEFAULT_THEME = ‘stark’;

Proposed resolution

TBD

Remaining tasks

  • Decide what is the default theme for testing in Drupal 9 if any
  • Decide if the default theme is set explicitly or implicitly

User interface changes

None

API changes

TBD

Release notes snippet


Viewing all articles
Browse latest Browse all 297150

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>