Skip to content

test(e2e): support Rust cfg filters - #651

Merged
wan9chi merged 1 commit into
mainfrom
test/e2e-cfg-filters
Aug 12, 2026
Merged

test(e2e): support Rust cfg filters#651
wan9chi merged 1 commit into
mainfrom
test/e2e-cfg-filters

Conversation

@wan9chi

@wan9chi wan9chi commented Aug 12, 2026

Copy link
Copy Markdown
Member

Motivation

E2E snapshots used a small hard-coded platform vocabulary, which could not express Rust target conditions such as operating systems, target environments, or boolean combinations. This made cross-platform fixture selection increasingly brittle.

Summary

  • Replace the snapshot platform field with an optional cargo_platform::CfgExpr parsed from cfg.
  • Match expressions against target_os, target_env, and the free unix/windows target-family cfg without spawning rustc.
  • Source the target family from std::env::consts::FAMILY and construct the target cfg values directly from compile-time information.
  • Migrate the existing platform-specific snapshot filters to Rust cfg expressions.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​cargo-platform@​0.3.210010093100100

View full report

@github-actions

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.20%  [ -7.21% ..  +6.97%]  overhead   +52.97%
dynamic/access             change  +0.63%  [-18.99% .. +27.19%]  overhead    +6.37%
dynamic/access-relative    change  +0.58%  [ -9.52% .. +19.69%]  overhead   +48.11%
static/launch              change  +1.63%  [ -6.55% .. +14.10%]  overhead  +147.40%
static/access              change  +0.26%  [-10.95% ..  +8.97%]  overhead  +820.56%
static/access-relative     change  -0.44%  [ -4.39% ..  +3.82%]  overhead +1199.34%

macos

dynamic/launch             change  -0.58%  [ -5.59% ..  +3.39%]  overhead  +220.37%
dynamic/access             change  -0.71%  [ -7.22% ..  +7.04%]  overhead    +5.69%
dynamic/access-relative    change  -0.00%  [ -7.03% ..  +6.51%]  overhead  +238.33%

windows

dynamic/launch             change  -0.16%  [ -9.11% ..  +5.55%]  overhead   +25.07%
dynamic/access             change  -0.37%  [ -0.94% ..  +0.74%]  overhead    +1.88%
dynamic/access-relative    change  -0.18%  [ -1.27% ..  +0.72%]  overhead    +1.47%

@wan9chi
wan9chi marked this pull request as ready for review August 12, 2026 09:01
@wan9chi
wan9chi merged commit e123f98 into main Aug 12, 2026
19 checks passed
@wan9chi
wan9chi deleted the test/e2e-cfg-filters branch August 12, 2026 09:01
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