Repository navigation
[pkgdef 6/6] test(pkgs): install and switch versions of every shipped package - #3036
mikeland73 wants to merge 9 commits into
Conversation
Add a testscript next to every package definition in pkgs/. Each one installs a version from devbox.json, switches to another with `devbox add`, and switches back by editing devbox.json, checking the version (and the definition's env, such as JAVA_HOME or the python virtual environment) at every step. TestPackageDefinitions runs them with $PKGS pointing at pkgs/ when DEVBOX_RUN_PKGDEF_TESTS=1, because they download real toolchains. TestShippedDefinitionsParse checks that every definition is valid and named after its directory; it always runs. TestShippedDefinitionsResolve resolves and locks the latest version of each against its vendor, behind the same flag. A pkgdef-tests workflow runs both on Linux and macOS when the definitions or their implementation change, and weekly to catch vendor changes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
[Low impact] The PR appears safe to merge; no new actionable issues were found.
|
…ef-package-tests # Conflicts: # testscripts/testscripts_test.go
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
The path filter only listed the pkgdef files, so changes to install, lockfile, config and env wiring did not run the per-package tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Bqy92oAnwydcLrbSE7nkVH
|
@greptileai review Generated by Claude Code |
|
@greptileai review Generated by Claude Code |
…def workflow on testscripts changes Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Bqy92nhWNLdQX7fKSN3j72
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
@greptileai review Generated by Claude Code |
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
|
@greptileai review Generated by Claude Code |
Stack (merge in order):
internal/pkgdeflibraryDEVBOX_FEATURE_PKG_DEFS)Summary
Sixth PR of the package definitions stack. Tests every package from #3034 against its real vendor. The focus is that install works and version switching works.
pkgs/<name>/<name>.test.txt: one testscript per package, next to its definition. Each script:devbox.json;devbox add(which replaces A indevbox.jsonanddevbox.lock);devbox.json.It checks the version at every step (
node --version,java -version, ...), plus the definition's env where it matters:JAVA_HOME,RUSTUP_TOOLCHAIN,NPM_CONFIG_PREFIX,GOTOOLCHAIN, and pip running from the recreated.venv.The versions were picked to cover the interesting paths:
TestPackageDefinitions(testscripts/) runs those scripts with$PKGSpointing atpkgs/. They download several GB, so they only run withDEVBOX_RUN_PKGDEF_TESTS=1.GITHUB_TOKENis passed through for the GitHub API.TestPackageDefinitionScriptsExist(always runs) fails when a definition inpkgs/has no<name>.test.txtnext to it, so a new package can't ship untested.TestPackageDefinitionsruns the same check first.TestShippedDefinitionsParse(always runs) checks that every definition is valid, is named after its directory, and lists every platform, homepage, license and binaries.TestShippedDefinitionsResolve(same flag) resolves and lockslatestof every package against its vendor and requires vendor checksums.pkgdef-testsworkflow: both tests onubuntu-latestandmacos-latest, whenpkgs/, the implementation ortestscripts/changes, and weekly to catch vendor changes. The path filter now includes the wiring packages too (internal/devbox,devpkg,devconfig,lock,plugin,nix); it used to list only the pkgdef files.Test plan
DEVBOX_RUN_PKGDEF_TESTS=1 go test ./testscripts -run TestPackageDefinitions: all 16 pass on macOS arm64 (about 2 min, parallel)jetpackio/devboxwith a linux build of this branchTestShippedDefinitionsResolvepasses for every package that doesn't use the GitHub API (that API was blocked in this environment).TestShippedDefinitionsResolve: all 16 resolvelatest. Every platform is locked with a vendor checksum, except Temurin 27, which has no Intel macOS build.TestPackageDefinitionScriptsExistpasses, and fails whenpkgs/zig/zig.test.txtis removedpkgdef-testsworkflow on this PR (first run on x86_64 Linux)https://claude.ai/code/session_01Bqy92oAnwydcLrbSE7nkVH
Generated by Claude Code