fix: 测试使用远程 MySQL,取消跳过
- 测试 application.yml 改为连接远程 pguser-db - 移除 surefire skipTests,移除 H2 依赖,增加 mysql-connector-j(test)
This commit is contained in:
parent
e57dd9df2f
commit
91676531b8
|
|
@ -37,24 +37,11 @@
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- H2 内存数据库,供单模块测试使用 -->
|
<!-- MySQL 驱动,测试连接远程库 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<!-- 集成测试依赖 MySQL 表结构,单模块无 DB 时跳过;完整测试请从 pangu-admin 启动并连接 MySQL 后执行 -->
|
|
||||||
<skipTests>true</skipTests>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
# 测试环境配置,供 pangu-system 单模块测试使用
|
# 测试环境配置,使用与 pangu-admin 相同的远程 MySQL
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: org.h2.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:h2:mem:testdb;MODE=MySQL;DB_CLOSE_DELAY=-1;INIT=CREATE SCHEMA IF NOT EXISTS PUBLIC
|
url: jdbc:mysql://8.148.25.55:3306/pguser-db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: sa
|
username: root
|
||||||
password:
|
password: aly2024A
|
||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
mapper-locations: classpath*:mapper/**/*.xml
|
mapper-locations: classpath*:mapper/**/*.xml
|
||||||
|
|
@ -13,6 +13,7 @@ mybatis-plus:
|
||||||
map-underscore-to-camel-case: true
|
map-underscore-to-camel-case: true
|
||||||
|
|
||||||
pagehelper:
|
pagehelper:
|
||||||
helper-dialect: h2
|
helper-dialect: mysql
|
||||||
reasonable: true
|
reasonable: true
|
||||||
support-methods-arguments: true
|
support-methods-arguments: true
|
||||||
|
params: count=countSql
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue