test: Streamline's consent checks run on Linux CI, and build() refuses Streamline without its licence under test #381
Labels
No labels
area/build
area/install
area/mods
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher#381
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
#344 adds Frame Generation through Streamline to the DLSS card, behind its own licence. A cold review of it found two gaps in its tests, kept out of that PR on purpose: on Linux CI, nothing would catch a change that records the licence, or takes Streamline, without the player's consent. Line numbers below are at #344's head
7e5b06a.A. The consent tests run on Windows only, and CI runs on Linux only
The Streamline half of
module_tests::inspecting_a_version_preserves_activation_and_targets_its_modules(src/game/actions.rs) sits inif cfg!(windows)blocks, because the code it drives reads the platform directly:show_license(cfg!(windows)at lines 458 and 489, throughstreamline_offered) and the accept handler. Streamline is offered only on Windows, so on Linux the dialog never opens and these checks are skipped..forgejo/workflows/ci.ymlruns onubuntu-24.04only.These mutations of the accept handler pass CI today. Only a
cargo teston Windows catches them:ensure!that turns Streamline on only for a builder known to place it (g.get_streamline_support() == 1, line 564);unusablecheck (line 642), which then shows Streamline's dialog after DLSS for a builder known not to place it.Proposal: pass the platform in rather than reading
cfg!(windows)inside: awindows: boolargument toshow_licenseand to the accept path (or a test-only override, asset_streamline_onalready takeswindowsinsrc/game/versions/modules.rs), so the same assertions run on Linux withwindows = true. The test'sif cfg!(windows)blocks then become unconditional for the Streamline part.B.
build()'s licence check for Streamline has no testsrc/game/wizard.rslines 500 to 503:No test reaches it: the
wizardtests buildOptionsby hand and don't go throughbuild(). Removing thisensure!fails no test. Without it, a build that takes Streamline would go on tostreamline_flag(line 833), which writes the licence receiptlicenses.streamlineinto the profile without the licence accepted in the launcher. The Build page normally keeps the choice and the licence together, so this check is the last guard rather than the only one.Proposal: move the computation of
Optionsand its licence checks out ofbuild()into a pure function (the window's choices, the release tag and the settings in;Result<Options>out), and test it: Streamline without its licence is refused, Streamline on a Stable tag or off Windows is dropped, and DLSS off drops Streamline.Not in scope
src/game/mod.rs), and Play'scan("streamline")call (src/game/versions.rs, line 449), are also untested. They are smaller and could go in the same change.Possibly related, for context: