mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-09-26 07:16:13 +00:00
Correct test of init
This commit is contained in:
@@ -546,29 +546,21 @@ jobs:
|
||||
pip install 'pyOpenSSL>=23.2.0'
|
||||
|
||||
echo "=== Running version 0.49.1 to create datastore ==="
|
||||
timeout 20 python3 ./changedetection.py -C -d /tmp/data || {
|
||||
echo "Failed to start old version"
|
||||
exit 1
|
||||
}
|
||||
TESTING_SHUTDOWN_AFTER_DATASTORE_LOAD=1 python3 ./changedetection.py -C -d /tmp/data
|
||||
echo "✓ Version 0.49.1 datastore created successfully"
|
||||
|
||||
# Upgrade to current version
|
||||
git checkout ${{ github.ref_name }}
|
||||
pip install -r requirements.txt
|
||||
|
||||
echo "=== Running current version ${{ github.ref_name }} with old datastore ==="
|
||||
timeout 20 python3 ./changedetection.py -d /tmp/data > /tmp/upgrade-test.log 2>&1 || {
|
||||
echo "Failed to start current version"
|
||||
cat /tmp/upgrade-test.log
|
||||
exit 1
|
||||
}
|
||||
TESTING_SHUTDOWN_AFTER_DATASTORE_LOAD=1 python3 ./changedetection.py -d /tmp/data > /tmp/upgrade-test.log 2>&1
|
||||
|
||||
# Verify success
|
||||
echo "=== Verifying upgrade succeeded ==="
|
||||
grep -q "Loading existing datastore" /tmp/upgrade-test.log || {
|
||||
echo "ERROR: Datastore not loaded"
|
||||
cat /tmp/upgrade-test.log
|
||||
exit 1
|
||||
}
|
||||
echo "=== Upgrade test output ==="
|
||||
cat /tmp/upgrade-test.log
|
||||
|
||||
echo ""
|
||||
echo "✓ Upgrade test passed: 0.49.1 → ${{ github.ref_name }}"
|
||||
|
||||
echo "✓ Upgrade test passed: 0.49.1 → ${{ github.ref_name }}"
|
||||
|
||||
|
||||
@@ -371,7 +371,15 @@ def main():
|
||||
# Dont' start if the JSON DB looks corrupt
|
||||
logger.critical(f"ERROR: JSON DB or Proxy List JSON at '{app_config['datastore_path']}' appears to be corrupt, aborting.")
|
||||
logger.critical(str(e))
|
||||
return
|
||||
sys.exit(1)
|
||||
|
||||
# Testing mode: Exit cleanly after datastore initialization (for CI/CD upgrade tests)
|
||||
if os.environ.get('TESTING_SHUTDOWN_AFTER_DATASTORE_LOAD'):
|
||||
logger.success(f"TESTING MODE: Datastore loaded successfully from {app_config['datastore_path']}")
|
||||
logger.success(f"TESTING MODE: Schema version: {datastore.data['settings']['application'].get('schema_version', 'unknown')}")
|
||||
logger.success(f"TESTING MODE: Loaded {len(datastore.data['watching'])} watches")
|
||||
logger.success("TESTING MODE: Exiting cleanly (TESTING_SHUTDOWN_AFTER_DATASTORE_LOAD is set)")
|
||||
sys.exit(0)
|
||||
|
||||
# Apply all_paused setting if specified via CLI
|
||||
if all_paused is not None:
|
||||
|
||||
Reference in New Issue
Block a user