You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2021/03/09 00:46:30 UTC

[superset] branch master updated: add more documentation around python testing and linting (#13365)

This is an automated email from the ASF dual-hosted git repository.

beto pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new ec286f2  add more documentation around python testing and linting (#13365)
ec286f2 is described below

commit ec286f27c4e84a84853caf65373e21311d6fef31
Author: Elizabeth Thompson <es...@gmail.com>
AuthorDate: Mon Mar 8 16:45:37 2021 -0800

    add more documentation around python testing and linting (#13365)
---
 CONTRIBUTING.md | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1138e1b..991b253 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -579,12 +579,19 @@ pip3 install -r requirements/integration.txt
 pre-commit install
 ```
 
+A series of checks will now run when you make a git commit.
+
 Alternatively it is possible to run pre-commit via tox:
 
 ```bash
 tox -e pre-commit
 ```
 
+Or by running pre-commit manually:
+```bash
+pre-commit run --all-files
+```
+
 ## Linting
 
 Lint the project with:
@@ -593,15 +600,17 @@ Lint the project with:
 # for python
 tox -e pylint
 
+Alternatively, you can use pre-commit (mentioned above) for python linting
+
+The Python code is auto-formatted using [Black](https://github.com/python/black) which
+is configured as a pre-commit hook. There are also numerous [editor integrations](https://black.readthedocs.io/en/stable/editor_integration.html)
+
 # for frontend
 cd superset-frontend
 npm ci
 npm run lint
 ```
 
-The Python code is auto-formatted using [Black](https://github.com/python/black) which
-is configured as a pre-commit hook. There are also numerous [editor integrations](https://black.readthedocs.io/en/stable/editor_integration.html).
-
 ## Conventions
 
 ### Python
@@ -687,6 +696,14 @@ Note that the test environment uses a temporary directory for defining the
 SQLite databases which will be cleared each time before the group of test
 commands are invoked.
 
+There is also a utility script included in the Superset codebase to run python tests. The [readme can be
+found here](https://github.com/apache/superset/tree/master/scripts/tests)
+
+To run all tests for example, run this script from the root directory:
+```bash
+scripts/tests/run.sh
+```
+
 ### Frontend Testing
 
 We use [Jest](https://jestjs.io/) and [Enzyme](https://airbnb.io/enzyme/) to test TypeScript/JavaScript. Tests can be run with: