Skip to content

test: serialize every test touching global theme, class and file state - #696

Merged
owjs3901 merged 1 commit into
mainfrom
fix/test-isolation
Sep 30, 2026
Merged

owjs3901 merged 1 commit into
mainfrom
fix/test-isolation

Conversation

@owjs3901

Copy link
Copy Markdown
Contributor

전수조사 #682의 작업 묶음 L(#683) 중 INF-01(KNOWN-16) 을 해결합니다.

문제

#[serial]은 serial 테스트끼리만 동시 실행을 막습니다. 그런데 전역 상태를 쓰는 일부 테스트에 #[serial]이 없었습니다. 그래서 serial 테스트가 전역을 설정한 직후에 다른 테스트가 끼어들어 값을 덮어쓸 수 있었습니다. 전역 상태의 예는 theme token 등록부, typography 키, class·file map, prefix, custom shorthand입니다.

실제로 test_conditional_typography_pipeline이 pre-commit에서 간헐적으로 실패했습니다. test_get_theme_interface와 test_theme_layer_in_css가 set_theme으로 typography 키를 덮어썼기 때문입니다.

변경

테스트 코드만 바뀌며, 패키지 동작 변화는 없습니다.

전역을 직접 쓰거나 읽는 테스트를 모두 찾아 #[serial]을 붙였습니다. 찾을 때는 이름 할당 함수(sheet_to_classname 등)와 전역 prefix·debug·shorthand를 읽는 함수까지 포함해 추적했습니다.

  • libs/css: theme_tokens 테스트 3개, disassemble_property 테스트 1개
  • libs/extractor: gen_styles 테스트 3개, ExtractStyleValue::extract 테스트 1개, vanilla-extract 통합 테스트 3개
  • libs/sheet: 테스트 모듈의 non-serial 테스트 전부(42개)

적용 후 스캔 결과, #[serial] 없이 전역을 건드리는 테스트는 0개입니다.

검증

  • cargo clippy --workspace --all-targets -- -D warnings 통과
  • cargo test --workspace 통과(extractor 1404, sheet 140, css 529 등)
  • pre-commit(lint + tarpaulin + bun test) 통과

Tests writing the process-global theme tokens, class map, prefix or shorthands ran unserialized next to #[serial] tests reading them, which made test_conditional_typography_pipeline flaky. Refs #683.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@github-actions

Copy link
Copy Markdown
Contributor

Changepacks

@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
libs/css/src/lib.rs 100.00% <ø> (ø)
libs/css/src/theme_tokens.rs 100.00% <ø> (ø)
...extractor/src/extract_style/extract_style_value.rs 100.00% <ø> (ø)
libs/extractor/src/gen_style.rs 100.00% <ø> (ø)
libs/sheet/src/lib.rs 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@owjs3901
owjs3901 merged commit 883313b into main Sep 30, 2026
4 checks passed
@owjs3901
owjs3901 deleted the fix/test-isolation branch September 30, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant