fix: smoke-init.sh — USER env var + docker mock + correct token names #139
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#139
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
tests/smoke-init.shfails in CI (python:3-alpine) due to three bugs. All previous attempts (PRs #126, #133, #134, #137) failed on these same issues.Bug 1: USER unbound variable
lib/env.shline 122 uses${USER}which is unset in Alpine. Add totests/smoke-init.shin step 3, BEFORE thedisinto initcall, after the git config lines:Do NOT write
export USER=$(whoami)— shellcheck SC2155 requires separate declaration and assignment.Bug 2: docker mock must be on PATH
disinto init --barecallsdocker exec -u git disinto-forgejo forgejo admin user listto check if the database is ready. In CI there is no real Docker. The test creates a mock docker script at/tmp/smoke-mock-bin/dockerthat intercepts these calls and routes them to the mock Forgejo API.The mock MUST:
docker ps(exit 0)docker exec ... forgejo admin user list(echo header, exit 0)docker exec ... forgejo admin user create(POST to mock API)docker exec ... forgejo admin user change-password(PATCH on mock API)export PATH="$MOCK_BIN:$PATH"before init runsStep 2 must print
PASS: Mock binaries installedto confirm setup worked.Bug 3: token variable names
The test verification must check for
FORGE_REVIEW_TOKEN(notFORGE_TOKEN_2). These names are written bydisinto initand must match exactly:FORGE_TOKENFORGE_REVIEW_TOKENFORGE_PLANNER_TOKENDo NOT rename these variables in the test.
Affected files
tests/smoke-init.shAcceptance criteria
USER=$(whoami); export USERbefore init call (two lines, not one)FORGE_REVIEW_TOKENnotFORGE_TOKEN_2PASS: Mock binaries installedappears in output