You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-11Lines changed: 27 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -307,17 +307,23 @@ To contribute to `thehive4py`, follow these steps:
307
307
308
308
## Run CI checks before pushing changes
309
309
310
-
To ensure the integrity of your changes and maintain code quality, you can run CI checks before pushing your changes to the repository. Use one of the following methods:
310
+
The project is utilizing the [nox] library to define and run automated dev scripts.
311
+
312
+
To ensure the integrity of your changes and maintain code quality you can use the provided sessions from the local `noxfile.py`.
313
+
For example you can run CI checks before pushing your changes to the repository. Use one of the following methods:
311
314
312
315
**Method 1: Manual check**
313
316
314
-
Run the CI checks manually by executing the following command:
317
+
Run the CI checks manually by using the following command:
315
318
316
-
```
317
-
python scripts/ci.py
318
-
```
319
+
nox
320
+
321
+
This will trigger all CI checks except tests as the `noxfile.py` is configured to do so by default.
322
+
323
+
324
+
To run individual checks one can list all the available sessions with:
319
325
320
-
This command will trigger the CI checks and provide feedback on any issues that need attention.
326
+
nox --list
321
327
322
328
**Method 2: Automatic checks with pre-commit hooks [experimental]**
323
329
@@ -353,15 +359,25 @@ Once TheHive is responsive the suite will initialize the instance with a setup r
353
359
Please note that due to this initial setup the very first test run will idle for some time to make sure everything is up and running. Any other subsequent runs' statup time should be significantly faster.
354
360
355
361
### Testing locally
356
-
To execute the whole test suite locally one can use the `scripts/ci.py` utility script like:
362
+
To execute the whole test suite locally one can use the `test` session provided by the local `noxfile.py` utility script like:
363
+
364
+
nox --session=test
365
+
366
+
or
367
+
368
+
nox -s test
369
+
370
+
for short.
371
+
372
+
Note however that the above will command execute the entire test suite which can take several minutes to complete.
373
+
In case one wants to execute only a portion of the test suite then the easiest workaround is to pass additional arguments to the session e.g.:
357
374
358
-
./scripts/ci.py --test
375
+
nox -s test -- tests/test_observable_endpoint.py -v
359
376
360
-
Note however that the above will execute the entire test suite which can take several minutes to complete.
361
-
In case one wants to execute only a portion of the test suite then the easiest workaround is to use `pytest` and pass the path to the specific test module. For example to only execute tests for the alert endpoints one can do:
377
+
The nox command will parse additional arguments after the `--` option terminator argument and they will be passed to the underlying `pytest` command.
0 commit comments