Skip to content

Run twice #1

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

Open
wants to merge 2 commits into
base: run-twice
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,25 @@ following requirements:

- A local Neo4J instance with username `neo4j` and password `letmein`
- APOC plugin installed (see instructions [here](https://github.com/neo4j-contrib/neo4j-apoc-procedures#installation-with-neo4j-desktop))
- Your Neo4J instance runs on [this database](https://s3.amazonaws.com/neo4j-sandbox-usecase-datastores/v3_5/recommendations.db.zip)

In order to import the database, you can download the zipped files and extract
it to the databases folder of your Neo4J instance. Restart the database on the
new data.

Once you're done with that:

```
npm run start-middleware
```

**Watch out, the following will wipe out your database!**

```
# open another terminal and run
npm run parse-tck
npm run test-all
```

Note that `npm run test-all` will fail on consecutive runs! Some of the
integration tests create data and get in the way of other tests. Running the
whole test suite twice will result in some failing tests. There is [an issue
for it](https://github.com/neo4j-graphql/neo4j-graphql-js/issues/252), check if
it is still active. Your best option for now is to re-import the data after each
test run.
We clean the database after each test run. Because Neo4J does not offer separate
databases in [community edition](https://community.neo4j.com/t/create-multiple-databases-in-community-version/5025/2),
we use the same database for testing that you might use for development. So be
careful.

### Local Development

Expand Down
2 changes: 1 addition & 1 deletion test/helpers/integrationTestHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const resetDatabase = async () => {
const seedPath = path.resolve(__dirname, '../fixtures/seed.graphml');
const session = driver.session();
await session.run(`
MATCH (n) WHERE n:Actor OR n:Director OR n:Genre OR n:Movie OR n:OnlyDate OR n:User DETACH DELETE n RETURN count(n);
MATCH (n) DETACH DELETE n RETURN count(n);
`);
await session.run(
`
Expand Down