chore: mark unsupported code paths with coverage:ignore#327
Open
AquibAquil wants to merge 3 commits into
Open
Conversation
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.
Addresses part of #263.
What
Adds
// coverage:ignore-*markers to code paths documented in-source as intentionally unsupported or unreachable:Whole-file ignores —
lib/src/impl_stub/(14 files)Marked with
// coverage:ignore-file. This directory is loaded only via conditional import when neitherdart.library.ffinordart.library.js_interopis available (seelib/src/webcrypto/webcrypto.dart:27). No real Dart runtime satisfies that condition, so everythrow UnimplementedError('Not implemented')in the directory is unreachable at runtime by design.Block ignores — 4 files in
impl_ffi/,impl_js/, andboringssl/Wrapped with
// coverage:ignore-start/// coverage:ignore-end:throw UnsupportedError('192-bit AES keys are not supported')sites inlib/src/impl_ffi/impl_ffi.aes_common.dart(documented in-source as intentionally unsupported, see https://crbug.com/533699).lib/src/boringssl/lookup/utils.dart(fires only on operating systems outside {Windows, Linux, macOS}).lib/src/impl_ffi/impl_ffi.ec_common.dart(×3),lib/src/impl_ffi/impl_ffi.ecdsa.dart, andlib/src/impl_js/impl_js.utils.dart— dead-code fallbacks after exhaustive enum switches.Why
Per #263, these are candidates where "we don't want coverage" — code paths intentionally chosen not to test rather than defensively cover.
Skipped intentionally
requireSubtleCrypto(lib/src/crypto_subtle.dart:82) — the example cited in the issue. Now has tests attest/crypto_subtle_test.dart:128and:141, so ignore markers would silence real coverage. Left alone.throw UnimplementedError('Only supports 65537 and 3 for now')(lib/src/crypto_subtle.dart:44) — genuine TODO for future work, not an intentional gap. Left visible.Verification
dart format --output none --set-exit-if-changed .passes.dart analyze --fatal-warnings .passes.requireSubtleCrypto, which is why it's excluded).CMake Error at CMakeLists.txt:19 (project): Generator Ninja does not support platform specification, but platform x64 was specified.Working around it locally was out of scope for this change; relying on CI to validate.