feat(e2e): 使用dev配置和PostgreSQL数据库进行测试
问题: - H2数据库与PostgreSQL存在兼容性差异 - Flyway脚本在H2和PostgreSQL上的执行结果不一致 - 密码哈希验证失败 修复: - 修改后端服务配置:test -> dev - 修改网关服务配置:test -> dev - 使用PostgreSQL数据库(localhost:55432) 优势: - 更接近生产环境 - 避免H2兼容性问题 - 数据库行为一致 - Flyway脚本执行可靠
This commit is contained in:
@@ -101,7 +101,7 @@ async function globalSetup(config: FullConfig) {
|
||||
backendArgs = [
|
||||
'-jar',
|
||||
jarFile,
|
||||
'--spring.profiles.active=test',
|
||||
'--spring.profiles.active=dev',
|
||||
'-Xms256m',
|
||||
'-Xmx512m'
|
||||
];
|
||||
@@ -109,7 +109,7 @@ async function globalSetup(config: FullConfig) {
|
||||
console.log('📦 使用Maven启动后端服务...');
|
||||
console.log(' 提示: 运行 "mvn clean package -DskipTests" 构建JAR文件以获得更快的启动速度');
|
||||
backendCommand = 'mvn';
|
||||
backendArgs = ['spring-boot:run', '-Dspring-boot.run.profiles=test'];
|
||||
backendArgs = ['spring-boot:run', '-Dspring-boot.run.profiles=dev'];
|
||||
}
|
||||
|
||||
console.log(` 目录: ${backendDir}`);
|
||||
@@ -167,7 +167,7 @@ async function globalSetup(config: FullConfig) {
|
||||
gatewayArgs = [
|
||||
'-jar',
|
||||
gatewayJarFile,
|
||||
'--spring.profiles.active=test',
|
||||
'--spring.profiles.active=dev',
|
||||
'-Xms128m',
|
||||
'-Xmx256m'
|
||||
];
|
||||
@@ -175,7 +175,7 @@ async function globalSetup(config: FullConfig) {
|
||||
console.log('🚪 使用Maven启动网关服务...');
|
||||
console.log(' 提示: 运行 "mvn clean package -DskipTests" 构建JAR文件以获得更快的启动速度');
|
||||
gatewayCommand = 'mvn';
|
||||
gatewayArgs = ['spring-boot:run', '-Dspring-boot.run.profiles=test'];
|
||||
gatewayArgs = ['spring-boot:run', '-Dspring-boot.run.profiles=dev'];
|
||||
}
|
||||
|
||||
console.log(` 目录: ${gatewayDir}`);
|
||||
@@ -186,7 +186,7 @@ async function globalSetup(config: FullConfig) {
|
||||
stdio: 'pipe',
|
||||
shell: true,
|
||||
detached: false,
|
||||
env: { ...process.env, SPRING_PROFILES_ACTIVE: 'test' }
|
||||
env: { ...process.env, SPRING_PROFILES_ACTIVE: 'dev' }
|
||||
});
|
||||
|
||||
if (gatewayProcess.stdout) {
|
||||
|
||||
Reference in New Issue
Block a user