Add _match_api_key() class method to fusion.billing.service, with a TDD test suite (TestServiceApiKey) covering key generation, hash storage, positive match, and rejection of bad/inactive keys. Also fix fcb_test_on_trial.sh to use --http-port 8070, as Odoo 19 forces http_spawn() even under --no-http when --test-enable is set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
1.8 KiB
Bash
28 lines
1.8 KiB
Bash
#!/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 --http-port 8070 --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'
|