mattermost/server/public/pluginapi/grpc/scripts/run_integration_tests.sh
Nick Misasi 926b6f3483 chore(10-02): add CI-friendly integration test runner scripts
Create shell scripts for consistent test invocation across CI environments:

Python script (python-sdk/scripts/run_integration_tests.sh):
- Auto-detects virtual environment or uses system Python
- Installs package in editable mode if not present
- Runs test_integration_e2e.py with verbose output
- Supports passing extra pytest arguments

Go script (server/public/pluginapi/grpc/scripts/run_integration_tests.sh):
- Runs from the correct module directory
- Filters to TestPythonPlugin and TestIntegration tests
- Disables test caching for clean CI runs
- Supports passing extra go test arguments

Both scripts:
- Are executable (chmod +x)
- Print diagnostic information (working dir, version)
- Exit with appropriate error codes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 15:36:57 -05:00

36 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
# See LICENSE.txt for license information.
# CI-friendly script for running Go integration tests.
# This script provides consistent test invocation across environments.
#
# Usage:
# ./scripts/run_integration_tests.sh
# ./scripts/run_integration_tests.sh -race # Pass extra args to go test
set -e
# Navigate to the server/public directory (module root)
cd "$(dirname "$0")/../.."
echo "Running Go integration tests..."
echo "Working directory: $(pwd)"
# Verify Go is available
if ! command -v go &> /dev/null; then
echo "ERROR: Go not found. Please install Go 1.21+."
exit 1
fi
echo "Go version: $(go version)"
# Run integration tests
# -v: verbose output
# -run: filter to integration tests
# -count=1: disable test caching for clean runs
# Extra arguments passed to this script are forwarded to go test
echo "Executing: go test -v -run \"TestPythonPlugin|TestIntegration\" ./pluginapi/grpc/server/... -count=1 $@"
go test -v -run "TestPythonPlugin|TestIntegration" ./pluginapi/grpc/server/... -count=1 "$@"
echo "Integration tests completed successfully."