Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed slow Neo4j tests #4974

Merged
merged 2 commits into from
Apr 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

namespace HotChocolate.Data.Neo4J.Filtering;

[Collection("Database")]
public class Neo4JBooleanFilterTests
: IClassFixture<Neo4JFixture>
{
private readonly Neo4JFixture _fixture;

Expand All @@ -16,30 +16,30 @@ public Neo4JBooleanFilterTests(Neo4JFixture fixture)
}

private readonly string _fooEntitiesCypher =
@"CREATE (:Foo {Bar: true}), (:Foo {Bar: false})";
@"CREATE (:FooBool {Bar: true}), (:FooBool {Bar: false})";
private readonly string _fooEntitiesNullableCypher =
@"CREATE
(:FooNullable {Bar: true}),
(:FooNullable {Bar: false}),
(:FooNullable {Bar: NULL})";
(:FooBoolNullable {Bar: true}),
(:FooBoolNullable {Bar: false}),
(:FooBoolNullable {Bar: NULL})";

public class Foo
public class FooBool
{
public bool Bar { get; set; }
}

public class FooNullable
public class FooBoolNullable
{
public bool? Bar { get; set; }
}

public class FooFilterType
: FilterInputType<Foo>
public class FooBoolFilterType
: FilterInputType<FooBool>
{
}

public class FooNullableFilterType
: FilterInputType<FooNullable>
public class FooBoolNullableFilterType
: FilterInputType<FooBoolNullable>
{
}

Expand All @@ -48,7 +48,7 @@ public async Task Create_BooleanEqual_Expression()
{
// arrange
IRequestExecutor tester =
await _fixture.GetOrCreateSchema<Foo, FooFilterType>(_fooEntitiesCypher);
await _fixture.GetOrCreateSchema<FooBool, FooBoolFilterType>(_fooEntitiesCypher);

// act
const string query1 = "{ root(where: { bar: { eq: true}}){ bar }}";
Expand All @@ -73,7 +73,7 @@ public async Task Create_And_BooleanEqual_Expression()
{
// arrange
IRequestExecutor tester =
await _fixture.GetOrCreateSchema<Foo, FooFilterType>(_fooEntitiesCypher);
await _fixture.GetOrCreateSchema<FooBool, FooBoolFilterType>(_fooEntitiesCypher);

// act
const string query1 =
Expand All @@ -92,7 +92,7 @@ public async Task Create_Or_BooleanEqual_Expression()
{
// arrange
IRequestExecutor tester =
await _fixture.GetOrCreateSchema<Foo, FooFilterType>(_fooEntitiesCypher);
await _fixture.GetOrCreateSchema<FooBool, FooBoolFilterType>(_fooEntitiesCypher);

// act
const string query1 =
Expand All @@ -111,7 +111,7 @@ public async Task Create_BooleanNotEqual_Expression()
{
// arrange
IRequestExecutor tester =
await _fixture.GetOrCreateSchema<Foo, FooFilterType>(_fooEntitiesCypher);
await _fixture.GetOrCreateSchema<FooBool, FooBoolFilterType>(_fooEntitiesCypher);

// act
const string query1 = "{ root(where: { bar: { neq: true}}){ bar}}";
Expand All @@ -136,7 +136,7 @@ public async Task Create_NullableBooleanEqual_Expression()
{
// arrange
IRequestExecutor tester =
await _fixture.GetOrCreateSchema<FooNullable, FooNullableFilterType>(
await _fixture.GetOrCreateSchema<FooBoolNullable, FooBoolNullableFilterType>(
_fooEntitiesNullableCypher);

// act
Expand Down Expand Up @@ -169,7 +169,7 @@ public async Task Create_NullableBooleanNotEqual_Expression()
{
// arrange
IRequestExecutor tester =
await _fixture.GetOrCreateSchema<FooNullable, FooNullableFilterType>(
await _fixture.GetOrCreateSchema<FooBoolNullable, FooBoolNullableFilterType>(
_fooEntitiesNullableCypher);

// act
Expand All @@ -196,4 +196,4 @@ public async Task Create_NullableBooleanNotEqual_Expression()
res2.MatchDocumentSnapshot("false");
res3.MatchDocumentSnapshot("null");
}
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (foo:Foo) WHERE (foo.Bar = True AND foo.Bar = False) RETURN foo {.Bar}
MATCH (fooBool:FooBool) WHERE (fooBool.Bar = True AND fooBool.Bar = False) RETURN fooBool {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (foo:Foo) WHERE foo.Bar = False RETURN foo {.Bar}
MATCH (fooBool:FooBool) WHERE fooBool.Bar = False RETURN fooBool {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (foo:Foo) WHERE foo.Bar = True RETURN foo {.Bar}
MATCH (fooBool:FooBool) WHERE fooBool.Bar = True RETURN fooBool {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (foo:Foo) WHERE foo.Bar <> False RETURN foo {.Bar}
MATCH (fooBool:FooBool) WHERE fooBool.Bar <> False RETURN fooBool {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (foo:Foo) WHERE foo.Bar <> True RETURN foo {.Bar}
MATCH (fooBool:FooBool) WHERE fooBool.Bar <> True RETURN fooBool {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (fooNullable:FooNullable) WHERE fooNullable.Bar = False RETURN fooNullable {.Bar}
MATCH (fooBoolNullable:FooBoolNullable) WHERE fooBoolNullable.Bar = False RETURN fooBoolNullable {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (fooNullable:FooNullable) WHERE fooNullable.Bar = NULL RETURN fooNullable {.Bar}
MATCH (fooBoolNullable:FooBoolNullable) WHERE fooBoolNullable.Bar = NULL RETURN fooBoolNullable {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (fooNullable:FooNullable) WHERE fooNullable.Bar = True RETURN fooNullable {.Bar}
MATCH (fooBoolNullable:FooBoolNullable) WHERE fooBoolNullable.Bar = True RETURN fooBoolNullable {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (fooNullable:FooNullable) WHERE fooNullable.Bar <> False RETURN fooNullable {.Bar}
MATCH (fooBoolNullable:FooBoolNullable) WHERE fooBoolNullable.Bar <> False RETURN fooBoolNullable {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (fooNullable:FooNullable) WHERE fooNullable.Bar <> NULL RETURN fooNullable {.Bar}
MATCH (fooBoolNullable:FooBoolNullable) WHERE fooBoolNullable.Bar <> NULL RETURN fooBoolNullable {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (fooNullable:FooNullable) WHERE fooNullable.Bar <> True RETURN fooNullable {.Bar}
MATCH (fooBoolNullable:FooBoolNullable) WHERE fooBoolNullable.Bar <> True RETURN fooBoolNullable {.Bar}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MATCH (foo:Foo) WHERE (foo.Bar = True OR foo.Bar = False) RETURN foo {.Bar}
MATCH (fooBool:FooBool) WHERE (fooBool.Bar = True OR fooBool.Bar = False) RETURN fooBool {.Bar}