test: serialize every test touching global theme, class and file state - #696
Merged
Merged
Conversation
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>
Contributor
Changepacks |
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
전수조사 #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 등)