未在AWS Codebuild中工作的测试范围
我有使用TestContainers运行测试的Spring Boot应用程序。所有测试都在本地运行,但是当我尝试在AWS CodeBuild项目中尝试时,它会失败。看起来它无法连接到数据库。 这是我的buildspec.yml文件。
version: 0.2
phases:
install:
runtime-versions:
nodejs: 12
java: corretto11
pre_build:
commands:
- export ROOT_DIR=$PWD
build:
commands:
- echo Starting build at `date`
- cd $ROOT_DIR && ./gradlew integrationTest
运行时,我会遇到以下错误。/gradlewIntegrationTest
UserServiceIT > assertThatResetKeyMustBeValid() FAILED
java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
Caused by: org.springframework.beans.factory.BeanCreationException at AbstractAutowireCapableBeanFactory.java:1786
Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException at HikariPool.java:595
Caused by: java.lang.IllegalStateException at Preconditions.java:174
在每个测试中都高于异常。我尝试过 testContainers_ryuk_disabled = true ,但仍然无法正常工作。
I have spring boot application which uses testcontainers to run tests. All the tests are running locally but when I tried in AWS Codebuild project, it is failing. Looks like it is unable to connect to database.
This is my buildspec.yml file for codebuild.
version: 0.2
phases:
install:
runtime-versions:
nodejs: 12
java: corretto11
pre_build:
commands:
- export ROOT_DIR=$PWD
build:
commands:
- echo Starting build at `date`
- cd $ROOT_DIR && ./gradlew integrationTest
I am getting following error when running ./gradlew integrationTest
UserServiceIT > assertThatResetKeyMustBeValid() FAILED
java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:132
Caused by: org.springframework.beans.factory.BeanCreationException at AbstractAutowireCapableBeanFactory.java:1786
Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException at HikariPool.java:595
Caused by: java.lang.IllegalStateException at Preconditions.java:174
Getting above exception for every test. I have tried TESTCONTAINERS_RYUK_DISABLED=true but still not working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论