final version
This commit is contained in:
@@ -43,7 +43,7 @@ python tests/run_tests.py --all --verbose
|
||||
export TEST_API_KEY="your-test-api-key"
|
||||
|
||||
# 测试基础URL
|
||||
export TEST_BASE_URL="http://localhost:8000"
|
||||
export TEST_BASE_URL="http://localhost:8001"
|
||||
|
||||
# 测试超时时间(秒)
|
||||
export TEST_TIMEOUT=30
|
||||
|
||||
@@ -13,7 +13,7 @@ class IntegrationTestConfig:
|
||||
|
||||
def __init__(self):
|
||||
# 基础URL配置
|
||||
self.base_url = os.getenv('TEST_BASE_URL', 'http://localhost:8000')
|
||||
self.base_url = os.getenv('TEST_BASE_URL', 'http://localhost:8001')
|
||||
self.api_version = '/api/v1'
|
||||
|
||||
# 认证配置
|
||||
@@ -29,7 +29,7 @@ class IntegrationTestConfig:
|
||||
self.delay_between_retries = float(os.getenv('TEST_DELAY_BETWEEN_RETRIES', '1.0'))
|
||||
|
||||
# 服务配置
|
||||
self.backend_port = int(os.getenv('BACKEND_PORT', '8000'))
|
||||
self.backend_port = int(os.getenv('BACKEND_PORT', '8001'))
|
||||
self.frontend_port = int(os.getenv('FRONTEND_PORT', '3000'))
|
||||
self.db_host = os.getenv('DB_HOST', 'localhost')
|
||||
self.db_port = int(os.getenv('DB_PORT', '5432'))
|
||||
@@ -137,7 +137,7 @@ class TestEnvironment:
|
||||
"""获取特定环境的配置"""
|
||||
configs = {
|
||||
TestEnvironment.LOCAL: {
|
||||
'base_url': 'http://localhost:8000',
|
||||
'base_url': 'http://localhost:8001',
|
||||
'db_url': 'postgresql://user:password@localhost:5432/test_db',
|
||||
'redis_url': 'redis://localhost:6379/0',
|
||||
'minio_url': 'http://localhost:9000'
|
||||
@@ -149,7 +149,7 @@ class TestEnvironment:
|
||||
'minio_url': 'http://minio:9000'
|
||||
},
|
||||
TestEnvironment.CI_CD: {
|
||||
'base_url': os.getenv('TEST_BASE_URL', 'http://localhost:8000'),
|
||||
'base_url': os.getenv('TEST_BASE_URL', 'http://localhost:8001'),
|
||||
'db_url': os.getenv('TEST_DB_URL', 'postgresql://user:password@localhost:5432/test_db'),
|
||||
'redis_url': os.getenv('TEST_REDIS_URL', 'redis://localhost:6379/0'),
|
||||
'minio_url': os.getenv('TEST_MINIO_URL', 'http://localhost:9000')
|
||||
|
||||
@@ -35,7 +35,7 @@ class IntegrationTestBase(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""在所有测试开始前设置"""
|
||||
cls.base_url = os.getenv('TEST_BASE_URL', 'http://localhost:8000')
|
||||
cls.base_url = os.getenv('TEST_BASE_URL', 'http://localhost:8001')
|
||||
cls.api_key = os.getenv('TEST_API_KEY', 'test-key-12345')
|
||||
cls.headers = {
|
||||
'Authorization': f'Bearer {cls.api_key}',
|
||||
|
||||
Reference in New Issue
Block a user