Skip to main content
Glama
run_ci.shโ€ข2.45 kB
#!/bin/bash # Sentinel CI Runner # Runs headless tests in CI environment set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="${GODOT_PROJECT_ROOT:-$(dirname "$SCRIPT_DIR")/game}" if [ ! -d "$PROJECT_ROOT" ]; then echo "โŒ Project root not found: $PROJECT_ROOT" echo "Set GODOT_PROJECT_ROOT environment variable" exit 1 fi if [ ! -f "$PROJECT_ROOT/project.godot" ]; then echo "โŒ Not a Godot project: $PROJECT_ROOT" exit 1 fi echo "๐Ÿค– Running Sentinel CI tests..." echo "๐Ÿ“ Project: $PROJECT_ROOT" echo "๐Ÿ”ง Environment: ${CI:-local}" cd "$PROJECT_ROOT" # Ensure gdUnit4 is available if [ ! -d "addons/gdUnit4" ]; then echo "โŒ gdUnit4 not found. Tests cannot run." exit 1 fi # Check if Godot is available if ! command -v godot &> /dev/null; then echo "โŒ Godot not found in PATH" echo "Install Godot 4.3+ or add it to PATH" exit 1 fi # Check Godot version GODOT_VERSION=$(godot --version 2>/dev/null || echo "unknown") echo "๐ŸŽฎ Godot version: $GODOT_VERSION" # Run tests with CI-friendly output echo "๐Ÿงช Executing tests..." # Run gdUnit4 in headless mode with CI optimizations godot --headless \ --no-header \ --quiet \ -s res://addons/gdUnit4/bin/gdUnit4.gd \ -gexit 2>&1 | tee ci_test_output.log TEST_EXIT_CODE=${PIPESTATUS[0]} # Parse test results TOTAL_TESTS=$(grep -o "Running [0-9]* tests" ci_test_output.log | grep -o "[0-9]*" | head -1 || echo "0") PASSED_TESTS=$(grep -o "[0-9]* passed" ci_test_output.log | grep -o "[0-9]*" | head -1 || echo "0") FAILED_TESTS=$(grep -o "[0-9]* failed" ci_test_output.log | grep -o "[0-9]*" | head -1 || echo "0") echo "" echo "๐Ÿ“Š Test Results Summary:" echo " Total: $TOTAL_TESTS" echo " Passed: $PASSED_TESTS" echo " Failed: $FAILED_TESTS" # Generate JUnit XML report if jq is available (for CI integration) if command -v jq &> /dev/null; then echo "๐Ÿ“„ Generating JUnit report..." cat > test-results.xml << EOF <?xml version="1.0" encoding="UTF-8"?> <testsuites> <testsuite name="GodotTests" tests="$TOTAL_TESTS" failures="$FAILED_TESTS" errors="0" time="0"> <!-- Test details would be parsed from gdUnit4 output --> </testsuite> </testsuites> EOF fi # Clean up rm -f ci_test_output.log if [ $TEST_EXIT_CODE -eq 0 ]; then echo "โœ… All CI tests passed!" else echo "โŒ CI tests failed (exit code: $TEST_EXIT_CODE)" fi exit $TEST_EXIT_CODE

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Snack-JPG/Godot-Sentinel-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server