Note
This document provides an overview of the testing strategy for the foundryup.sh script in the CI/CD environment.
Non-Interactive Design: The script now assumes it is running in a CI/CD environment, thus ensuring it can run without human interaction.
Consistent Logging: Ensures all log messages are consistent and CI-friendly. Automatic Directory Creation: Automatically creates necessary directories and ensures no manual intervention is required.
Simplified Argument Parsing: Simplified argument parsing to make it more robust for automated environments.
Error Handling: Enhanced error handling to ensure the script fails fast and provides meaningful error messages for debugging in CI/CD logs.
-
Basic Command Execution:
- Ensure essential commands like
git,curl, andcargoare called.
- Ensure essential commands like
-
Argument Parsing:
- Test with different combinations of arguments to verify proper parsing.
-
Environment Setup:
- Ensure environment variables and directories are set up correctly.
-
Platform and Architecture Handling:
- Verify correct handling of different platforms and architectures.
-
Error Handling:
- Ensure proper error messages are displayed for invalid inputs or failures.
-
File and Directory Operations:
- Test file and directory creation, deletion, and symlinking operations.
-
Function Output Verification:
- Verify output of functions like
say,warn, anderr.
- Verify output of functions like
-
Binary Installation:
- Ensure binaries are downloaded and installed correctly.
-
Local Repository Installation:
- Verify installation from a local repository.
-
Help Message:
- Ensure the help message is displayed correctly.
-
Basic Command Execution:
- Tests that
gitandcurlcommands are called during the script execution.
- Tests that
-
Argument Parsing:
- Ensures the script handles unknown options correctly and displays an appropriate warning message.
-
Environment Setup:
- Tests that
cdandcargocommands are called when installing from a local repository.
- Tests that
-
Platform and Architecture Handling:
- Verifies the script handles platform and architecture correctly.
-
Error Handling:
- Ensures the
ensurefunction fails correctly when a command fails. - Tests that
warn,say, anderrfunctions display messages correctly.
- Ensures the
-
Help Message:
- Ensures the help message is displayed correctly with the
--helpoption.
- Ensures the help message is displayed correctly with the
These tests cover various aspects of the script to ensure it works correctly in a CI/CD environment.