Files
pulse/docs/update-testing.md
T
courtmanr@gmail.com b58baa9d14 fix: resolve update mechanism issues and add test mode
- Fix download URL property mismatch (downloadUrl vs browser_download_url)
- Add comprehensive error logging for update failures
- Create test mode for update mechanism (UPDATE_TEST_MODE=true)
- Add test script for easy update testing without releases
- Improve restart logic for different deployment environments
- Add tar package dependency for creating update packages
- Update .gitignore to exclude backup and temp directories
- Add documentation for update testing workflow

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-31 23:38:08 +01:00

58 lines
1.7 KiB
Markdown

# Update Mechanism Testing
This document describes how to test the Pulse update mechanism without creating real GitHub releases.
## Test Mode
The update system includes a test mode that simulates available updates without requiring actual releases.
### How to Use
1. **Start the server in test mode:**
```bash
./scripts/test-update.sh
```
Or with a custom version:
```bash
./scripts/test-update.sh 5.0.0
```
2. **Open Pulse in your browser** and go to Settings
3. **Click "Check for Updates"** - you should see version 99.99.99 (or your custom version) available
4. **Click "Apply Update"** to test the update process
### What Happens in Test Mode
- The update check returns a mock release with version 99.99.99 (or custom)
- A mock tarball is created on-the-fly from current application files
- The update process runs normally but with the test package
- You can test the entire flow: download, backup, extraction, restart
### Environment Variables
- `UPDATE_TEST_MODE=true` - Enables test mode
- `UPDATE_TEST_VERSION=X.X.X` - Sets the mock version number (default: 99.99.99)
### Manual Testing
You can also manually set the environment variables:
```bash
UPDATE_TEST_MODE=true UPDATE_TEST_VERSION=10.0.0 npm run dev:server
```
### Debugging
When in test mode, check the console for:
- `[UpdateManager] Test mode enabled, returning mock update info` - Confirms test mode is active
- Asset names and download URLs in browser console if update fails
- Server logs for the update process steps
### Notes
- The mock tarball excludes node_modules, .git, temp, and backup directories
- The test download URL is: `http://localhost:3000/api/test/mock-update.tar.gz`
- This endpoint only works when `UPDATE_TEST_MODE=true`