test(billing): odoo-trial Enterprise test runner + plan test-env fix
Local dev Odoo is Community (can't install the module). Add a guest-exec runner that syncs the module to the odoo-trial Enterprise sandbox (VM 316, db trial) and runs --test-enable there; pass = FCB_EXIT=0. Scaffold verified installing on Odoo 19.0 Enterprise (7 fusion_billing_* tables created). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
scripts/fcb_test_on_trial.sh
Normal file
27
scripts/fcb_test_on_trial.sh
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
# Sync fusion_centralize_billing to the odoo-trial Enterprise sandbox (Proxmox VM 316)
|
||||
# and run its test suite there. The local dev Odoo (odoo-modsdev) is Community and
|
||||
# CANNOT install this module (needs sale_subscription + account_accountant), so tests
|
||||
# run on odoo-trial (Odoo 19.0 Enterprise, db=trial), reached via Proxmox guest-exec
|
||||
# (VM 316 has no direct SSH; only `qm guest exec` through the pve-worker1 host).
|
||||
#
|
||||
# Usage: bash scripts/fcb_test_on_trial.sh
|
||||
# Pass condition: the output ends with `FCB_EXIT=0` (Odoo exits non-zero on test failure).
|
||||
set -uo pipefail
|
||||
|
||||
MODULE=fusion_centralize_billing
|
||||
REPO_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
PVE=pve-worker1 # Proxmox host that runs VM 316 (ssh config alias)
|
||||
VMID=316
|
||||
|
||||
echo ">> packing ${MODULE}"
|
||||
B64=$(tar czf - --exclude='__pycache__' --exclude='*.pyc' -C "${REPO_DIR}" "${MODULE}" | base64 -w0)
|
||||
echo " payload: ${#B64} b64 bytes"
|
||||
|
||||
echo ">> syncing to odoo-trial:/opt/odoo/custom-addons (guest-exec)"
|
||||
ssh -o ConnectTimeout=40 "${PVE}" "qm guest exec ${VMID} --timeout 90 -- bash -lc 'rm -rf /opt/odoo/custom-addons/${MODULE}; echo ${B64} | base64 -d | tar xzf - -C /opt/odoo/custom-addons/ && echo SYNCED'" \
|
||||
2>&1 | sed -n 's/.*"out-data" : "\(.*\)",/\1/p' | sed 's/\\n/\n/g'
|
||||
|
||||
echo ">> upgrade + test on Enterprise 19 (db=trial, --no-http)"
|
||||
ssh -o ConnectTimeout=40 "${PVE}" "qm guest exec ${VMID} --timeout 600 -- bash -lc 'docker exec odoo-trial-app odoo -d trial -u ${MODULE} --no-http --workers 0 --test-enable --test-tags /${MODULE} --stop-after-init >/tmp/fcb_test.log 2>&1; echo FCB_EXIT=\$?; grep -iE \"FAIL|ERROR|tested in|Ran |assert\" /tmp/fcb_test.log | grep -viE \"fusion_plating|fusion_tasks|not installable|not loaded\" | tail -30'" \
|
||||
2>&1 | sed -n 's/.*"out-data" : "\(.*\)",/\1/p' | sed 's/\\n/\n/g'
|
||||
Reference in New Issue
Block a user