Skip to content

Commit 467cf17

Browse files
committed
Make neo4j-graphql#252 less painful, mark not-isolated tests
With this commit you can run ``` npm run test-isolated ``` over and over again and the tests should pass. This does not fix the issue mentioned above but it makes it less painful. At least I can make my changes and run all tests exluding those that are not isolated. When I'm done with my changes I can re-import the data and run all the tests, even those that are not isolated. This is what I did to get all the tests passing on my machine: ``` sudo rm /var/lib/neo4j/data/databases/* -r sudo cp -rp ~/Downloads/temp/neo4j-graphql-js/recommendations.db/ /var/lib/neo4j/data/databases/graph.db sudo systemctl restart neo4j.service ``` Very annoying. @johnymontana @michaeldgraham do you know if there is a single command that brings the database into a state where it was *before* running the test case? Something that we could use in a `beforeEach` or `afterEach`? See: neo4j-graphql#252 (comment)
1 parent f5af6d5 commit 467cf17

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"parse-tck": "babel-node test/helpers/tck/parseTck.js",
1818
"test-tck": "nyc ava --fail-fast test/tck/",
1919
"report-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
20-
"test-all": "nyc ava test/*.js test/neo4j-schema/*Test.js --verbose",
20+
"test-all": "nyc ava test/ --verbose",
21+
"test-isolated": "nyc ava test/ --verbose --match='!*not-isolated*'",
2122
"debug": "nodemon ./example/apollo-server/movies.js --exec babel-node --inspect-brk=9229 --nolazy",
2223
"debug-typedefs": "nodemon ./example/apollo-server/movies-typedefs.js --exec babel-node --inspect-brk=9229 --nolazy",
2324
"debug-interface": "nodemon ./example/apollo-server/interfaceError.js --exec babel-node --inspect-brk=9229 --nolazy"

test/integration.js test/integration/integration.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ test('Handle @cypher directive on QueryType', async t => {
172172
});
173173
});
174174

175-
test('Mutation with @cypher directive', async t => {
175+
test('Mutation with @cypher directive (not-isolated)', async t => {
176176
t.plan(1);
177177

178178
let expected = {
@@ -202,7 +202,7 @@ test('Mutation with @cypher directive', async t => {
202202
});
203203
});
204204

205-
test('Create node mutation', async t => {
205+
test('Create node mutation (not-isolated)', async t => {
206206
t.plan(1);
207207

208208
let expected = {
@@ -279,7 +279,7 @@ test('Update node mutation', async t => {
279279
});
280280
});
281281

282-
test.serial('Add relationship mutation', async t => {
282+
test.serial('Add relationship mutation (not-isolated)', async t => {
283283
t.plan(1);
284284

285285
let expected = {
@@ -348,7 +348,7 @@ test.serial('Add relationship mutation', async t => {
348348
});
349349
});
350350

351-
test.serial('Remove relationship mutation', async t => {
351+
test.serial('Remove relationship mutation (not-isolated)', async t => {
352352
t.plan(1);
353353

354354
await client
@@ -613,7 +613,7 @@ test('query using inine fragment', async t => {
613613
*/
614614

615615
// Temporal node property
616-
test.serial('Temporal - Create node with temporal property', async t => {
616+
test.serial('Temporal - Create node with temporal property (not-isolated)', async t => {
617617
t.plan(1);
618618

619619
let expected = {
@@ -660,7 +660,7 @@ test.serial('Temporal - Create node with temporal property', async t => {
660660
});
661661

662662
test.serial(
663-
'Temporal - Create node with multiple temporal fields and input formats',
663+
'Temporal - Create node with multiple temporal fields and input formats (not-isolated)',
664664
async t => {
665665
t.plan(1);
666666

@@ -727,7 +727,7 @@ test.serial(
727727
);
728728

729729
test.serial(
730-
'Temporal - Create node with multiple temporal fields and input formats - with GraphQL variables',
730+
'Temporal - Create node with multiple temporal fields and input formats - with GraphQL variables (not-isolated)',
731731
async t => {
732732
t.plan(1);
733733

@@ -802,7 +802,7 @@ test.serial(
802802
}
803803
);
804804

805-
test.serial('Temporal - Query node with temporal field', async t => {
805+
test.serial('Temporal - Query node with temporal field (not-isolated)', async t => {
806806
let expected = {
807807
data: {
808808
Movie: [
@@ -881,7 +881,7 @@ test.serial('Temporal - Query node with temporal field', async t => {
881881
});
882882
});
883883

884-
test.serial('Temporal - create node with only a temporal property', async t => {
884+
test.serial('Temporal - create node with only a temporal property (not-isolated)', async t => {
885885
t.plan(1);
886886

887887
let expected = {
@@ -916,7 +916,7 @@ test.serial('Temporal - create node with only a temporal property', async t => {
916916
});
917917
});
918918

919-
test.serial('Temporal - temporal query argument, components', async t => {
919+
test.serial('Temporal - temporal query argument, components (not-isolated)', async t => {
920920
t.plan(1);
921921

922922
let expected = {
@@ -953,7 +953,7 @@ test.serial('Temporal - temporal query argument, components', async t => {
953953
});
954954
});
955955

956-
test.serial('Temporal - temporal query argument, formatted', async t => {
956+
test.serial('Temporal - temporal query argument, formatted (not-isolated)', async t => {
957957
t.plan(1);
958958

959959
let expected = {
@@ -990,7 +990,7 @@ test.serial('Temporal - temporal query argument, formatted', async t => {
990990
});
991991
});
992992

993-
test.serial('Add relationship with temporal property', async t => {
993+
test.serial('Add relationship with temporal property (not-isolated)', async t => {
994994
t.plan(1);
995995

996996
let expected = {
@@ -1031,7 +1031,7 @@ test.serial('Add relationship with temporal property', async t => {
10311031
});
10321032
});
10331033

1034-
test.serial('Query for temporal property on relationship', async t => {
1034+
test.serial('Query for temporal property on relationship (not-isolated)', async t => {
10351035
t.plan(1);
10361036

10371037
let expected = {
File renamed without changes.

0 commit comments

Comments
 (0)