Skip to content

test(cli_util): guard sdkPath in unit tests for hermetic environments - #2552

Merged
auto-submit[bot] merged 4 commits into
mainfrom
fix-cli-util-test
Aug 21, 2026
Merged

test(cli_util): guard sdkPath in unit tests for hermetic environments#2552
auto-submit[bot] merged 4 commits into
mainfrom
fix-cli-util-test

Conversation

@kevmoo

@kevmoo kevmoo commented Aug 21, 2026

Copy link
Copy Markdown
Member

In hermetic test runners (such as Blaze/Bazel or environments without
a standard Dart SDK layout on disk at Platform.resolvedExecutable),
sdkPath evaluates to null. Guard the live SDK assertions so tests pass
in hermetic sandboxes.

In hermetic test runners (such as Blaze/Bazel or environments without
a standard Dart SDK layout on disk at Platform.resolvedExecutable),
sdkPath evaluates to null. Guard the live SDK assertions so tests pass
in hermetic sandboxes.
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

Package publishing

If you have publishing permissions, you can use the links below to publish the changes after merging this PR.

Package Version Status Publish tag (post-merge)
package:api_summary 0.1.0-wip WIP (no publish necessary)
package:bazel_worker 1.1.5 already published at pub.dev
package:benchmark_harness 2.4.0 already published at pub.dev
package:boolean_selector 2.1.2 already published at pub.dev
package:browser_launcher 1.2.0-wip WIP (no publish necessary)
package:cli_config 0.2.1-wip WIP (no publish necessary)
package:cli_util 0.6.1-wip WIP (no publish necessary)
package:clock 1.1.3-wip WIP (no publish necessary)
package:code_builder 4.12.0-wip WIP (no publish necessary)
package:coverage 1.16.0-wip WIP (no publish necessary)
package:csslib 1.0.3-wip WIP (no publish necessary)
package:extension_discovery 2.1.0 already published at pub.dev
package:file 7.0.2-wip WIP (no publish necessary)
package:file_testing 3.1.0-wip WIP (no publish necessary)
package:glob 2.2.0-wip WIP (no publish necessary)
package:graphs 2.4.0-wip WIP (no publish necessary)
package:html 0.15.7-wip WIP (no publish necessary)
package:io 1.1.0-wip WIP (no publish necessary)
package:json_rpc_2 4.1.0 already published at pub.dev
package:markdown 7.4.1-wip WIP (no publish necessary)
package:mime 2.1.0-wip WIP (no publish necessary)
package:oauth2 2.0.5 already published at pub.dev
package:package_config 3.0.1-wip WIP (no publish necessary)
package:pool 1.5.3-wip WIP (no publish necessary)
package:process 5.0.5 (error) pubspec version (5.0.5) and changelog (5.0.6-wip) don't agree
package:pub_semver 2.2.1-wip WIP (no publish necessary)
package:pubspec_parse 1.6.0-wip WIP (no publish necessary)
package:source_map_stack_trace 2.1.3-wip WIP (no publish necessary)
package:source_maps 0.10.14 already published at pub.dev
package:source_span 1.10.2 already published at pub.dev
package:sse 4.2.1-wip WIP (no publish necessary)
package:stack_trace 1.12.2-wip (error) pubspec version (1.12.2-wip) and changelog (1.12.2-dev) don't agree
package:stream_channel 2.1.4 already published at pub.dev
package:stream_transform 2.1.2-wip WIP (no publish necessary)
package:string_scanner 1.4.2-wip WIP (no publish necessary)
package:term_glyph 1.2.3-wip WIP (no publish necessary)
package:test_reflective_loader 0.6.0 ready to publish test_reflective_loader-v0.6.0
package:timing 1.0.2 already published at pub.dev
package:unified_analytics 8.0.18-wip WIP (no publish necessary)
package:watcher 1.2.2-wip WIP (no publish necessary)
package:yaml 3.1.4-wip WIP (no publish necessary)
package:yaml_edit 2.2.5-wip WIP (no publish necessary)

Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the tests in cli_util_test.dart to conditionally execute assertions only when sdkPath is not null, replacing the previous non-null assertions. However, this change causes the tests to pass silently if sdkPath is null, potentially masking configuration issues. It is recommended to explicitly skip the tests using markTestSkipped instead of wrapping the test bodies in conditional blocks.

Comment thread pkgs/cli_util/test/cli_util_test.dart Outdated
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

PR Health

Unused Dependencies ✔️
Package Status
cli_util ✔️ All dependencies utilized correctly.

For details on how to fix these, see dependency_validator.

This check can be disabled by tagging the PR with skip-unused-dependencies-check.

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
cli_util None 0.6.0 0.6.1-wip 0.6.1-wip ✔️

This check can be disabled by tagging the PR with skip-breaking-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

License Headers ✔️
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/html/test/dom_parsing_test.dart
pkgs/html/test/mxss_test.dart
pkgs/html/test/noah_ark_clause_limit_test.dart

This check can be disabled by tagging the PR with skip-license-check.

Coverage ✔️
File Coverage

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

@kevmoo
kevmoo requested review from natebosch and srawlins August 21, 2026 22:00
@kevmoo

kevmoo commented Aug 21, 2026

Copy link
Copy Markdown
Member Author

Needed so https://dart-review.googlesource.com/c/sdk/+/540220 doesn't blow up when we roll into google3

@natebosch natebosch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think needs a -wip version bump since it was already published?

@auto-submit
auto-submit Bot merged commit 112b8f9 into main Aug 21, 2026
33 checks passed
@auto-submit
auto-submit Bot deleted the fix-cli-util-test branch August 21, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants