Skip to content

fix(design): check the design test bound and source hex values - #4922

Merged
dan-petty merged 2 commits into
mainfrom
fix/4906-design-token-checks
Nov 12, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4906-design-token-checks

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The review of #4811 found two gaps in the design token checks.

  • The step "Run the Design Tests" had a limit of 2 minutes, but one test had a bound of 600 s. This broke "Nested Time Limits" in ARCHITECTURE.md: a hung test stopped the step with no pytest-timeout diagnostic. The step now gives --timeout 60, and the contract test asserts a test bound shorter than the step.
  • Each DTCG source color holds its value in components and in hex. Style Dictionary reads only components, so a change to hex alone passed every check. A new design test compares the hex of each of the 66 source colors with its components (coloraide). docs/DESIGN.md tells a person to keep the two equal. The sources keep hex because people read it.

Closes #4906

Change: openspec/changes/archive/2026-11-12-4906-check-the-design-test-bound-and/

The step "Run the Design Tests" gives pytest a bound of 60 s for one test, shorter than its 2-minute limit, and the contract test asserts it. A new design test fails when the hex of a source color is not the color of its components, because the build reads only the components.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/design The design spec, its tokens and their build labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Review findings of #4811 and what this pull request does

#4811 (issue #4738) is merged and #4738 is closed, so this pull request delivers the fixes under the follow-up issue #4906.

# Severity File Finding Verification Action
1 major .github/workflows/ci.yml The step "Run the Design Tests" has a limit of 2 minutes, but the bound of one test is 600 s. This breaks "Nested Time Limits" in ARCHITECTURE.md. Confirmed. The step ran uv run pytest tests/design -n 0 with no --timeout, and pyproject.toml sets timeout = 600. The contract test checked step < job, but not test < step. Fixed. The step runs uv run pytest tests/design -n 0 --timeout 60. The contract test asserts this command and 0 < bound < step limit in seconds. The job comment says the same.
2 major design/tokens/light.tokens.json Each source color holds its value in components and in hex. The build reads only components, and no check compares the two. Confirmed. With the locked Style Dictionary 5.8.0, a change of color.bg hex to #fffffe, then make design-tokens, changed only the source file. All 66 colors agree on main now. Fixed with the first proposed fix. test_the_hex_of_each_source_color_is_the_color_of_its_components converts components with coloraide and compares the result with hex. docs/DESIGN.md "Change a token" tells a person to keep the two equal, and "Checks" lists the test. The sources keep hex, because people read it in the source, in a diff and in the Palette table. The design of the change records the removal of hex as a rejected alternative.

Measurements

  • uv run pytest tests/design -n 0 --durations=3: 16 passed in 10.7 s. The slowest test takes 0.8 s, so a bound of 60 s has a large margin and is half of the step limit.
  • uv run devops ci fail-to-pass --base origin/main: test_the_design_tokens_job_builds_the_tokens_only_when_a_path_of_its_filter_changes fails on the base and passes on the head (1 failed and 122 passed on the base).
  • The hex test passes on the base, because no drift exists on main. Its red run: with color.bg hex set to #fffffe, the test fails with {'light:color.bg': '#fffffe'} != {}.
  • uv run pytest tests/design tests/invariants/test_workflow_contracts.py -n 0: 135 passed.

@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 04:20
@dan-petty
dan-petty merged commit e2c1a5a into main Nov 12, 2026
26 checks passed
@dan-petty
dan-petty deleted the fix/4906-design-token-checks branch November 12, 2026 04:21
dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.116.0](v0.115.0...v0.116.0)
(2026-11-12)


### Features

* **gh:** name the gh groups issue, run, label and secret
([#4923](#4923))
([2dd4c97](2dd4c97))


### Bug Fixes

* **ci:** set job timeouts from the measured run times
([#4892](#4892))
([e26dde5](e26dde5))
* **design:** check the design test bound and source hex values
([#4922](#4922))
([e2c1a5a](e2c1a5a))
* **k8s:** check the credential sync context as a kubeconfig name
([#4916](#4916))
([8797c88](8797c88))
* **roadmap:** bound the stage gate returns and start no return in a
drain ([#4925](#4925))
([77eed38](77eed38))
* **roadmap:** count each implement outcome once with its repo
([#4903](#4903))
([c17f71f](c17f71f))
* **roadmap:** refine looks again at a wait that older rules set
([#4919](#4919))
([e6f7cb9](e6f7cb9))


### Performance Improvements

* **k8s:** put the dependencies in their own image layers
([#4872](#4872))
([48dc866](48dc866))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/design The design spec, its tokens and their build type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(design): check the design test bound and source hex values

1 participant