Skip to content

Commit 1d15ccb

Browse files
authored
Move build and test instructions to CONTRIBUTING.md and TESTING.md (#1088)
These information were spread into multiple `README.md` and present in the **npm package** description. However, this information is only useful for people who are contributing to the project.
1 parent 90042c8 commit 1d15ccb

File tree

6 files changed

+130
-273
lines changed

6 files changed

+130
-273
lines changed

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,28 @@ We can't guarantee that we'll accept pull requests and may ask you to make some
4848
Occasionally, we might also have logistical, commercial, or legal reasons why we can't accept your work but we'll try to find an alternative way for you to contribute in that case.
4949
Remember that many community members have become regular contributors and some are now even Neo employees!
5050

51+
## Specifically for this project:
52+
53+
All code in `packages/neo4j-driver-deno/lib` folder. Don't change it, this files should be update by running `npm run build::deno`.
54+
55+
Setting up the development environment:
56+
57+
* Install Node 12+
58+
* Install Deno 1.19+
59+
* Install Dependencies and Building
60+
```bash
61+
$ npm run ci
62+
$ npm run build
63+
```
64+
65+
After commit your changes, update the `neo4j-driver-deno` and commit the changes to the project:
66+
67+
```bash
68+
$ npm run build::deno
69+
```
70+
71+
The build/testing pipelines will fail if the `neo4j-driver-deno` is not in sync with `neo4j-driver-lite`, `neo4j-driver-core` and `neo4j-driver-bolt-connection` source.
72+
5173
## Got an idea for a new project?
5274

5375
If you have an idea for a new tool or library, start by talking to other people in the community.

README.md

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -503,90 +503,3 @@ var driver = neo4j.driver(
503503
{ disableLosslessIntegers: true }
504504
)
505505
```
506-
507-
## Building
508-
509-
```
510-
npm ci
511-
npm run build
512-
```
513-
514-
This produces browser-compatible standalone files under `lib/browser` and a Node.js module version under `lib/`.
515-
See files under `examples/` on how to use.
516-
517-
## Testing
518-
519-
Tests **require** latest [Testkit 4.3](https://github.com/neo4j-drivers/testkit/tree/4.3), Python3 and Docker.
520-
521-
Testkit is needed to be cloned and configured to run against the Javascript Lite Driver. Use the following steps to configure Testkit.
522-
523-
1. Clone the Testkit repository
524-
525-
```
526-
git clone https://github.com/neo4j-drivers/testkit.git
527-
```
528-
529-
2. Under the Testkit folder, install the requirements.
530-
531-
```
532-
pip3 install -r requirements.txt
533-
```
534-
535-
3. Define some enviroment variables to configure Testkit
536-
537-
```
538-
export TEST_DRIVER_NAME=javascript
539-
export TEST_DRIVER_REPO=<path for the root folder of driver repository>
540-
unset TEST_DRIVER_LITE
541-
```
542-
543-
To run test against against some Neo4j version:
544-
545-
```
546-
python3 main.py
547-
```
548-
549-
More details about how to use Teskit could be found on [its repository](https://github.com/neo4j-drivers/testkit/tree/4.3)
550-
551-
## Testing (Legacy)
552-
553-
Tests **require** latest [Boltkit](https://github.com/neo4j-contrib/boltkit) and [Firefox](https://www.mozilla.org/firefox/) to be installed in the system.
554-
555-
Boltkit is needed to start, stop and configure local test database. Boltkit can be installed with the following command:
556-
557-
```
558-
pip3 install --upgrade boltkit
559-
```
560-
561-
To run tests against "default" Neo4j version:
562-
563-
```
564-
./runTests.sh
565-
```
566-
567-
To run tests against specified Neo4j version:
568-
569-
```
570-
./runTests.sh '-e 4.2.0'
571-
```
572-
573-
Simple `npm test` can also be used if you already have a running version of a compatible Neo4j server.
574-
575-
For development, you can have the build tool rerun the tests each time you change
576-
the source code:
577-
578-
```
579-
gulp watch-n-test
580-
```
581-
582-
If the `gulp` command line tool is not available, you might need to install this globally:
583-
584-
```
585-
npm install -g gulp-cli
586-
```
587-
588-
### Testing on windows
589-
590-
To run the same test suite, run `.\runTest.ps1` instead in powershell with admin right.
591-
The admin right is required to start/stop Neo4j properly as a system service.
592-
While there is no need to grab admin right if you are running tests against an existing Neo4j server using `npm test`.

TESTING.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Neo4j Driver Testing
2+
3+
## Unit Tests
4+
5+
Unit tests **require** to setup the development environment as described at `CONTRIBUTING.md`.
6+
7+
* To run unit tests for the whole project:
8+
9+
```bash
10+
$ npm run test::unit
11+
```
12+
13+
* To run unit tests against only an specify module:
14+
15+
```bash
16+
$ npm run test::unit -- --scope="name-of-the-package"
17+
```
18+
19+
* To run unit tests for each time a file is changed in a package:
20+
21+
```bash
22+
$ cd ./packages/name-of-package-folder
23+
$ npm run test::watch
24+
```
25+
Watch is not supported in the package `neo4j-driver`.
26+
27+
**Warning!** When the change spread across multiple package, it might be need to rebuild the project to the changes be propagated before testing.
28+
29+
30+
## Testing using Testkit
31+
32+
Tests **require** latest [Testkit 5](https://github.com/neo4j-drivers/testkit/tree/5.0), Python3 and Docker.
33+
34+
Testkit is needed to be cloned and configured to run against the Javascript Lite Driver. Use the following steps to configure Testkit.
35+
36+
1. Clone the Testkit repository
37+
38+
```bash
39+
$ git clone https://github.com/neo4j-drivers/testkit.git
40+
```
41+
42+
2. Under the Testkit folder, install the requirements.
43+
44+
```bash
45+
$ pip3 install -r requirements.txt
46+
```
47+
48+
3. Define some environment variables to configure Testkit
49+
50+
```bash
51+
$ export TEST_DRIVER_NAME=javascript
52+
$ export TEST_DRIVER_REPO=<path for the root folder of driver repository>
53+
```
54+
55+
By default, Testkit will run against the full version of the driver.
56+
For testing the `neo4j-driver-lite`, the environment variable `TEST_DRIVER_LITE` should be set to `1`.
57+
For testing the `neo4j-driver-deno`, the environment variable `TEST_DRIVER_DENO` should be set to `1`.
58+
59+
To run test against against some Neo4j version:
60+
61+
```
62+
python3 main.py
63+
```
64+
65+
More details about how to use Testkit could be found on [its repository](https://github.com/neo4j-drivers/testkit/tree/5.0)
66+
67+
## Testing (Legacy)
68+
69+
Tests **require** latest [Boltkit](https://github.com/neo4j-contrib/boltkit) and [Firefox](https://www.mozilla.org/firefox/) to be installed in the system.
70+
71+
Boltkit is needed to start, stop and configure local test database. Boltkit can be installed with the following command:
72+
73+
```
74+
pip3 install --upgrade boltkit
75+
```
76+
77+
To run tests against "default" Neo4j version:
78+
79+
```
80+
./runTests.sh
81+
```
82+
83+
To run tests against specified Neo4j version:
84+
85+
```
86+
./runTests.sh '-e 4.2.0'
87+
```
88+
89+
Simple `npm test` can also be used if you already have a running version of a compatible Neo4j server.
90+
91+
For development, you can have the build tool rerun the tests each time you change
92+
the source code:
93+
94+
```
95+
gulp watch-n-test
96+
```
97+
98+
If the `gulp` command line tool is not available, you might need to install this globally:
99+
100+
```
101+
npm install -g gulp-cli
102+
```
103+
104+
### Testing on windows
105+
106+
To run the same test suite, run `.\runTest.ps1` instead in powershell with admin right.
107+
The admin right is required to start/stop Neo4j properly as a system service.
108+
While there is no need to grab admin right if you are running tests against an existing Neo4j server using `npm test`.

packages/neo4j-driver-deno/README.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -58,37 +58,3 @@ quickly spin one up.
5858
For using system certificates, the `DENO_TLS_CA_STORE` should be set to `"system"`.
5959
`TRUST_ALL_CERTIFICATES` should be handle by `--unsafely-ignore-certificate-errors` and not by driver configuration. See, https://deno.com/blog/v1.13#disable-tls-verification;
6060

61-
## Tests
62-
63-
Tests **require** latest [Testkit 5.0](https://github.com/neo4j-drivers/testkit/tree/5.0), Python3 and Docker.
64-
65-
Testkit is needed to be cloned and configured to run against the Javascript Lite Driver. Use the following steps to configure Testkit.
66-
67-
1. Clone the Testkit repository
68-
69-
```
70-
git clone https://github.com/neo4j-drivers/testkit.git
71-
```
72-
73-
2. Under the Testkit folder, install the requirements.
74-
75-
```
76-
pip3 install -r requirements.txt
77-
```
78-
79-
3. Define some enviroment variables to configure Testkit
80-
81-
```
82-
export TEST_DRIVER_NAME=javascript
83-
export TEST_DRIVER_REPO=<path for the root folder of driver repository>
84-
export TEST_DRIVER_DENO=1
85-
```
86-
87-
To run test against against some Neo4j version:
88-
89-
```
90-
python3 main.py
91-
```
92-
93-
More details about how to use Teskit could be found on [its repository](https://github.com/neo4j-drivers/testkit/tree/5.0)
94-

packages/neo4j-driver-lite/README.md

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -390,68 +390,3 @@ var driver = neo4j.driver(
390390
{ disableLosslessIntegers: true }
391391
)
392392
```
393-
394-
## Building
395-
396-
The build of this package is handled by the root package of this repository.
397-
398-
First it is needed to install the mono-repo dependencies by running `npm ci` in the root of the repository. Then:
399-
400-
* Build all could be performed with
401-
402-
```
403-
npm run build
404-
```
405-
* Build only the Core could be performed with
406-
Builind only Core:
407-
```
408-
npm run build -- --scope=neo4j-driver-lite
409-
410-
```
411-
412-
This produces browser-compatible standalone files under `lib/browser` and a Node.js module version under `lib/`.
413-
See files under `../examples/` on how to use.
414-
415-
## Testing
416-
417-
Tests **require** latest [Testkit 4.3](https://github.com/neo4j-drivers/testkit/tree/4.3), Python3 and Docker.
418-
419-
Testkit is needed to be cloned and configured to run against the Javascript Lite Driver. Use the following steps to configure Testkit.
420-
421-
1. Clone the Testkit repository
422-
423-
```
424-
git clone https://github.com/neo4j-drivers/testkit.git
425-
```
426-
427-
2. Under the Testkit folder, install the requirements.
428-
429-
```
430-
pip3 install -r requirements.txt
431-
```
432-
433-
3. Define some enviroment variables to configure Testkit
434-
435-
```
436-
export TEST_DRIVER_NAME=javascript
437-
export TEST_DRIVER_REPO=<path for the root folder of driver repository>
438-
export TEST_DRIVER_LITE=1
439-
```
440-
441-
To run test against against some Neo4j version:
442-
443-
```
444-
python3 main.py
445-
```
446-
447-
More details about how to use Teskit could be found on [its repository](https://github.com/neo4j-drivers/testkit/tree/4.3)
448-
449-
Runing `npm test` in this package directory can also be used if you want to run only the unit tests.
450-
451-
For development, you can have the build tool rerun the tests each time you change the source code:
452-
453-
```
454-
npm run test:watch
455-
```
456-
457-
The command `npm run test::unit` could be used in the root package for running the unit tests for all the packages in this project.

0 commit comments

Comments
 (0)