首页 > 解决方案 > 使用 Embedded Postgres 进行集成测试

问题描述

我按照此处提到的说明进行操作:https ://medium.com/@valeryyakovlev/embedded-postgres-test-config-ab8e4e0d3256

当我在本地运行时它工作正常,但在 gitlab CI 上构建时会出现以下错误。

            Caused by:
            org.springframework.beans.BeanInstantiationException: Failed to instantiate [ru.yandex.qatools.embed.postgresql.EmbeddedPostgres]: Factory method 'embeddedPostgres' threw exception; nested exception is de.flapdoodle.embed.process.exceptions.DistributionException: java.io.IOException: Could not open inputStream for http://get.enterprisedb.com/postgresql/postgresql-11.1-1-linux-x64-binaries.tar.gz

                Caused by:
                de.flapdoodle.embed.process.exceptions.DistributionException: java.io.IOException: Could not open inputStream for http://get.enterprisedb.com/postgresql/postgresql-11.1-1-linux-x64-binaries.tar.gz

                    Caused by:
                    java.io.IOException: Could not open inputStream for http://get.enterprisedb.com/postgresql/postgresql-11.1-1-linux-x64-binaries.tar.gz

                        Caused by:
                        java.io.IOException: Server returned HTTP response code: 403 for URL: http://get.enterprisedb.com/postgresql/postgresql-11.1-1-linux-x64-binaries.tar.gz

Gradle Test Executor 1 finished executing tests.

我发现一些提到自定义代理的来源:https ://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo#customize-proxy-for-download

它没有帮助。

标签: javapostgresqlspring-bootgitlab-ci

解决方案


推荐阅读