Repository navigation
Conversation
JeanMeche
force-pushed
the
test/full-compliance-goldens
branch
5 times, most recently
from
October 16, 2026 06:02
f0084fe to
b5ce000
Compare
Member
Author
Self-Review & Trade-offs of Full-File Compliance GoldensHere is a critical self-review of this change, highlighting the design trade-offs, subtle edge cases, and areas for reviewer scrutiny. Summary of Changes
Trade-offs & Challenges to Consider1. Golden churn vs. full-file coverage
2. Loss of symbolic enum macro names
3. Running Prettier on generated output in
|
JeanMeche
force-pushed
the
test/full-compliance-goldens
branch
from
October 16, 2026 06:17
b5ce000 to
90a2aea
Compare
JeanMeche
marked this pull request as ready for review
October 16, 2026 17:52
JeanMeche
force-pushed
the
test/full-compliance-goldens
branch
2 times, most recently
from
October 17, 2026 15:27
4281f6b to
344a10d
Compare
JeanMeche
force-pushed
the
test/full-compliance-goldens
branch
from
October 18, 2026 05:27
344a10d to
1caccba
Compare
… goldens Migrate the ngtsc compliance test suite from snippet-based golden files to full-file golden files: - Expand macro calls (__AttributeMarker, __SelectorFlags, __QueryFlags, __i18nMsg__) and $...$ identifier placeholders in compliance golden files to full-file ngtsc output. - Format full-file compliance golden files and generated compliance outputs (`ngtsc` and `ngp`) with Prettier (`printWidth: 100`). - Consolidate multi-snippet expectations in TEST_CASES.json into single full-file expectations and un-share shared line-ending normalization expectations so each test case has its own full-file golden, using `…` for partial-linker divergent fragments. - Enforce start-of-file and end-of-file bounds in `expectEmit` for full-file goldens, sub-chunk large token arrays and string literals, and explicitly scope partial-linker normalizations (`isLinkedCompilation`) and NGP emit normalizations (`isNgpCompilation` / `isNgpTestMode()`) to their respective test runners. - Align `ngp` (`HybridCompiler`) DI and class metadata emission with `ngtsc` and consolidate remaining NGP cosmetic emit normalizations into `normalizeNgpEmitForComparison`.
JeanMeche
force-pushed
the
test/full-compliance-goldens
branch
from
October 18, 2026 06:21
1caccba to
cc74bab
Compare
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.
Summary
Migrates the
ngtsccompliance test suite from snippet-based golden files to full-file golden files and removes the duplicatenormalizeJsForComparisonhelpers frompackages/compiler-cli/preprocessor/test/compliance_spec.ts.Changes
__AttributeMarker,__SelectorFlags,__QueryFlags,__i18nMsg__) and$...$identifier placeholders in compliance golden files to full-filengtscoutput, using…only where partial-linker output legitimately diverges (r3_view_compiler_deferred/deferred_with_duplicate_external_dep_template.jsandr3_view_compiler_i18n/line_ending_normalization/*_template_non_legacy_*.js). Keptsource_mapping/golden files (// SOURCE:comments) intact.TEST_CASES.json(preserving allextraChecks) into single full-file expectations per generated.jsfile and removed the 78 redundant snippet files. Un-shared the 3 shared snippet files inr3_view_compiler_i18n/line_ending_normalization/TEST_CASES.jsonso each test case has its own full-file golden.expectEmitAssertions:expectEmitto anchor full-file goldens at both the start and end of the generated file (unlessallowPartialis set forsource_mappingsnippets or…is used), sub-chunk large token arrays and string literals so full-file goldens stay within V8'sRegExpsize limit, and ignore//inside string/template literals instripLineComments.ɵsetClassDebugInfo/ɵɵsetNgModuleScopeelision, empty class-element semicolon elision, and linkedMSG_...constant names) behindoptions.isLinkedCompilationsofull compileandlocal compile(ngtsc) assert the full unstripped output.isNgpTestMode() || options?.isNgpCompilation.normalizeNgpEmitForComparison(packages/compiler-cli/src/ngtsc/testing/src/ngp_emit_normalizer.ts) using AST-scopedɵsetClassMetadatanormalization and dynamic@angular/coreimport inspection, and removed the duplicatenormalizeJsForComparisonhelpers frompackages/compiler-cli/preprocessor/test/compliance_spec.ts.