Files
setup-uv/__tests__/helpers/setup-inputs.ts
Kevin Stillhammer 17c398959b Fix cache keys for Python version ranges (#937)
## Summary
- URL-encode the Python version component before adding it to the cache
key
- URL-encode the user-provided cache suffix for the same reason
- Add cache key tests for Python ranges, comma-containing suffixes, and
unchanged simple inputs

Fixes #914

Refs: pi-session 019f3164-85e7-7817-bffd-501d89b3a1fd

## Tests
- npm run all
2026-07-05 10:46:44 +02:00

37 lines
926 B
TypeScript

import { CacheLocalSource, type SetupInputs } from "../../src/utils/inputs";
export function createSetupInputs(
overrides: Partial<SetupInputs> = {},
): SetupInputs {
return {
activateEnvironment: false,
addProblemMatchers: false,
cacheDependencyGlob: "uv.lock",
cacheLocalPath: {
path: "/tmp/setup-uv-cache",
source: CacheLocalSource.Input,
},
cachePython: false,
cacheSuffix: "",
checksum: "",
downloadFromAstralMirror: false,
enableCache: true,
githubToken: "",
ignoreEmptyWorkdir: false,
ignoreNothingToCache: false,
noProject: false,
pruneCache: true,
pythonDir: "/tmp/uv-python-dir",
pythonVersion: "",
quiet: false,
resolutionStrategy: "highest",
restoreCache: false,
saveCache: true,
venvPath: "/workspace/.venv",
version: "",
versionFile: "",
workingDirectory: "/workspace",
...overrides,
};
}