From 8c7a327120f582d1164bed513210b6be52b1a6f5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Sep 2025 20:03:27 +0000 Subject: [PATCH 1/5] Initial plan From 1e91a476d28658235ca5f2e3527987dd55172ed4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Sep 2025 20:17:06 +0000 Subject: [PATCH 2/5] Implement comprehensive automated testing infrastructure for all repository scripts Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com> --- .github/copilot-instructions.md | 40 ++++++ .github/workflows/test-scripts.yml | 68 +++++++++ TESTING.md | 194 ++++++++++++++++++++++++++ tests/test-check-template-version.sh | 150 ++++++++++++++++++++ tests/test-extract-version.sh | 64 +++++++++ tests/test-integration.sh | 182 ++++++++++++++++++++++++ tests/test-manage-versions.sh | 90 ++++++++++++ tests/test-runner.sh | 199 +++++++++++++++++++++++++++ tests/test-update-versions.sh | 126 +++++++++++++++++ 9 files changed, 1113 insertions(+) create mode 100644 .github/workflows/test-scripts.yml create mode 100644 TESTING.md create mode 100644 tests/test-check-template-version.sh create mode 100644 tests/test-extract-version.sh create mode 100644 tests/test-integration.sh create mode 100644 tests/test-manage-versions.sh create mode 100755 tests/test-runner.sh create mode 100644 tests/test-update-versions.sh diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 75e1b14..0a010a8 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -20,10 +20,14 @@ You are working on the ioBroker Copilot Instructions template repository. This r - `template.md` - The main template file that developers copy to their repositories as `.github/copilot-instructions.md` - `README.md` - Repository documentation explaining how to use the template - `CHANGELOG.md` - Version history and detailed change documentation +- `TESTING.md` - Automated testing infrastructure documentation - `scripts/check-template-version.sh` - Version checking utility for users - `scripts/manage-versions.sh` - Master version management script (show/check/sync/update commands) - `scripts/extract-version.sh` - Dynamic version extraction from template and current dates - `scripts/update-versions.sh` - Automated documentation synchronization script +- `tests/test-runner.sh` - Main test execution framework for all scripts +- `tests/test-*.sh` - Comprehensive test suites for each script and integration scenarios +- `.github/workflows/test-scripts.yml` - GitHub Actions workflow for continuous testing - `.github/copilot-instructions.md` - THIS file - repository-specific instructions ## Template Development Guidelines @@ -54,6 +58,42 @@ You are working on the ioBroker Copilot Instructions template repository. This r - Validate all code examples for syntax and functionality - Ensure version management scripts work correctly (`manage-versions.sh`, `extract-version.sh`, `update-versions.sh`) - Verify download URLs and curl commands in documentation +- **Run automated test suite before any changes**: `./tests/test-runner.sh` +- **All scripts must have corresponding tests** in the `tests/` directory +- **New functionality requires new test cases** to prevent regressions + +### Automated Testing Requirements +When adding new scripts or modifying existing ones, you **MUST**: + +1. **Create/Update Tests**: Add comprehensive test cases in the appropriate `test-.sh` file +2. **Test All Functions**: Cover success scenarios, error conditions, and edge cases +3. **Validate Dependencies**: Ensure tests check for required files and dependencies +4. **Test Integration**: Add integration tests if scripts interact with other components +5. **Run Full Suite**: Execute `./tests/test-runner.sh` to verify all tests pass +6. **Update Documentation**: Modify `TESTING.md` if adding new testing patterns + +#### Test Categories Required: +- **Unit Tests**: Individual function and command-line option testing +- **Integration Tests**: Script interaction and workflow testing +- **Error Handling Tests**: Missing files, invalid parameters, network failures +- **Consistency Tests**: Version synchronization and file state validation + +#### Test Framework Usage: +```bash +# Run all tests +./tests/test-runner.sh + +# Run specific test file +./tests/test-runner.sh tests/test-extract-version.sh + +# Add new test to existing file +run_test_with_output \ + "Test description" \ + "command to test" \ + "expected output pattern" +``` + +GitHub Copilot will automatically validate if new test cases should be created or existing ones removed when new functionality is added. ## Contributing to the Template diff --git a/.github/workflows/test-scripts.yml b/.github/workflows/test-scripts.yml new file mode 100644 index 0000000..a7c6a1e --- /dev/null +++ b/.github/workflows/test-scripts.yml @@ -0,0 +1,68 @@ +name: Automated Script Testing + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main ] + schedule: + # Run tests daily at 2 AM UTC to catch any issues + - cron: '0 2 * * *' + workflow_dispatch: + # Allow manual trigger + +jobs: + test-scripts: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Make test runner executable + run: chmod +x tests/test-runner.sh + + - name: Make all scripts executable + run: | + chmod +x scripts/*.sh + + - name: Run script tests + run: ./tests/test-runner.sh + + - name: Verify script functionality + run: | + echo "๐Ÿ” Verifying script functionality..." + ./scripts/manage-versions.sh show + ./scripts/extract-version.sh template + ./scripts/check-template-version.sh + + - name: Test version consistency + run: | + echo "๐Ÿ” Testing version consistency..." + if ! ./scripts/manage-versions.sh check; then + echo "โŒ Version inconsistency detected!" + exit 1 + else + echo "โœ… All versions are consistent" + fi + + # Optional: Create artifact with test results + - name: Create test report + if: always() + run: | + echo "# Test Report - $(date)" > test-report.md + echo "" >> test-report.md + echo "## Script Status" >> test-report.md + echo "" >> test-report.md + ./scripts/manage-versions.sh show >> test-report.md 2>&1 || true + echo "" >> test-report.md + echo "## Version Check" >> test-report.md + echo "" >> test-report.md + ./scripts/manage-versions.sh check >> test-report.md 2>&1 || true + + - name: Upload test report + if: always() + uses: actions/upload-artifact@v3 + with: + name: script-test-report + path: test-report.md \ No newline at end of file diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 0000000..f86bad8 --- /dev/null +++ b/TESTING.md @@ -0,0 +1,194 @@ +# Testing Infrastructure Documentation + +This document describes the automated testing infrastructure for all scripts and automations in the ioBroker Copilot Instructions repository. + +## Overview + +The testing framework provides comprehensive automated testing for all shell scripts in the `scripts/` directory: + +- `manage-versions.sh` - Master version management script +- `extract-version.sh` - Version and date extraction utility +- `update-versions.sh` - Documentation version synchronization +- `check-template-version.sh` - Template version comparison tool + +## Test Structure + +### Test Files + +All test files are located in the `tests/` directory: + +- `test-runner.sh` - Main test execution framework +- `test-extract-version.sh` - Tests for extract-version.sh functionality +- `test-manage-versions.sh` - Tests for manage-versions.sh commands +- `test-update-versions.sh` - Tests for update-versions.sh operations +- `test-check-template-version.sh` - Tests for check-template-version.sh features +- `test-integration.sh` - Integration tests for script interactions + +### Test Categories + +**Unit Tests**: Test individual script functions and command-line options +- Parameter validation +- Output format verification +- Error handling +- Edge cases + +**Integration Tests**: Test script interactions and workflows +- End-to-end version update workflows +- Cross-script dependencies +- File system operations +- Consistency validation + +**Error Handling Tests**: Test graceful failure scenarios +- Missing files +- Invalid parameters +- Network failures (for remote checks) +- Dependency failures + +## Running Tests + +### Local Development + +```bash +# Run all tests +./tests/test-runner.sh + +# Run specific test file +./tests/test-runner.sh tests/test-extract-version.sh + +# Make test runner executable if needed +chmod +x tests/test-runner.sh +``` + +### Continuous Integration + +Tests run automatically via GitHub Actions on: + +- Push to main/develop branches +- Pull requests to main branch +- Daily schedule (2 AM UTC) +- Manual trigger via workflow_dispatch + +The workflow is defined in `.github/workflows/test-scripts.yml`. + +## Test Framework Features + +### Isolated Test Environment + +Each test run creates an isolated temporary directory with copies of all repository files, ensuring tests don't interfere with the actual repository or each other. + +### Comprehensive Assertions + +- **Exit Code Validation**: Tests verify expected success/failure states +- **Output Pattern Matching**: Tests check for specific output messages +- **File State Verification**: Tests validate file changes and consistency +- **Dependency Checking**: Tests verify script dependencies exist + +### Detailed Reporting + +- Color-coded pass/fail indicators +- Detailed error messages for failed tests +- Test summary with counts +- Failed test details for debugging + +## Adding New Tests + +When adding new functionality to existing scripts or creating new scripts: + +### For Existing Scripts + +1. Add test cases to the appropriate `test-.sh` file +2. Follow the existing test patterns: + ```bash + run_test_with_output \ + "Test description" \ + "command to test" \ + "expected output pattern" + ``` + +### For New Scripts + +1. Create a new test file: `tests/test-.sh` +2. Follow the structure of existing test files +3. Test all command-line options and error conditions +4. Add integration tests to `test-integration.sh` if the script interacts with others + +### Test Function Reference + +```bash +# Test with exit code validation only +run_test "test name" "command" [expected_exit_code] + +# Test with output pattern validation +run_test_with_output "test name" "command" "regex_pattern" [expected_exit_code] + +# Direct pass/fail reporting +print_test_result "test name" "PASS|FAIL" ["error message"] +``` + +## Version Management Testing + +The test suite includes specific validation for version management workflows: + +### Version Consistency Tests +- Template vs README version matching +- Date synchronization verification +- Cross-file version propagation + +### Update Workflow Tests +- Full version update cycle testing +- Rollback and restoration testing +- Error recovery testing + +### Remote Version Checking Tests +- Network failure handling +- Malformed response handling +- Update guidance verification + +## Best Practices + +### Test Design +- Test both success and failure scenarios +- Include edge cases and boundary conditions +- Verify error messages are helpful and actionable +- Test script behavior with missing dependencies + +### Test Maintenance +- Update tests when script functionality changes +- Ensure tests are deterministic and don't depend on external state +- Use meaningful test names that describe the scenario +- Group related tests logically + +### Error Handling +- Test graceful degradation when files are missing +- Verify appropriate exit codes for different error conditions +- Test recovery from inconsistent states + +## Troubleshooting + +### Common Issues + +**Test Environment Setup Failures**: Ensure all scripts have execute permissions +```bash +chmod +x scripts/*.sh tests/*.sh +``` + +**Hidden File Copying**: The test framework copies hidden directories (like `.github`) for complete testing + +**Network-dependent Tests**: Some tests (remote version checking) may fail in network-restricted environments but include fallback scenarios + +### Debugging Failed Tests + +1. Run specific failing test file for detailed output +2. Check the error message in the test summary +3. Verify script dependencies and file permissions +4. Test the actual script manually with the failing scenario + +## Future Enhancements + +Potential testing improvements: + +- **Performance Testing**: Add timing measurements for large operations +- **Stress Testing**: Test with large files or many concurrent operations +- **Security Testing**: Validate input sanitization and path traversal protection +- **Cross-Platform Testing**: Test on different OS environments (Windows, macOS) +- **Mutation Testing**: Verify test quality by introducing intentional bugs \ No newline at end of file diff --git a/tests/test-check-template-version.sh b/tests/test-check-template-version.sh new file mode 100644 index 0000000..7735e89 --- /dev/null +++ b/tests/test-check-template-version.sh @@ -0,0 +1,150 @@ +#!/bin/bash +# +# Tests for check-template-version.sh script +# + +echo -e "${BLUE}Testing check-template-version.sh${NC}" + +# Test successful version check with existing template +run_test_with_output \ + "Check template version runs successfully" \ + "$TEST_DIR/scripts/check-template-version.sh" \ + "๐Ÿ” Checking ioBroker Copilot template version" + +# Test version extraction from local template +run_test_with_output \ + "Local version extraction works" \ + "$TEST_DIR/scripts/check-template-version.sh" \ + "๐Ÿ“„ Local template version:" + +# Test remote version check (may fail in CI due to network) +run_test_with_output \ + "Remote version check attempts" \ + "$TEST_DIR/scripts/check-template-version.sh" \ + "๐ŸŒ Checking remote template version" + +# Test completion message +run_test_with_output \ + "Check completion message" \ + "$TEST_DIR/scripts/check-template-version.sh" \ + "๐Ÿ Template check complete" + +# Test missing local template handling +test_missing_template() { + cd "$TEST_DIR" + mv .github/copilot-instructions.md .github/copilot-instructions.md.bak 2>/dev/null || true + local result=0 + + if ./scripts/check-template-version.sh 2>&1 | grep -q "โŒ Local template not found"; then + result=0 + else + result=1 + fi + + mv .github/copilot-instructions.md.bak .github/copilot-instructions.md 2>/dev/null || true + return $result +} + +run_test \ + "Missing local template error handling" \ + "$(declare -f test_missing_template); test_missing_template" + +# Test template without version (malformed) +test_malformed_template() { + cd "$TEST_DIR" + + # Backup original and create malformed version + cp .github/copilot-instructions.md .github/copilot-instructions.md.bak + sed -i '/Version:/d' .github/copilot-instructions.md + + local result=0 + if ./scripts/check-template-version.sh 2>&1 | grep -q "Could not detect version"; then + result=0 + else + result=1 + fi + + # Restore original + mv .github/copilot-instructions.md.bak .github/copilot-instructions.md + return $result +} + +run_test \ + "Malformed template version handling" \ + "$(declare -f test_malformed_template); test_malformed_template" + +# Test URL configuration +local_template_path="$TEST_DIR/.github/copilot-instructions.md" +if [[ -f "$local_template_path" ]]; then + print_test_result "Local template file exists" "PASS" +else + print_test_result "Local template file exists" "FAIL" "Local template not found at expected path" +fi + +# Test script contains correct remote URL +if grep -q "https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/template.md" "$TEST_DIR/scripts/check-template-version.sh"; then + print_test_result "Correct remote URL configured" "PASS" +else + print_test_result "Correct remote URL configured" "FAIL" "Remote URL not found or incorrect" +fi + +# Test script is executable +if [[ -x "$TEST_DIR/scripts/check-template-version.sh" ]]; then + print_test_result "Script is executable" "PASS" +else + print_test_result "Script is executable" "FAIL" "Script is not executable" +fi + +# Test curl command handling (simulate network failure) +test_network_failure() { + cd "$TEST_DIR" + + # Create a modified script with invalid URL to simulate network failure + cp scripts/check-template-version.sh scripts/check-template-version-test.sh + sed -i 's|https://raw.githubusercontent.com/DrozmotiX/ioBroker-Copilot-Instructions/main/template.md|http://invalid-url-for-testing.invalid|g' scripts/check-template-version-test.sh + chmod +x scripts/check-template-version-test.sh + + local result=0 + if ./scripts/check-template-version-test.sh 2>&1 | grep -q "Could not fetch remote version"; then + result=0 + else + result=1 + fi + + rm -f scripts/check-template-version-test.sh + return $result +} + +run_test \ + "Network failure handling" \ + "$(declare -f test_network_failure); test_network_failure" + +# Test update guidance is provided for outdated templates +test_update_guidance() { + cd "$TEST_DIR" + + # Backup original and create outdated version + cp .github/copilot-instructions.md .github/copilot-instructions.md.bak + sed -i 's/\*\*Version:\*\* [0-9\.]*/**Version:** 0.1.0/' .github/copilot-instructions.md + + local result=0 + # Note: This test may pass even if network is unavailable, because it tests local vs remote comparison + if ./scripts/check-template-version.sh 2>&1 | grep -q "๐Ÿ’ก To update your template"; then + result=0 + else + # If network failed, we might see network error instead + if ./scripts/check-template-version.sh 2>&1 | grep -q "Could not fetch remote version"; then + result=0 # Network failure is acceptable for this test + else + result=1 + fi + fi + + # Restore original + mv .github/copilot-instructions.md.bak .github/copilot-instructions.md + return $result +} + +run_test \ + "Update guidance for outdated templates" \ + "$(declare -f test_update_guidance); test_update_guidance" \ No newline at end of file diff --git a/tests/test-extract-version.sh b/tests/test-extract-version.sh new file mode 100644 index 0000000..32c8d61 --- /dev/null +++ b/tests/test-extract-version.sh @@ -0,0 +1,64 @@ +#!/bin/bash +# +# Tests for extract-version.sh script +# + +# Test extract-version.sh functionality + +echo -e "${BLUE}Testing extract-version.sh${NC}" + +# Test template version extraction +run_test_with_output \ + "Extract template version" \ + "$TEST_DIR/scripts/extract-version.sh template" \ + "^[0-9]+\.[0-9]+\.[0-9]+$" + +# Test current year extraction +run_test_with_output \ + "Extract current year" \ + "$TEST_DIR/scripts/extract-version.sh current-year" \ + "^[0-9]{4}$" + +# Test current month extraction +run_test_with_output \ + "Extract current month" \ + "$TEST_DIR/scripts/extract-version.sh current-month" \ + "^[A-Za-z]+$" + +# Test current date extraction +run_test_with_output \ + "Extract current date" \ + "$TEST_DIR/scripts/extract-version.sh current-date" \ + "^[A-Za-z]+ [0-9]{4}$" + +# Test default parameter (should extract template version) +run_test_with_output \ + "Default parameter extracts template version" \ + "$TEST_DIR/scripts/extract-version.sh" \ + "^[0-9]+\.[0-9]+\.[0-9]+$" + +# Test invalid parameter +run_test_with_output \ + "Invalid parameter shows usage and exits with code 1" \ + "$TEST_DIR/scripts/extract-version.sh invalid-param" \ + "Usage:" \ + 1 + +# Test with missing template file +run_test \ + "Missing template file returns 'unknown'" \ + "cd '$TEST_DIR' && mv template.md template.md.bak && ./scripts/extract-version.sh template && mv template.md.bak template.md" \ + 0 + +# Verify the "unknown" output when template is missing +run_test_with_output \ + "Missing template file outputs 'unknown'" \ + "cd '$TEST_DIR' && mv template.md template.md.bak && ./scripts/extract-version.sh template; mv template.md.bak template.md" \ + "unknown" + +# Test script is executable +if [[ -x "$TEST_DIR/scripts/extract-version.sh" ]]; then + print_test_result "Script is executable" "PASS" +else + print_test_result "Script is executable" "FAIL" "Script is not executable" +fi \ No newline at end of file diff --git a/tests/test-integration.sh b/tests/test-integration.sh new file mode 100644 index 0000000..7a9c95e --- /dev/null +++ b/tests/test-integration.sh @@ -0,0 +1,182 @@ +#!/bin/bash +# +# Integration tests for script interactions and end-to-end workflows +# + +echo -e "${BLUE}Testing Script Integration${NC}" + +# Test full version update workflow +test_version_update_workflow() { + cd "$TEST_DIR" + + # Store original versions + local original_template_version=$(grep "^**Version:**" template.md | head -1 | sed 's/.*Version:\*\* *//' | tr -d ' ') + + # Update to a test version + ./scripts/manage-versions.sh update 1.2.3 >/dev/null 2>&1 + + # Check if all files were updated + local template_version=$(grep "^**Version:**" template.md | head -1 | sed 's/.*Version:\*\* *//' | tr -d ' ') + local readme_version=$(grep "Latest Version:" README.md | head -1 | sed 's/.*Latest Version:\*\* v*//' | tr -d ' ') + local copilot_version=$(grep "^**Version:**" .github/copilot-instructions.md | head -1 | sed 's/.*Version:\*\* *//' | tr -d ' ') + + # Restore original version + ./scripts/manage-versions.sh update "$original_template_version" >/dev/null 2>&1 + + if [[ "$template_version" == "1.2.3" && "$readme_version" == "1.2.3" && "$copilot_version" == "1.2.3" ]]; then + return 0 + else + return 1 + fi +} + +run_test \ + "Full version update workflow" \ + "$(declare -f test_version_update_workflow); test_version_update_workflow" + +# Test consistency check after version update +test_consistency_after_update() { + cd "$TEST_DIR" + + # Store original version + local original_version=$(./scripts/extract-version.sh template) + + # Update version + ./scripts/manage-versions.sh update 2.3.4 >/dev/null 2>&1 + + # Check consistency + local consistency_result=0 + if ./scripts/manage-versions.sh check >/dev/null 2>&1; then + consistency_result=0 + else + consistency_result=1 + fi + + # Restore original version + ./scripts/manage-versions.sh update "$original_version" >/dev/null 2>&1 + + return $consistency_result +} + +run_test \ + "Consistency check after version update" \ + "$(declare -f test_consistency_after_update); test_consistency_after_update" + +# Test sync functionality restores consistency +test_sync_restores_consistency() { + cd "$TEST_DIR" + + # Create inconsistency by manually editing README + sed -i 's/Latest Version:\*\* v[0-9]\+\.[0-9]\+\.[0-9]\+/Latest Version:** v9.9.9/' README.md + + # Sync should fix it + ./scripts/manage-versions.sh sync >/dev/null 2>&1 + + # Check if consistency is restored + if ./scripts/manage-versions.sh check >/dev/null 2>&1; then + return 0 + else + return 1 + fi +} + +run_test \ + "Sync restores version consistency" \ + "$(declare -f test_sync_restores_consistency); test_sync_restores_consistency" + +# Test all scripts have execute permissions +scripts=("manage-versions.sh" "extract-version.sh" "update-versions.sh" "check-template-version.sh") +for script in "${scripts[@]}"; do + if [[ -x "$TEST_DIR/scripts/$script" ]]; then + print_test_result "Script $script has execute permission" "PASS" + else + print_test_result "Script $script has execute permission" "FAIL" "Script lacks execute permission" + fi +done + +# Test all scripts can be run from any directory +test_script_path_independence() { + cd "$TEST_DIR" + + # Create a subdirectory and test running from there + mkdir -p test-subdir + cd test-subdir + + local result=0 + if ../scripts/extract-version.sh template >/dev/null 2>&1; then + result=0 + else + result=1 + fi + + cd .. + rmdir test-subdir + return $result +} + +run_test \ + "Scripts work from different directories" \ + "$(declare -f test_script_path_independence); test_script_path_independence" + +# Test error handling when repository files are missing +test_missing_files_handling() { + cd "$TEST_DIR" + + # Test with missing template - show command should still work (displays warning) + mv template.md template.md.bak + + local result1=0 + if ./scripts/manage-versions.sh show >/dev/null 2>&1; then + result1=0 # Show command works even without template (shows error message) + else + result1=1 + fi + + mv template.md.bak template.md + + # Test with missing README - check command should fail (can't check consistency) + mv README.md README.md.bak + + local result2=0 + if ./scripts/manage-versions.sh check >/dev/null 2>&1; then + result2=1 # Should fail when README is missing + else + result2=0 # Expected failure + fi + + mv README.md.bak README.md + + # Show should work, check should fail + if [[ $result1 -eq 0 && $result2 -eq 0 ]]; then + return 0 + else + return 1 + fi +} + +run_test \ + "Error handling with missing repository files" \ + "$(declare -f test_missing_files_handling); test_missing_files_handling" + +# Test date synchronization +test_date_synchronization() { + cd "$TEST_DIR" + + # Change README date to something old + sed -i 's/Last Updated:\*\* [A-Za-z]* [0-9]*/Last Updated:** January 2000/' README.md + + # Sync should update the date + ./scripts/manage-versions.sh sync >/dev/null 2>&1 + + # Check if date was updated to current + local current_date=$(./scripts/extract-version.sh current-date) + if grep -q "Last Updated:\*\* $current_date" README.md; then + return 0 + else + return 1 + fi +} + +run_test \ + "Date synchronization works" \ + "$(declare -f test_date_synchronization); test_date_synchronization" \ No newline at end of file diff --git a/tests/test-manage-versions.sh b/tests/test-manage-versions.sh new file mode 100644 index 0000000..2a32afb --- /dev/null +++ b/tests/test-manage-versions.sh @@ -0,0 +1,90 @@ +#!/bin/bash +# +# Tests for manage-versions.sh script +# + +echo -e "${BLUE}Testing manage-versions.sh${NC}" + +# Test show command +run_test_with_output \ + "Show command displays version status" \ + "$TEST_DIR/scripts/manage-versions.sh show" \ + "๐Ÿ“‹ Current Version Status" + +# Test check command with consistent versions +run_test_with_output \ + "Check command validates consistency" \ + "$TEST_DIR/scripts/manage-versions.sh check" \ + "๐Ÿ” Checking Version Consistency" + +# Test default command (should be show) +run_test_with_output \ + "Default command shows versions" \ + "$TEST_DIR/scripts/manage-versions.sh" \ + "๐Ÿ“‹ Current Version Status" + +# Test invalid command +run_test_with_output \ + "Invalid command shows usage" \ + "$TEST_DIR/scripts/manage-versions.sh invalid-command" \ + "Usage:" \ + 1 + +# Test update command without version +run_test_with_output \ + "Update command without version shows error" \ + "$TEST_DIR/scripts/manage-versions.sh update" \ + "Please specify a new version" \ + 1 + +# Test update command with invalid version format +run_test_with_output \ + "Update command with invalid version format" \ + "$TEST_DIR/scripts/manage-versions.sh update invalid.version" \ + "Invalid version format" \ + 1 + +# Test update command with valid version format +run_test_with_output \ + "Update command with valid version format" \ + "cd '$TEST_DIR' && ./scripts/manage-versions.sh update 0.9.9" \ + "๐Ÿ“ฆ Updating to version 0.9.9" + +# Test sync command +run_test_with_output \ + "Sync command updates documentation" \ + "$TEST_DIR/scripts/manage-versions.sh sync" \ + "๐Ÿ”„ Syncing Documentation" + +# Test that version inconsistency is detected +create_version_inconsistency() { + # Create inconsistency by modifying README + sed -i 's/Latest Version:\*\* v[0-9]\+\.[0-9]\+\.[0-9]\+/Latest Version:** v9.9.9/' "$TEST_DIR/README.md" +} + +run_test \ + "Create version inconsistency for testing" \ + "$(declare -f create_version_inconsistency); create_version_inconsistency" + +run_test_with_output \ + "Check command detects inconsistency" \ + "$TEST_DIR/scripts/manage-versions.sh check" \ + "Version mismatch" \ + 1 + +# Test script dependencies exist +dependencies=("extract-version.sh" "update-versions.sh") +for dep in "${dependencies[@]}"; do + if [[ -f "$TEST_DIR/scripts/$dep" ]]; then + print_test_result "Dependency $dep exists" "PASS" + else + print_test_result "Dependency $dep exists" "FAIL" "Missing dependency: $dep" + fi +done + +# Test script is executable +if [[ -x "$TEST_DIR/scripts/manage-versions.sh" ]]; then + print_test_result "Script is executable" "PASS" +else + print_test_result "Script is executable" "FAIL" "Script is not executable" +fi \ No newline at end of file diff --git a/tests/test-runner.sh b/tests/test-runner.sh new file mode 100755 index 0000000..9417933 --- /dev/null +++ b/tests/test-runner.sh @@ -0,0 +1,199 @@ +#!/bin/bash +# +# Test Runner for ioBroker Copilot Instructions Scripts +# +# This script runs all automated tests for the repository scripts. +# It provides a simple testing framework for shell scripts. +# +# Usage: ./tests/test-runner.sh [specific-test-file] + +set -e + +# Color codes for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Test counters +TOTAL_TESTS=0 +PASSED_TESTS=0 +FAILED_TESTS=0 +FAILED_TEST_DETAILS=() + +# Get script directory and repo root +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(dirname "$SCRIPT_DIR")" + +# Function to print test results +print_test_result() { + local test_name="$1" + local result="$2" + local error_msg="$3" + + TOTAL_TESTS=$((TOTAL_TESTS + 1)) + + if [[ "$result" == "PASS" ]]; then + echo -e " ${GREEN}โœ… PASS${NC} $test_name" + PASSED_TESTS=$((PASSED_TESTS + 1)) + else + echo -e " ${RED}โŒ FAIL${NC} $test_name" + if [[ -n "$error_msg" ]]; then + echo -e " ${RED}Error: $error_msg${NC}" + fi + FAILED_TESTS=$((FAILED_TESTS + 1)) + FAILED_TEST_DETAILS+=("$test_name: $error_msg") + fi +} + +# Function to run a test and capture output +run_test() { + local test_name="$1" + local test_command="$2" + local expected_exit_code="${3:-0}" + + local output + local exit_code + + # Run command and capture output and exit code + if output=$(eval "$test_command" 2>&1); then + exit_code=0 + else + exit_code=$? + fi + + # Check if exit code matches expected + if [[ $exit_code -eq $expected_exit_code ]]; then + print_test_result "$test_name" "PASS" + return 0 + else + print_test_result "$test_name" "FAIL" "Expected exit code $expected_exit_code, got $exit_code. Output: $output" + return 1 + fi +} + +# Function to run a test with output validation +run_test_with_output() { + local test_name="$1" + local test_command="$2" + local expected_pattern="$3" + local expected_exit_code="${4:-0}" + + local output + local exit_code + + # Run command and capture output and exit code + if output=$(eval "$test_command" 2>&1); then + exit_code=0 + else + exit_code=$? + fi + + # Check exit code and output pattern + if [[ $exit_code -eq $expected_exit_code ]] && [[ "$output" =~ $expected_pattern ]]; then + print_test_result "$test_name" "PASS" + return 0 + else + local error_msg="Expected exit code $expected_exit_code (got $exit_code) and pattern '$expected_pattern'. Output: $output" + print_test_result "$test_name" "FAIL" "$error_msg" + return 1 + fi +} + +# Function to create test environment +setup_test_env() { + # Create temporary directory for test files + TEST_DIR=$(mktemp -d) + export TEST_DIR + + # Copy original files to test directory for isolated testing + cp -r "$REPO_ROOT"/* "$TEST_DIR/" 2>/dev/null || true + + # Ensure hidden directories are copied (like .github) + cp -r "$REPO_ROOT"/.* "$TEST_DIR/" 2>/dev/null || true + + # Clean up unwanted copied directories + rm -rf "$TEST_DIR/.git" "$TEST_DIR/." "$TEST_DIR/.." 2>/dev/null || true + + echo -e "${BLUE}๐Ÿงช Test Environment Setup${NC}" + echo "Test directory: $TEST_DIR" +} + +# Function to cleanup test environment +cleanup_test_env() { + if [[ -n "$TEST_DIR" && -d "$TEST_DIR" ]]; then + rm -rf "$TEST_DIR" + fi +} + +# Function to run specific test file +run_test_file() { + local test_file="$1" + if [[ -f "$test_file" ]]; then + echo -e "${BLUE}๐Ÿ“‹ Running tests from: $(basename "$test_file")${NC}" + source "$test_file" + echo "" + else + echo -e "${RED}โŒ Test file not found: $test_file${NC}" + exit 1 + fi +} + +# Function to display final summary +display_summary() { + echo -e "${BLUE}๐Ÿ“Š Test Summary${NC}" + echo "================" + echo -e "Total tests: $TOTAL_TESTS" + echo -e "${GREEN}Passed: $PASSED_TESTS${NC}" + echo -e "${RED}Failed: $FAILED_TESTS${NC}" + + if [[ $FAILED_TESTS -gt 0 ]]; then + echo "" + echo -e "${RED}Failed Test Details:${NC}" + for detail in "${FAILED_TEST_DETAILS[@]}"; do + echo -e " ${RED}โ€ข${NC} $detail" + done + fi + + echo "" + if [[ $FAILED_TESTS -eq 0 ]]; then + echo -e "${GREEN}๐ŸŽ‰ All tests passed!${NC}" + exit 0 + else + echo -e "${RED}โŒ Some tests failed.${NC}" + exit 1 + fi +} + +# Main execution +main() { + echo -e "${BLUE}๐Ÿš€ ioBroker Copilot Instructions - Script Test Suite${NC}" + echo "===========================================================" + echo "" + + # Setup test environment + setup_test_env + + # Trap to ensure cleanup + trap cleanup_test_env EXIT + + # If specific test file provided, run only that + if [[ $# -gt 0 ]]; then + run_test_file "$1" + else + # Run all test files + for test_file in "$SCRIPT_DIR"/test-*.sh; do + # Skip the test-runner itself to avoid infinite recursion + if [[ "$(basename "$test_file")" != "test-runner.sh" && -f "$test_file" ]]; then + run_test_file "$test_file" + fi + done + fi + + # Display summary + display_summary +} + +# Run main function with all arguments +main "$@" \ No newline at end of file diff --git a/tests/test-update-versions.sh b/tests/test-update-versions.sh new file mode 100644 index 0000000..2db849c --- /dev/null +++ b/tests/test-update-versions.sh @@ -0,0 +1,126 @@ +#!/bin/bash +# +# Tests for update-versions.sh script +# + +echo -e "${BLUE}Testing update-versions.sh${NC}" + +# Test successful version update +run_test_with_output \ + "Update versions script runs successfully" \ + "$TEST_DIR/scripts/update-versions.sh" \ + "๐Ÿ”„ Updating documentation versions" + +# Test that script updates README with current template version +run_test_with_output \ + "Script extracts template version" \ + "$TEST_DIR/scripts/update-versions.sh" \ + "Template version:" + +# Test that script extracts current date +run_test_with_output \ + "Script extracts current date" \ + "$TEST_DIR/scripts/update-versions.sh" \ + "Current date:" + +# Test completion message +run_test_with_output \ + "Script shows completion message" \ + "$TEST_DIR/scripts/update-versions.sh" \ + "๐Ÿ Version update complete" + +# Test dependency on extract-version.sh +if [[ -f "$TEST_DIR/scripts/extract-version.sh" ]]; then + print_test_result "Dependency extract-version.sh exists" "PASS" +else + print_test_result "Dependency extract-version.sh exists" "FAIL" "Missing dependency: extract-version.sh" +fi + +# Test with missing extract-version.sh dependency +test_missing_dependency() { + cd "$TEST_DIR" + mv scripts/extract-version.sh scripts/extract-version.sh.bak + + local exit_code=0 + if ./scripts/update-versions.sh >/dev/null 2>&1; then + exit_code=0 + else + exit_code=1 + fi + + mv scripts/extract-version.sh.bak scripts/extract-version.sh + return $exit_code +} + +run_test \ + "Missing dependency handling" \ + "$(declare -f test_missing_dependency); test_missing_dependency" \ + 1 + +# Test that script handles missing template gracefully +test_missing_template() { + cd "$TEST_DIR" + mv template.md template.md.bak + + local exit_code=0 + if ./scripts/update-versions.sh >/dev/null 2>&1; then + exit_code=0 + else + exit_code=1 + fi + + mv template.md.bak template.md + return $exit_code +} + +run_test \ + "Missing template file handling" \ + "$(declare -f test_missing_template); test_missing_template" \ + 1 + +# Test README file exists +if [[ -f "$TEST_DIR/README.md" ]]; then + print_test_result "README.md exists for updating" "PASS" +else + print_test_result "README.md exists for updating" "FAIL" "README.md not found" +fi + +# Test that no changes are made if already up to date +run_test_with_output \ + "No changes message when already up to date" \ + "cd '$TEST_DIR' && ./scripts/update-versions.sh && ./scripts/update-versions.sh" \ + "No changes needed" + +# Test script is executable +if [[ -x "$TEST_DIR/scripts/update-versions.sh" ]]; then + print_test_result "Script is executable" "PASS" +else + print_test_result "Script is executable" "FAIL" "Script is not executable" +fi + +# Test actual version replacement in README +test_version_replacement() { + local original_version=$(grep "Latest Version:" "$TEST_DIR/README.md" | head -1 | sed 's/.*Latest Version:\*\* v*//' | tr -d ' ') + + # Change template version temporarily + sed -i 's/^\*\*Version:\*\* [0-9\.]*/**Version:** 9.8.7/' "$TEST_DIR/template.md" + + # Run update script + "$TEST_DIR/scripts/update-versions.sh" >/dev/null 2>&1 + + # Check if README was updated + local updated_version=$(grep "Latest Version:" "$TEST_DIR/README.md" | head -1 | sed 's/.*Latest Version:\*\* v*//' | tr -d ' ') + + # Restore original template + sed -i 's/^\*\*Version:\*\* [0-9\.]*/**Version:** '"$original_version"'/' "$TEST_DIR/template.md" + + if [[ "$updated_version" == "9.8.7" ]]; then + return 0 + else + return 1 + fi +} + +run_test \ + "Version replacement functionality" \ + "$(declare -f test_version_replacement); test_version_replacement" \ No newline at end of file From ab490385d125eec055fcc65f057f134a37e5855a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Sep 2025 20:26:42 +0000 Subject: [PATCH 3/5] Update CHANGELOG.md and README.md with automated testing infrastructure details, enhance PR guidelines Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com> --- .github/copilot-instructions.md | 11 +++++---- CHANGELOG.md | 11 ++++++++- README.md | 41 +++++++++++++++++++++++++++++++-- 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 0a010a8..04f925b 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -133,13 +133,16 @@ GitHub Copilot will automatically validate if new test cases should be created o - Close duplicate or outdated issues promptly ### Pull Request Guidelines -- **ALWAYS update CHANGELOG.md** - Every PR that introduces new functionality, fixes issues, or makes changes must include a detailed changelog entry with issue references (e.g., "Fixes #11") -- PRs must update version numbers appropriately -- Include detailed CHANGELOG.md entries for user-facing changes +- **ALWAYS update CHANGELOG.md** - Every PR that introduces new functionality, fixes issues, or makes changes must include a detailed changelog entry with issue references (e.g., "Fixes #16") +- **ALWAYS update README.md** - When adding new functionality, infrastructure, or changing how users interact with the repository, update the relevant sections of README.md +- PRs must update version numbers appropriately using the dynamic version management system +- Include detailed CHANGELOG.md entries for user-facing changes with specific details about what was added/changed/fixed - Test changes against multiple ioBroker adapter projects when possible -- Update README.md if usage instructions change +- Update README.md if usage instructions, new features, or repository structure changes - Verify dynamic version management system continues to work (`./scripts/manage-versions.sh check`) +- **Run the complete test suite** (`./tests/test-runner.sh`) to ensure all tests pass - Reference the specific issue number in both commit messages and changelog entries +- **Document new testing requirements** in TESTING.md when adding new scripts or functionality ### Release Process - Use dynamic version management: `./scripts/manage-versions.sh update X.Y.Z` diff --git a/CHANGELOG.md b/CHANGELOG.md index af5c3d2..5ae4364 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,19 @@ All notable changes to the ioBroker Copilot Instructions template will be docume The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.3.1] - 2025-01-XX +## [0.3.1] - 2025-09-XX ### Added - **Dynamic Version Management System** - Comprehensive scripts for automated version handling across all documentation - **Version Extraction Script** (`scripts/extract-version.sh`) - Dynamically extracts version from template and current dates - **Documentation Update Script** (`scripts/update-versions.sh`) - Automatically updates version references in README.md - **Master Version Management** (`scripts/manage-versions.sh`) - Unified interface for version show/check/sync/update operations +- **Comprehensive Automated Testing Infrastructure** - Complete test framework for all repository scripts with 54 tests (Fixes #16) + - **Test Runner** (`tests/test-runner.sh`) - Main test execution framework with isolated environments and detailed reporting + - **Script-Specific Test Suites** - Dedicated test files for each script covering unit, integration, and error scenarios + - **GitHub Actions Workflow** (`.github/workflows/test-scripts.yml`) - Automated CI/CD testing on push, PRs, and scheduled runs + - **Testing Documentation** (`TESTING.md`) - Comprehensive guide for test framework usage and maintenance + - **Test Coverage** - 9 tests for extract-version.sh, 13 for manage-versions.sh, 11 for update-versions.sh, 11 for check-template-version.sh, 10 integration tests ### Changed - **Separated Repository Instructions** - `.github/copilot-instructions.md` now contains repository-specific instructions for maintaining the template repository @@ -29,6 +35,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Eliminated Static Version References** - All version numbers and dates are now dynamically generated from template source - **Cross-Documentation Consistency** - Automated validation ensures all files reference the same version - **Date Management** - Automatic current date insertion eliminates stale date references (e.g., "January 2025" โ†’ current month/year) +- **Automated Testing Requirements** - Updated Copilot instructions with mandatory testing guidelines for new functionality +- **Quality Assurance Through Testing** - Comprehensive test coverage prevents regressions and ensures script reliability +- **CI/CD Integration** - Automated testing on all repository changes maintains code quality - Version checking script continues to work with new structure - Clear separation between template maintenance (this repository) and adapter development (template usage) - Better documentation workflow for template contributors vs adapter developers diff --git a/README.md b/README.md index 840aaff..37b1115 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,34 @@ These scripts ensure that: - All cross-references remain consistent - Manual version updates are no longer needed +### Automated Testing Infrastructure + +This repository includes a comprehensive automated testing framework that ensures all scripts and automations work correctly: + +```bash +# Run all tests (54 total tests) +./tests/test-runner.sh + +# Run specific test file +./tests/test-runner.sh tests/test-extract-version.sh + +# Tests are automatically run in CI/CD via GitHub Actions +``` + +**Test Coverage:** +- **Unit Tests**: Individual script functions and parameter validation +- **Integration Tests**: Cross-script workflows and end-to-end scenarios +- **Error Handling Tests**: Missing files, invalid parameters, network failures +- **Consistency Tests**: Version synchronization and file state validation + +**Key Features:** +- **Isolated Test Environments**: Each test run uses temporary directories to prevent interference +- **Comprehensive Reporting**: Color-coded output with detailed error messages and debugging information +- **CI/CD Integration**: Automated testing on all repository changes via `.github/workflows/test-scripts.yml` +- **Developer Friendly**: Simple commands with clear documentation in `TESTING.md` + +All repository scripts are thoroughly tested to prevent regressions and ensure reliability for the ioBroker community. + #### GitHub Action for Continuous Monitoring You can set up a GitHub Action to periodically check if your template is up-to-date: @@ -216,8 +244,17 @@ We welcome contributions to improve these instructions! Please: 1. Fork this repository 2. Create a feature branch 3. Make your improvements -4. Test with real ioBroker adapter development -5. Submit a pull request with a clear description of changes +4. **Run the test suite**: `./tests/test-runner.sh` to ensure all tests pass +5. **Update documentation**: Add changelog entries and update README if needed +6. Test with real ioBroker adapter development +7. Submit a pull request with a clear description of changes + +### Development Guidelines + +- All new scripts must have corresponding tests in the `tests/` directory +- Changes to existing scripts require updating relevant test cases +- Follow the testing patterns documented in `TESTING.md` +- Ensure all 54 tests pass before submitting PRs ## ๐Ÿ™ Acknowledgments From ef65fb046d28839b94b42e4da4d2a2ea0949db42 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Sep 2025 20:36:18 +0000 Subject: [PATCH 4/5] Update version to 0.4.0 using automation scripts, remove daily schedule from CI workflow Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com> --- .github/copilot-instructions.md | 2 +- .github/workflows/test-scripts.yml | 3 --- CHANGELOG.md | 2 +- README.md | 6 +++--- template.md | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 04f925b..99837c6 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -2,7 +2,7 @@ **Repository Purpose:** This repository maintains the template and best practices for GitHub Copilot instructions used in ioBroker adapter development. -**Version:** 0.3.1 +**Version:** 0.4.0 This file contains instructions specific to maintaining and improving this template repository, not for ioBroker adapter development (that's in `template.md`). diff --git a/.github/workflows/test-scripts.yml b/.github/workflows/test-scripts.yml index a7c6a1e..cea7f92 100644 --- a/.github/workflows/test-scripts.yml +++ b/.github/workflows/test-scripts.yml @@ -5,9 +5,6 @@ on: branches: [ main, develop ] pull_request: branches: [ main ] - schedule: - # Run tests daily at 2 AM UTC to catch any issues - - cron: '0 2 * * *' workflow_dispatch: # Allow manual trigger diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ae4364..d27e4e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to the ioBroker Copilot Instructions template will be docume The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.3.1] - 2025-09-XX +## [0.4.0] - 2025-09-XX - Automated Version handling & validation by GitHub actions ### Added - **Dynamic Version Management System** - Comprehensive scripts for automated version handling across all documentation diff --git a/README.md b/README.md index 37b1115..30b0e04 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ cd your-iobroker-adapter # Use the following prompt in your editor: # "Merge my existing .github/copilot-instructions.md with the ioBroker template # from https://github.com/DrozmotiX/ioBroker-Copilot-Instructions/blob/main/template.md -# Keep project-specific content and add version: 0.3.1" +# Keep project-specific content and add version: 0.4.0" # NOTE: Exclude the HTML comment block at the top of the template" ``` @@ -74,7 +74,7 @@ git push To ensure you're using the latest best practices and that your local copy stays synchronized with improvements: ### Current Version -- **Latest Version:** v0.3.1 +- **Latest Version:** v0.4.0 - **Template Location:** [`template.md`](template.md) - **Last Updated:** September 2025 @@ -83,7 +83,7 @@ To ensure you're using the latest best practices and that your local copy stays You can validate your local template version by checking the version header in your `.github/copilot-instructions.md` file: ```markdown -**Version:** 0.3.1 +**Version:** 0.4.0 **Template Source:** https://github.com/DrozmotiX/ioBroker-Copilot-Instructions ``` diff --git a/template.md b/template.md index 92aad03..271ec7f 100644 --- a/template.md +++ b/template.md @@ -31,7 +31,7 @@ sed -i '/^$/d' .github/copilot-instructions.md # ioBroker Adapter Development with GitHub Copilot -**Version:** 0.3.1 +**Version:** 0.4.0 **Template Source:** https://github.com/DrozmotiX/ioBroker-Copilot-Instructions This file contains instructions and best practices for GitHub Copilot when working on ioBroker adapter development. From b31c8e13d2c01433cec7cf15979fc4ea328f9b9e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Sep 2025 20:45:28 +0000 Subject: [PATCH 5/5] Fix CI workflow: add execute permissions for test files and update actions to v4 Co-authored-by: DutchmanNL <7318445+DutchmanNL@users.noreply.github.com> --- .github/workflows/test-scripts.yml | 3 ++- tests/test-check-template-version.sh | 0 tests/test-extract-version.sh | 0 tests/test-integration.sh | 0 tests/test-manage-versions.sh | 0 tests/test-update-versions.sh | 0 6 files changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 tests/test-check-template-version.sh mode change 100644 => 100755 tests/test-extract-version.sh mode change 100644 => 100755 tests/test-integration.sh mode change 100644 => 100755 tests/test-manage-versions.sh mode change 100644 => 100755 tests/test-update-versions.sh diff --git a/.github/workflows/test-scripts.yml b/.github/workflows/test-scripts.yml index cea7f92..c6698c5 100644 --- a/.github/workflows/test-scripts.yml +++ b/.github/workflows/test-scripts.yml @@ -22,6 +22,7 @@ jobs: - name: Make all scripts executable run: | chmod +x scripts/*.sh + chmod +x tests/*.sh - name: Run script tests run: ./tests/test-runner.sh @@ -59,7 +60,7 @@ jobs: - name: Upload test report if: always() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: script-test-report path: test-report.md \ No newline at end of file diff --git a/tests/test-check-template-version.sh b/tests/test-check-template-version.sh old mode 100644 new mode 100755 diff --git a/tests/test-extract-version.sh b/tests/test-extract-version.sh old mode 100644 new mode 100755 diff --git a/tests/test-integration.sh b/tests/test-integration.sh old mode 100644 new mode 100755 diff --git a/tests/test-manage-versions.sh b/tests/test-manage-versions.sh old mode 100644 new mode 100755 diff --git a/tests/test-update-versions.sh b/tests/test-update-versions.sh old mode 100644 new mode 100755