我需要一些关于在GitHub上运行集成测试的步骤的帮助。我的项目需要Neo4j,所以我将neo4j
声明为服务。然而,在运行我的测试项目时,我看到以下错误
Connection with the server breaks due to ExtendedSocketException:
Resource temporarily unavailable Please ensure that your database is listening on the correct
host and port and that you have compatible encryption settings both on Neo4j server and driver.
Note that the default encryption setting has changed in Neo4j 4.0.
字符串
我不确定这个问题是否与我如何指定操作或与Neo4j有关。
这是我的GitHub CI文件:dotnetcore.yml
name: .NET Core
on:
push:
branches: [ master, GithubActions ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
env:
NEO4J_HOST: neo4j
# Service containers to run with `container-job`
services:
# Label used to access the service container
neo4j:
# Docker Hub image
image: neo4j:4.0.1
ports:
- 7474:7474 # used for http
- 7687:7687 # used for bolt
env:
NEO4J_AUTH: neo4j/password
NEO4J_dbms_connector_http_advertised__address: "NEO4J_HOST:7687"
NEO4J_dbms_connector_bolt_advertised__address: "NEO4J_HOST:7687"
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
- name: Install dependencies
run: dotnet restore ./src/BbcCorp.Neo4j.NeoGraphManager.sln
- name: Build
run: dotnet build --configuration Release --no-restore ./src/BbcCorp.Neo4j.NeoGraphManager.sln
- name: Run Integration Tests
env:
NEO4J_SERVER: NEO4J_HOST
run: |
cd ./src/BbcCorp.Neo4j.Tests
docker ps
dotnet test --no-restore --verbosity normal BbcCorp.Neo4j.Tests.csproj
型
我试图连接到:bolt://NEO4J_HOST:7687
,但它只是不连接。
错误详细信息:
Using Neo4j Server NEO4J_HOST:7687 as neo4j/password
Error executing query. Connection with the server breaks due to ExtendedSocketException: Resource temporarily unavailable Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0.
[xUnit.net 00:00:00.83] NeoGraphManagerIntegrationTests.SimpleNodeTests [FAIL]
[xUnit.net 00:00:00.83] Neo4j.Driver.ServiceUnavailableException : Connection with the server breaks due to ExtendedSocketException: Resource temporarily unavailable Please ensure that your database is listening on the correct host and port and that you have compatible encryption settings both on Neo4j server and driver. Note that the default encryption setting has changed in Neo4j 4.0.
[xUnit.net 00:00:00.83] ---- System.Net.Internals.SocketExceptionFactory+ExtendedSocketException : Resource temporarily unavailable
型
C#测试项目的设置文件如下所示
{
"NEO4J_SERVER": "localhost",
"NEO4J_PORT": 7687,
"NEO4J_DB_USER": "neo4j",
"NEO4J_DB_PWD": "password"
}
型
测试在我的本地机器上运行良好,但在GitHub上执行时失败。
1条答案
按热度按时间watbbzwu1#
今天我在为我的开源项目设置github action,在到处搜索之后,我找到了一个适合我的解决方案。
对我来说,这是与此代码在创建服务时,我配置它做测试,这就是我需要它。我希望它可以帮助你。
字符串
如果您仍然有问题,我邀请您查看此出版物,这是另一种方法,但使用auraDB https://neo4j.com/developer-blog/neo4j-integration-tests-github-actions-aura-cli/