GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — mcpproxy-go/scripts/run-e2e-tests.sh at main · DocSpring/mcpproxy-go Expand file tree/ Copy pathrun-e2e-tests.shMore file actions executable file ·102 lines (86 loc) · 2.78 KB / Copy pathrun-e2e-tests.shFile metadata and controlsexecutable file ·102 lines (86 loc) · 2.78 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 #!/bin/bash set -e # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Configuration TEST_TIMEOUT=${TEST_TIMEOUT:-"5m"} VERBOSE=${VERBOSE:-"true"} RACE=${RACE:-"true"} COVER=${COVER:-"false"} echo -e "${GREEN}Running MCP Proxy E2E Tests${NC}" echo "==================================" # Check if Go is installed if ! command -v go &> /dev/null; then echo -e "${RED}Error: Go is not installed${NC}" exit 1 fi echo -e "${YELLOW}Go version:${NC} $(go version)" echo -e "${YELLOW}Test timeout:${NC} $TEST_TIMEOUT" echo -e "${YELLOW}Race detection:${NC} $RACE" echo -e "${YELLOW}Coverage:${NC} $COVER" echo "" # Build the binary first to ensure everything compiles echo -e "${YELLOW}Building mcpproxy binary...${NC}" go build -o mcpproxy ./cmd/mcpproxy if [ $? -eq 0 ]; then echo -e "${GREEN}✓ Build successful${NC}" export MCPPROXY_BINARY_PATH="$(pwd)/mcpproxy" export MCPPROXY_BINARY="$MCPPROXY_BINARY_PATH" else echo -e "${RED}✗ Build failed${NC}" exit 1 fi # Prepare test arguments TEST_ARGS="-v -timeout $TEST_TIMEOUT" if [ "$RACE" = "true" ]; then TEST_ARGS="$TEST_ARGS -race" fi if [ "$COVER" = "true" ]; then TEST_ARGS="$TEST_ARGS -coverprofile=coverage.out -covermode=atomic" fi # Run unit tests first (excluding E2E, Binary, and MCP tests) echo -e "${YELLOW}Running unit tests...${NC}" go test $TEST_ARGS ./internal/... -skip "^Test(E2E_|Binary|MCPProtocol)" if [ $? -eq 0 ]; then echo -e "${GREEN}✓ Unit tests passed${NC}" else echo -e "${RED}✗ Unit tests failed${NC}" exit 1 fi echo "" # Run E2E tests (without race detector to avoid false positives from async operations) echo -e "${YELLOW}Running E2E tests...${NC}" E2E_TEST_ARGS="-v -timeout $TEST_TIMEOUT" if [ "$COVER" = "true" ]; then E2E_TEST_ARGS="$E2E_TEST_ARGS -coverprofile=coverage.out -covermode=atomic" fi go test $E2E_TEST_ARGS ./internal/server -run TestE2E E2E_EXIT_CODE=$? if [ $E2E_EXIT_CODE -eq 0 ]; then echo -e "${GREEN}✓ E2E tests passed${NC}" else echo -e "${RED}✗ E2E tests failed${NC}" fi # Generate coverage report if enabled if [ "$COVER" = "true" ] && [ -f coverage.out ]; then echo -e "${YELLOW}Generating coverage report...${NC}" go tool cover -html=coverage.out -o coverage.html echo -e "${GREEN}Coverage report generated: coverage.html${NC}" # Show coverage summary go tool cover -func=coverage.out | tail -1 fi # Cleanup echo -e "${YELLOW}Cleaning up...${NC}" # Note: Don't delete mcpproxy binary here - it's needed by other test stages # The main test script (run-all-tests.sh) will handle final cleanup rm -f coverage.out if [ $E2E_EXIT_CODE -eq 0 ]; then echo -e "${GREEN}All tests completed successfully!${NC}" exit 0 else echo -e "${RED}Some tests failed${NC}" exit 1 fi |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |