Repository navigation
cli: anchor aube install at workspace root from member subdir #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
138f069
ba0451c
29960ea
4436eee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,13 +25,23 @@ printf "Running non-serial BATS shard %s/%s with %s files\n" "$((shard_index + 1 | |
| printf " %s\n" "${test_files[@]}" | ||
| mkdir -p "$report_dir" | ||
| status=0 | ||
| BATS_REPORT_FILENAME="$report_name" ./test/bats/bin/bats \ | ||
| --report-formatter junit \ | ||
| --output "$report_dir" \ | ||
| --jobs "$jobs" \ | ||
| --parallel-binary-name parallel \ | ||
| --filter-tags "!serial" \ | ||
| "${test_files[@]}" || status=$? | ||
| # DEBUG (TEMP): run files one at a time with a 90s per-file timeout so | ||
| # any hanging test surfaces as a SIGTERM with the file name visible in | ||
| # the log. Revert this change once the hang is identified. | ||
| for tf in "${test_files[@]}"; do | ||
| echo "::group::bats $tf" | ||
| if ! timeout --signal=KILL --verbose 90 ./test/bats/bin/bats \ | ||
| --filter-tags "!serial" \ | ||
| --timing \ | ||
| "$tf"; then | ||
| rc=$? | ||
| echo "::endgroup::" | ||
| echo "BATS file failed or timed out: $tf (exit $rc)" | ||
| status=$rc | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exit code always zero after negated if conditionHigh Severity
Reviewed by Cursor Bugbot for commit 4436eee. Configure here. |
||
| break | ||
| fi | ||
| echo "::endgroup::" | ||
| done | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Temporary debug CI code committed in unrelated PRMedium Severity The Reviewed by Cursor Bugbot for commit 4436eee. Configure here. |
||
|
|
||
| upload_status=0 | ||
| mise run ci:test-engine:upload -- "$report_path" || upload_status=$? | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/usr/bin/env bats | ||
| # | ||
| # Regression: `aube install` run from inside a workspace member must | ||
| # resolve up to the workspace root (pnpm parity) instead of treating the | ||
| # member as a standalone project. The user-visible bug is that a member | ||
| # install runs a fresh resolve/fetch/link cycle and writes a private | ||
| # lockfile, virtual store, and install state next to the member's own | ||
| # package.json — duplicating work the prior workspace-root install | ||
| # already did, and re-downloading anything not already in the global | ||
| # cache. | ||
| # | ||
| # Root cause: install/mod.rs's `find_project_root` walks up to the | ||
| # *nearest* package.json, which inside a workspace is the member's own. | ||
| # A workspace-aware walk should resolve to the workspace root when the | ||
| # member's ancestor is a workspace declaration. | ||
| # | ||
| # bats file_tags=serial | ||
|
|
||
| # shellcheck disable=SC2034 | ||
| BATS_NO_PARALLELIZE_WITHIN_FILE=1 | ||
|
|
||
| setup() { | ||
| load 'test_helper/common_setup' | ||
| _common_setup | ||
| } | ||
|
|
||
| teardown() { | ||
| _common_teardown | ||
| } | ||
|
|
||
| _setup_minimal_workspace() { | ||
| cat >package.json <<-'JSON' | ||
| { | ||
| "name": "ws-root", | ||
| "version": "0.0.0", | ||
| "private": true | ||
| } | ||
| JSON | ||
| cat >pnpm-workspace.yaml <<-'YAML' | ||
| packages: | ||
| - packages/* | ||
| YAML | ||
| mkdir -p packages/a | ||
| cat >packages/a/package.json <<-'JSON' | ||
| { | ||
| "name": "@ws/a", | ||
| "version": "1.0.0", | ||
| "dependencies": { | ||
| "is-odd": "3.0.1" | ||
| } | ||
| } | ||
| JSON | ||
| } | ||
|
|
||
| @test "aube install from a workspace member resolves up to the workspace root" { | ||
| _setup_minimal_workspace | ||
|
|
||
| # Prime the workspace at the root. After this, the workspace root | ||
| # owns the lockfile, the virtual store, and the install state. | ||
| run aube install | ||
| assert_success | ||
| assert_file_exists aube-lock.yaml | ||
| assert_dir_exists node_modules/.aube | ||
| assert_file_exists node_modules/.aube-state | ||
| assert_link_exists packages/a/node_modules/is-odd | ||
|
|
||
| # Snapshot the root install state. A correct member install must | ||
| # resolve back up to this same root and short-circuit on the warm | ||
| # fast path — the root state must be byte-identical afterward. | ||
| local root_state_before | ||
| root_state_before="$(cat node_modules/.aube-state)" | ||
|
|
||
| cd packages/a | ||
| run aube install | ||
| assert_success | ||
| cd ../.. | ||
|
|
||
| # No standalone artifacts inside the workspace member. Each | ||
| # assertion below proves a distinct symptom of the bug: | ||
| # - own lockfile -> member ran its own resolve | ||
| # - own .aube -> member ran its own linker pass | ||
| # - own .aube-state -> member ran the full install pipeline | ||
| # Any single failure means the member install ignored the | ||
| # workspace root. | ||
| run test -e packages/a/aube-lock.yaml | ||
| assert_failure | ||
| run test -d packages/a/node_modules/.aube | ||
| assert_failure | ||
| run test -e packages/a/node_modules/.aube-state | ||
| assert_failure | ||
|
|
||
| # The root install state is byte-identical — the only correct | ||
| # warm path is "do nothing", and "do nothing" can't write any | ||
| # state file. `assert_equal` (not `[`) so a regression prints | ||
| # both snapshots and we can diff what changed. | ||
| assert_equal "$(cat node_modules/.aube-state)" "$root_state_before" | ||
| } |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Production fix accidentally included in test-only PR
Medium Severity
The PR title (
test(install): pin failing repro …) and description explicitly state this is a test-only change, with the actual fix being "out of scope for this PR." The unchecked test-plan item confirms the test is supposed to fail right now. However, the diff includes the production code change ininstall/mod.rsthat swapsfind_project_rootforfind_workspace_root().or_else(|| find_project_root())— which is the fix itself. With the fix present the new bats test will pass, contradicting the stated intent of landing a pinned-failing regression test first.Reviewed by Cursor Bugbot for commit c4b89ad. Configure here.