Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Add CONTRIBUTING.md #243

Closed
wants to merge 1 commit into from
Closed

Conversation

roschaefer
Copy link
Contributor

I'm trying to contribute a fix for #239

When I am about to contribute to a software library, the first thing I do is to
look for software tests and run them. Unfortunately, there is no documentation
how to setup tests.

What I did:

  • npm install - intuitive
  • I checked package.json - aha, there is npm run test and npm run test-all
  • When I run npm run test-all all the integration tests fail. Anything
    missing? Checking CircleCI https://circleci.com/gh/neo4j-graphql/neo4j-graphql-js/3519
    reveals I have to node -r babel-register ./example/apollo-server/movies-middleware.js
  • Scrolling down reveals npm run parse-tck 😦
  • And finally ./node_modules/.bin/nyc ./node_modules/.bin/ava test/*.js test/neo4j-schema/*Test.js

Ok, so first suggestion: I would expect all the above instruction to go into
CONTRIBUTING.md. Alternatively it should be in README.md in a section
Contributing. I checked the other projects of neo4j here is what I discovered:

The following repos of neo4j use the exact same CONTRIBUTING.md:

So that's why I decided to commit the same file to the repository. I find the
link to the neo4j-users slack helpful but the rest of it is pretty generic and
does not explain how to setup tests. So where does that information go?

Next up: Why are your npm scripts different from what you use on CircleCI? For
me the build server is the single source of truth. It confuses me that CircleCI
uses a different set of tests than your npm run test-all for example. Are all
the tests supposed to pass, after all? On my machine, plenty of integration
tests fail and I'm confused if they might be expected to fail.

So, dear contributors, @johnymontana and @michaeldgraham how do I setup tests?

Cheers,
Robert

I'm trying to contribute a fix for https://github.com/neo4j-graphql/neo4j-graphql-js

When I am about to contribute to a software library, the first thing I do is to
look for software tests and run them. Unfortunately, there is no documentation
how to setup tests.

What I did:

* `npm install` - intuitive
* I checked `package.json` - aha, there is `npm run test` and `npm run test-all`
* When I run `npm run test-all` all the integration tests fail. Anything
  missing? Checking CircleCI https://circleci.com/gh/neo4j-graphql/neo4j-graphql-js/3519
  reveals I have to `node -r babel-register ./example/apollo-server/movies-middleware.js`
* Scrolling down reveals `npm run parse-tck` 😦
* And finally `./node_modules/.bin/nyc ./node_modules/.bin/ava test/*.js test/neo4j-schema/*Test.js`

Ok, so first suggestion: I would expect all the above instruction to go into
`CONTRIBUTING.md`. Alternatively it should be in `README.md` in a section
`Contributing`. I checked the other projects of neo4j here is what I discovered:

The following repos of `neo4j` use the exact same `CONTRIBUTING.md`:
* https://github.com/neo4j/neo4j/blob/3.5/CONTRIBUTING.md
* https://github.com/neo4j/neo4j-java-driver/blob/2.0/CONTRIBUTING.md
* https://github.com/neo4j/neo4j-javascript-driver/blob/1.7/CONTRIBUTING.md
* https://github.com/neo4j/neo4j-go-driver/blob/1.7/CONTRIBUTING.md

So that's why I decided to commit the same file to the repository. I find the
link to the neo4j-users slack helpful but the rest of it is pretty generic and
does not explain how to setup tests. So where does that information go?

Next up: Why are your `npm` scripts different from what you use on CircleCI? For
me the build server is the single source of truth. It confuses me that CircleCI
uses a different set of tests than your `npm run test-all` for example. Are all
the tests supposed to pass, after all? On my machine, plenty of integration
tests fail and I'm confused if they might be expected to fail.

So, dear contributors, @johnymontana and @#2michaeldgraham how do I setup tests?

Cheers,
Robert
@codecov-io
Copy link

codecov-io commented May 14, 2019

Codecov Report

Merging #243 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #243   +/-   ##
=======================================
  Coverage   94.47%   94.47%           
=======================================
  Files           4        4           
  Lines         326      326           
=======================================
  Hits          308      308           
  Misses         18       18

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af92564...536a3ab. Read the comment docs.

@roschaefer
Copy link
Contributor Author

roschaefer commented May 14, 2019

For the record, here are my specs:

$ uname -a
Linux e480 5.0.13-arch1-1-ARCH #1 SMP PREEMPT Sun May 5 18:05:41 UTC 2019 x86_64 GNU/Linux
$ java -version
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b01)
OpenJDK 64-Bit Server VM (build 25.212-b01, mixed mode)
$ neo4j version
Error: Could not find or load main class org.neo4j.server.CommunityEntryPoint
# interesting, but https://aur.archlinux.org/packages/neo4j-community/ tells me I'm on version 3.5.3-1
$ node --version
v10.15.1
$ npm --version
6.9.0
$ git rev-parse HEAD
536a3abbfe9939523172cc5f85c06a389c6baf7d

@roschaefer
Copy link
Contributor Author

roschaefer commented May 14, 2019

When I run the commands from circleci (single source of truth):

  1. node -r babel-register ./example/apollo-server/movies-middleware.js
  2. ./node_modules/.bin/nyc ./node_modules/.bin/ava test/*.js test/neo4j-schema/*Test.js
Terminal output
Initializing your Neo4j Schema
This may take a few moments depending on the size of your DB
Initializing your Neo4j Schema
This may take a few moments depending on the size of your DB
Initializing your Neo4j Schema
This may take a few moments depending on the size of your DB
Relationship :BUYS has no properties and does not need to be generated
Relationship :LIVES_IN has no properties and does not need to be generated
type Customer {
   _id: Long!
   age: Integer
   name: String!
   buys: [Product] @relation(name: "BUYS", direction: "OUT")
   reviewed: [Product] @relation(name: "REVIEWED", direction: "OUT")
   REVIEWED_rel: [REVIEWED]
   lives_in: [State] @relation(name: "LIVES_IN", direction: "OUT")
}

type Product {
   _id: Long!
   sku: String!
   customers_buys: [Customer] @relation(name: "BUYS", direction: "IN")
   customers_reviewed: [Customer] @relation(name: "REVIEWED", direction: "IN")
}

type State {
   _id: Long!
   name: String!
   customers: [Customer] @relation(name: "LIVES_IN", direction: "IN")
}


type REVIEWED @relation(name: "REVIEWED") {
  from: Customer!
  to: Product!
  stars: Integer
}




type Customer {
   _id: Long!
   age: Integer
   name: String!
   buys: [Product] @relation(name: "BUYS", direction: "OUT")
   reviewed: [Product] @relation(name: "REVIEWED", direction: "OUT")
   REVIEWED_rel: [REVIEWED]
   lives_in: [State] @relation(name: "LIVES_IN", direction: "OUT")
}

type Product {
   _id: Long!
   sku: String!
   customers_buys: [Customer] @relation(name: "BUYS", direction: "IN")
   customers_reviewed: [Customer] @relation(name: "REVIEWED", direction: "IN")
}

type State {
   _id: Long!
   name: String!
   customers: [Customer] @relation(name: "LIVES_IN", direction: "IN")
}


type REVIEWED @relation(name: "REVIEWED") {
  from: Customer!
  to: Product!
  stars: Integer
}





  203 passed
  21 failed

  integration › Add relationship mutation

  /home/robert/Development/neo4j-graphql-js/test/integration.js:347

   346:     .catch(error => {
   347:       t.fail(error);
   348:     });

  TypeError: Cannot read property 'from' of null



  integration › Remove relationship mutation

  /home/robert/Development/neo4j-graphql-js/test/integration.js:387

   386:     .catch(error => {
   387:       t.fail(error);
   388:     });

  TypeError: Cannot read property 'from' of null



  integration › Temporal - Query node with temporal field

  /home/robert/Development/neo4j-graphql-js/test/integration.js:877

   876:     .then(data => {
   877:       t.deepEqual(data.data, expected.data);
   878:     })

  Difference:

    {
      Movie: [
        Object { … },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
  -     {
  -       __typename: 'Movie',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2010-01-02',
  -       },
  -       dateTime: {
  -         __typename: '_Neo4jDateTime',
  -         day: 2,
  -         hour: 0,
  -         millisecond: 0,
  -         minute: 0,
  -         month: 1,
  -         nanosecond: 0,
  -         second: 0,
  -         timezone: 'Z',
  -         year: 2010,
  -       },
  -       localDateTime: {
  -         __typename: '_Neo4jLocalDateTime',
  -         day: 2,
  -         formatted: '2010-01-02T00:00:00',
  -         hour: 0,
  -         minute: 0,
  -         month: 1,
  -         second: 0,
  -         year: 2010,
  -       },
  -       title: 'Bob Loblaw 3',
  -     },
      ],
    }



  integration › Temporal - temporal query argument, components

  /home/robert/Development/neo4j-graphql-js/test/integration.js:949

   948:     .then(data => {
   949:       t.deepEqual(data.data, expected.data);
   950:     })

  Difference:

    {
      OnlyDate: [
        Object { … },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
      ],
    }



  integration › Temporal - temporal query argument, formatted

  /home/robert/Development/neo4j-graphql-js/test/integration.js:986

   985:     .then(data => {
   986:       t.deepEqual(data.data, expected.data);
   987:     })

  Difference:

    {
      OnlyDate: [
        Object { … },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
  -     {
  -       __typename: 'OnlyDate',
  -       date: {
  -         __typename: '_Neo4jDate',
  -         formatted: '2020-11-10',
  -       },
  -     },
      ],
    }



  integration › Add relationship with temporal property

  /home/robert/Development/neo4j-graphql-js/test/integration.js:1027

   1026:     .then(data => {
   1027:       t.deepEqual(data, expected);
   1028:     })

  Difference:

    {
      data: {
  -     AddMovieRatings: null,
  +     AddMovieRatings: {
  +       __typename: '_AddMovieRatingsPayload',
  +       date: {
  +         __typename: '_Neo4jDate',
  +         formatted: '2018-12-18',
  +       },
  +       rating: 5,
  +     },
      },
    }



  integration › Query for temporal property on relationship

  /home/robert/Development/neo4j-graphql-js/test/integration.js:1075

   1074:     .then(data => {
   1075:       t.deepEqual(data.data, expected.data);
   1076:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       ratings: [
  +         {
  +           __typename: '_MovieRatings',
  +           date: {
  +             __typename: '_Neo4jDate',
  +             formatted: '2018-12-18',
  +           },
  +           rating: 5,
  +         },
  +       ],
  +       title: 'Fire',
  +     },
      ],
    }



  integration › Handle @cypher directive on QueryType

  /home/robert/Development/neo4j-graphql-js/test/integration.js:168

   167:     .then(data => {
   168:       t.deepEqual(data.data, expected.data);
   169:     })

  Difference:

    {
      GenresBySubstring: [
  +     {
  +       __typename: 'Genre',
  +       movies: [
  +         {
  +           __typename: 'Movie',
  +           title: 'Boxtrolls, The',
  +         },
  +         {
  +           __typename: 'Movie',
  +           title: 'Challenge to Lassie',
  +         },
  +         {
  +           __typename: 'Movie',
  +           title: 'Maleficent',
  +         },
  +       ],
  +       name: 'Children',
  +     },
      ],
    }



  integration › Basic filter

  /home/robert/Development/neo4j-graphql-js/test/integration.js:1131

   1130:     .then(data => {
   1131:       t.deepEqual(data.data, expected.data);
   1132:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       title: '20,000 Leagues Under the Sea',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Billy Blazes, Esq.',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Birth of a Nation, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Dog\'s Life, A',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Immigrant, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Intolerance: Love\'s Struggle Throughout the Ages',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Trip to the Moon, A (Voyage dans la lune, Le)',
  +     },
      ],
    }



  integration › query using inine fragment

  /home/robert/Development/neo4j-graphql-js/test/integration.js:607

   606:     .catch(error => {
   607:       t.fail(error);
   608:     });

  TypeError: Cannot read property 'ratings' of undefined



  integration › basic GraphQL query

  /home/robert/Development/neo4j-graphql-js/test/integration.js:49

   48:     .then(data => {
   49:       t.deepEqual(data.data, expected.data);
   50:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       title: 'River Runs Through It, A',
  +     },
      ],
    }



  integration › Filter with nested AND and OR

  /home/robert/Development/neo4j-graphql-js/test/integration.js:1543

   1542:     .then(data => {
   1543:       t.deepEqual(data.data, expected.data);
   1544:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Sci-Fi',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Adventure',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Action',
  +         },
  +       ],
  +       title: '20,000 Leagues Under the Sea',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Sci-Fi',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Babylon 5: The River of Souls',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Western',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Comedy',
  +         },
  +       ],
  +       title: 'Billy Blazes, Esq.',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'War',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Birth of a Nation, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Adventure',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'War',
  +         },
  +       ],
  +       title: 'Bridge on the River Kwai, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Crime',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Mystery',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Thriller',
  +         },
  +       ],
  +       title: 'Crimson Rivers, The (Rivières pourpres, Les)',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Comedy',
  +         },
  +       ],
  +       title: 'Dog\'s Life, A',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Frozen River',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Comedy',
  +         },
  +       ],
  +       title: 'Immigrant, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Intolerance: Love\'s Struggle Throughout the Ages',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Western',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Romance',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Man from Snowy River, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Mystery',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Crime',
  +         },
  +       ],
  +       title: 'Mystic River',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Western',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Adventure',
  +         },
  +       ],
  +       title: 'Return to Snowy River (a.k.a. The Man From Snowy River II)',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'River Runs Through It, A',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Crime',
  +         },
  +       ],
  +       title: 'River\'s Edge',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'River, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Action',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Adventure',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Fantasy',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Sci-Fi',
  +         },
  +       ],
  +       title: 'Trip to the Moon, A (Voyage dans la lune, Le)',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Romance',
  +         },
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Wild River',
  +     },
      ],
    }



  integration › GraphQL query with @cypher directive

  /home/robert/Development/neo4j-graphql-js/test/integration.js:119

   118:     .then(data => {
   119:       t.deepEqual(data.data, expected.data);
   120:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       actors: [
  +         {
  +           __typename: 'Actor',
  +           name: ' Tom Skerritt',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Brad Pitt',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Brenda Blethyn',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: 'Craig Sheffer',
  +         },
  +       ],
  +       similar: [
  +         {
  +           __typename: 'Movie',
  +           title: 'Dracula Untold',
  +         },
  +         {
  +           __typename: 'Movie',
  +           title: 'Captive, The',
  +         },
  +         {
  +           __typename: 'Movie',
  +           title: 'Helter Skelter',
  +         },
  +       ],
  +       title: 'River Runs Through It, A',
  +     },
      ],
    }



  integration › Filter in selection

  /home/robert/Development/neo4j-graphql-js/test/integration.js:1742

   1741:     .then(data => {
   1742:       t.deepEqual(data.data, expected.data);
   1743:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       genres: [],
  +       title: '20,000 Leagues Under the Sea',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Babylon 5: The River of Souls',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [],
  +       title: 'Billy Blazes, Esq.',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Birth of a Nation, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Bridge on the River Kwai, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Crimson Rivers, The (Rivières pourpres, Les)',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [],
  +       title: 'Dog\'s Life, A',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Frozen River',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [],
  +       title: 'Immigrant, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Intolerance: Love\'s Struggle Throughout the Ages',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Man from Snowy River, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Mystic River',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Return to Snowy River (a.k.a. The Man From Snowy River II)',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'River Runs Through It, A',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'River\'s Edge',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'River, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [],
  +       title: 'Trip to the Moon, A (Voyage dans la lune, Le)',
  +     },
  +     {
  +       __typename: 'Movie',
  +       genres: [
  +         {
  +           __typename: 'Genre',
  +           name: 'Drama',
  +         },
  +       ],
  +       title: 'Wild River',
  +     },
      ],
    }



  integration › Update node mutation

  /home/robert/Development/neo4j-graphql-js/test/integration.js:275

   274:     .then(data => {
   275:       t.deepEqual(data.data, expected.data);
   276:     })

  Difference:

    {
  -   UpdateMovie: null,
  +   UpdateMovie: Object { … },
    }



  integration › Filter with OR

  /home/robert/Development/neo4j-graphql-js/test/integration.js:1235

   1234:     .then(data => {
   1235:       t.deepEqual(data.data, expected.data);
   1236:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       title: '20,000 Leagues Under the Sea',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Billy Blazes, Esq.',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Birth of a Nation, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Dog\'s Life, A',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Immigrant, The',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Intolerance: Love\'s Struggle Throughout the Ages',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'River Runs Through It, A',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Trip to the Moon, A (Voyage dans la lune, Le)',
  +     },
      ],
    }



  integration › Top level orderBy

  /home/robert/Development/neo4j-graphql-js/test/integration.js:508

   507:     .then(data => {
   508:       t.deepEqual(data.data, expected.data);
   509:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       actors: [
  +         {
  +           __typename: 'Actor',
  +           name: 'Channing Tatum',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Jenna Dewan Tatum',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Justin Long',
  +         },
  +       ],
  +       title: '10 Years',
  +     },
  +     {
  +       __typename: 'Movie',
  +       actors: [
  +         {
  +           __typename: 'Actor',
  +           name: ' Nick Swardson',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: 'Jesse Eisenberg',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Aziz Ansari',
  +         },
  +       ],
  +       title: '30 Minutes or Less',
  +     },
  +     {
  +       __typename: 'Movie',
  +       actors: [
  +         {
  +           __typename: 'Actor',
  +           name: 'Joseph Gordon-Levitt',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Seth Rogen',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Anna Kendrick',
  +         },
  +       ],
  +       title: '50/50',
  +     },
      ],
    }



  integration › query relationship property data

  /home/robert/Development/neo4j-graphql-js/test/integration.js:564

   563:     .then(data => {
   564:       t.deepEqual(data.data, expected.data);
   565:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       ratings: [
  +         {
  +           User: {
  +             __typename: 'User',
  +             name: 'Dylan Rich',
  +           },
  +           __typename: '_MovieRatings',
  +           rating: 4.5,
  +         },
  +         {
  +           User: {
  +             __typename: 'User',
  +             name: 'Ashley Smith',
  +           },
  +           __typename: '_MovieRatings',
  +           rating: 2,
  +         },
  +       ],
  +       title: 'It',
  +     },
      ],
    }



  integration › Filter with AND

  /home/robert/Development/neo4j-graphql-js/test/integration.js:1170

   1169:     .then(data => {
   1170:       t.deepEqual(data.data, expected.data);
   1171:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       title: 'Billy Blazes, Esq.',
  +     },
  +     {
  +       __typename: 'Movie',
  +       title: 'Birth of a Nation, The',
  +     },
      ],
    }



  integration › Nested filter

  /home/robert/Development/neo4j-graphql-js/test/integration.js:1801

   1800:     .then(data => {
   1801:       t.deepEqual(data.data, expected.data);
   1802:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       actors: [
  +         {
  +           __typename: 'Actor',
  +           name: ' Tom Skerritt',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Brad Pitt',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Brenda Blethyn',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: 'Craig Sheffer',
  +         },
  +       ],
  +       title: 'River Runs Through It, A',
  +     },
      ],
    }



  integration › Filter with GraphQL variable

  /home/robert/Development/neo4j-graphql-js/test/integration.js:1864

   1863:     .then(data => {
   1864:       t.deepEqual(data.data, expected.data);
   1865:     })

  Difference:

    {
      Movie: [
  +     {
  +       __typename: 'Movie',
  +       actors: [
  +         {
  +           __typename: 'Actor',
  +           name: ' Tom Skerritt',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Brad Pitt',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: ' Brenda Blethyn',
  +         },
  +         {
  +           __typename: 'Actor',
  +           name: 'Craig Sheffer',
  +         },
  +       ],
  +       title: 'River Runs Through It, A',
  +     },
      ],
    }

@johnymontana
Copy link
Contributor

Hey @roschaefer - thanks for pointing out the issues here and I'm sorry for your frustration.

npm run test will run the GraphQL --> Cypher translation tests and the schema augmentation tests, which cover most of the functionality of this library and can be run easily without any additional set up. In most cases, these are the relevant tests for development.

The integration (these are mostly end-to-end tests) tests require a bit more setup, including a locally running Neo4j instance with a specific database loaded and starting a GraphQL server with specific typedefs and middleware loaded. You can see the scripts used to download/start these services here and in the CircleCI config.

Finally, the TCK tests are an initial version of compliance tests that we'll have in place across different implementations of Neo4j GraphQL (currently JavaScript and Java). These tests are generated from markdown files and the goal is for the same tests to be run across implementations, ensuring consistency. These are not quite in final form yet and a bit WIP.

This is described (although tersely) in the README here..

I agree that this is currently poorly documented and makes it more difficult to contribute to this project so I'll work on simplifying the process and describing the steps to get the full tests running as well as more helpful contributing guidelines.

However, since this is a Neo4j Labs project the contributing guide found on other Neo4j projects is not completely relevant, so I'm closing this PR and have opened issue #248 to track adding a comprehensive contributing.md to this project.

roschaefer added a commit to roschaefer/neo4j-graphql-js that referenced this pull request May 21, 2019
I like that @johnymontana has closed my pull request here:
neo4j-graphql#243

I don't find the standard CONTRIBUTING guidelines very helpful either.
The only thing that I like to re-use is a hint how to join the neo4j
community on Slack. I guess that would be the best option for new
contributors to get some guidance.

So in this commit I tried to document issues and my workarounds that I
discovered already. I hope other people find this useful.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants