Skip to content

[pkgdef 6/6] test(pkgs): install and switch versions of every shipped package - #3036

Open
mikeland73 wants to merge 9 commits into
mikeland73/pkgdef-package-supportfrom
mikeland73/pkgdef-package-tests
Open

mikeland73 wants to merge 9 commits into
mikeland73/pkgdef-package-supportfrom
mikeland73/pkgdef-package-tests

Conversation

@mikeland73

@mikeland73 mikeland73 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Stack (merge in order):

  1. [pkgdef 1/6] docs(specs): add package definition spec and Go example #3000 — spec + Go example
  2. [pkgdef 2/6] feat(pkgdef): add package definition library #3001 — internal/pkgdef library
  3. [pkgdef 3/6] feat(pkgdef): wire package definitions into add, lock, install and env #3002 — wiring into add/lock/install/env (behind DEVBOX_FEATURE_PKG_DEFS)
  4. [pkgdef 4/6] feat(pkgs): add the initial set of package definitions #3034 — initial package set (15 definitions)
  5. [pkgdef 5/6] feat(pkgdef): support the initial package set #3035 — format features for the initial package set
  6. [pkgdef 6/6] test(pkgs): install and switch versions of every shipped package #3036 — per-package install/switch tests + CI 👈 this PR

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:

    1. installs version A from devbox.json;
    2. switches to version B with devbox add (which replaces A in devbox.json and devbox.lock);
    3. switches back by editing 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:

    • 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)
    • gradle and maven running on the java definition
  • TestPackageDefinitions (testscripts/) runs those scripts with $PKGS pointing at pkgs/. They download several GB, so they only run with DEVBOX_RUN_PKGDEF_TESTS=1. GITHUB_TOKEN is passed through for the GitHub API.

  • TestPackageDefinitionScriptsExist (always runs) fails when a definition in pkgs/ has no <name>.test.txt next to it, so a new package can't ship untested. TestPackageDefinitions runs 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 locks latest of every package against its vendor and requires vendor checksums.

  • pkgdef-tests workflow: both tests on ubuntu-latest and macos-latest, when pkgs/, the implementation or testscripts/ 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)
  • The same install, switch and check sequence for all 16 on Linux arm64, in jetpackio/devbox with a linux build of this branch
  • After the audit fixes, on x86_64 Linux: go, nodejs, python, java, zig, terraform, yarn, gradle and maven install and switch versions. TestShippedDefinitionsResolve passes for every package that doesn't use the GitHub API (that API was blocked in this environment).
  • TestShippedDefinitionsResolve: all 16 resolve latest. Every platform is locked with a vendor checksum, except Temurin 27, which has no Intel macOS build.
  • TestPackageDefinitionScriptsExist passes, and fails when pkgs/zig/zig.test.txt is removed
  • pkgdef-tests workflow on this PR (first run on x86_64 Linux)

https://claude.ai/code/session_01Bqy92oAnwydcLrbSE7nkVH


Generated by Claude Code

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]>
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds install and version-switch tests for all 16 shipped packages.

  • Package tests now install and switch versions for every shipped definition.
  • The test suite runs package scripts and requires a matching script for every definition.
  • Tests now check shipped definitions and resolve their latest vendor versions.
  • CI runs package checks on Ubuntu and macOS for changes and on a weekly schedule.

The previous and current commits have different merge bases with the target, so this review covered the full PR.

Reviews (5) · Last reviewed commit: "Merge branch 'mikeland73/pkgdef-package-..." · Reviewed by Greptile

Comment thread testscripts/testrunner/pkgdefs.go Resolved
…ef-package-tests

# Conflicts:
#	testscripts/testscripts_test.go
@mikeland73 mikeland73 changed the title test(pkgs): install and switch versions of every shipped package [pkgdef 6/6] test(pkgs): install and switch versions of every shipped package Nov 23, 2026
@claude

claude Bot commented Nov 23, 2026

Copy link
Copy Markdown

Code review

No 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

Copy link
Copy Markdown
Collaborator Author

@greptileai review


Generated by Claude Code

greptile-apps[bot]
greptile-apps Bot previously approved these changes Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review


Generated by Claude Code

Comment thread .github/workflows/pkgdef-tests.yaml Resolved
@mikeland73
mikeland73 added this pull request to stack #3003 November 23, 2026 21:41
@greptile-apps
greptile-apps Bot dismissed their stale review November 23, 2026 21:45

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

Copy link
Copy Markdown
Collaborator Author

@greptileai review


Generated by Claude Code

greptile-apps[bot]
greptile-apps Bot previously approved these changes Nov 23, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review November 23, 2026 21:59

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

Copy link
Copy Markdown
Collaborator Author

@greptileai review


Generated by Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants