Repository navigation
test(pkgs): install and switch versions of every shipped package - #3036
Open
mikeland73 wants to merge 1 commit into
Open
mikeland73 wants to merge 1 commit into
mikeland73 wants to merge 1 commit 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) <noreply@anthropic.com>
This was referenced Oct 30, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. Versions were picked to cover the interesting paths: pnpm 9 → 12 (npm then GitHub layout), yarn 1 → 4 (two npm packages), deno 1.46 (trust on first use), zig 0.13 → 0.14 (tarball rename), kubectl 1.30 (beyond the first page of GitHub releases), and gradle and maven running on the java definition.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.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/or the implementation changes, and weekly to catch vendor changes.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 branchTestShippedDefinitionsResolve: all 16 resolvelatest. Every platform is locked with a vendor checksum, except Temurin 27, which has no Intel macOS buildpkgdef-testsworkflow on this PR (first run on x86_64 Linux)🤖 Generated with Claude Code