This document explains how to use the scripts/test_local_workflow.sh script to validate changes before pushing to GitHub.
The scripts/test_local_workflow.sh script simulates the complete end-user workflow using your local code changes, allowing you to:
- Test changes without pushing to GitHub
- Validate that the workflow works end-to-end
- Ensure RuboCop linting passes
- Verify all tests pass
- Generate actual download links files for inspection
- Ruby installed (the version specified in
.ruby-version) - Logic Pro or Logic Pro X installed (for full workflow testing)
- RuboCop installed:
gem install rubocop - Bundler installed:
gem install bundler - Dependencies installed:
bundle install
Simply run the script from the repository root:
./scripts/test_local_workflow.sh-
Cleanup: Removes any previous test runs
- Deletes
~/Desktop/lpx_links_test/ - Deletes
~/Desktop/lpx_download_links/ - Removes temporary files
- Deletes
-
Setup: Creates a fresh test environment
- Creates test directories on Desktop
- Copies local code (not from GitHub)
- Makes scripts executable
- Shows current branch and last commit
-
Prerequisites Check: Verifies system requirements
- Checks Ruby installation
- Checks for Logic Pro / Logic Pro X
- Checks for MainStage
-
RuboCop Lint Check: Runs linting
- Executes
rubocopon the codebase - Fails if any offenses are found
- Executes
-
Test Suite: Runs Minitest tests
- Executes
bundle exec rake test - Fails if any tests fail
- Executes
-
Workflow Test: Simulates user workflow
- Runs
lpx_links.rb -n Logic - Generates download links files
- Verifies all expected files are created
- Runs
-
Results: Displays summary
- Shows generated files
- Displays sample links
- Provides next steps
The script provides color-coded output:
- 🔵 Blue: Step information
- ✅ Green: Success messages
⚠️ Yellow: Warnings (non-fatal)- ❌ Red: Errors (fatal)
After a successful run, you'll find:
-
Test Directory:
~/Desktop/lpx_links_test/- Contains a copy of your local code
- Isolated from your working directory
-
Generated Links:
~/Desktop/lpx_download_links/all_download_links.txt- All available packagesmandatory_download_links.txt- Essential packages onlyjson/logicpro_content.json- Full package metadata
./scripts/test_local_workflow.sh- Make your code changes
- Run the script again:
./scripts/test_local_workflow.sh
- The script automatically cleans up and re-tests
# Switch to the branch you want to test
git checkout feature/my-branch
# Run the test script
./scripts/test_local_workflow.shIf you don't have Logic Pro installed, the workflow test will fail. This is expected. The script will still:
- Run RuboCop checks
- Run the test suite
- Validate code quality
If RuboCop fails:
- Review the offenses listed
- Fix the issues in your code
- Run the script again
If tests fail:
- Review the failing test output
- Fix the code or tests
- Run the script again
If you get a "Permission denied" error:
chmod +x scripts/test_local_workflow.sh- Make changes to your code
- Run the test script:
./scripts/test_local_workflow.sh
- Review generated files in
~/Desktop/lpx_download_links/ - If tests pass, commit your changes:
git add . git commit -m "Your commit message"
- Push to GitHub:
git push origin your-branch-name
Always run this script before creating or updating a pull request:
# Ensure you're on the right branch
git checkout fix/rubocop-linting
# Run the test script
./scripts/test_local_workflow.sh
# If all tests pass, push
git push origin fix/rubocop-linting- ✅ RuboCop linting (0 offenses)
- ✅ All Minitest tests passing
- ✅ Code coverage maintained
- ✅ Script execution without errors
- ✅ File generation (all_download_links.txt)
- ✅ File generation (mandatory_download_links.txt)
- ✅ JSON generation (json/logicpro_content.json)
- ✅ Correct number of links generated
- ✅ Clean execution output
- ✅ Proper error handling
- ✅ Files created in expected locations
The script automatically cleans up before each run. If you want to manually clean up:
rm -rf ~/Desktop/lpx_links_test
rm -rf ~/Desktop/lpx_download_links- The script uses local code only - it never pulls from GitHub
- Each run starts with a clean slate - previous test files are removed
- The script is reusable - run it as many times as needed
- Generated files are left for manual inspection
- The script exits on first failure to help identify issues quickly
========================================
Local Workflow Testing Script
========================================
Repository: /Users/davidteren/Projects/LogicLinks/lpx_links
Test Directory: /Users/davidteren/Desktop/lpx_links_test
========================================
Cleaning Up Previous Test Runs
========================================
==> Removing previous test directory: /Users/davidteren/Desktop/lpx_links_test
✓ Test directory removed
✓ Cleanup complete
========================================
Setting Up Test Environment
========================================
==> Creating test directories
✓ Test directories created
==> Copying local code from: /Users/davidteren/Projects/LogicLinks/lpx_links
==> to: /Users/davidteren/Desktop/lpx_links_test/app
✓ Local code copied successfully
==> Testing code from branch: test/local-workflow-validation
==> Last commit: abc1234 Add local testing script
[... more output ...]
========================================
All Tests Passed! ✓
========================================
✓ Local changes are working correctly
✓ You can now safely push your changes
If you find issues with the test script or have suggestions for improvements, please open an issue or submit a PR.