Skip to content

Commit

Permalink
docs: improve docs on running tests locally (apache#14102)
Browse files Browse the repository at this point in the history
* Fix missing items in ToC

Thanks to whatever autoformatting tool was running (:

Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>

* Fix minimal Python version required

Currently Python 3.7 is still supported by Superset — cf.
https://github.com/apache/superset/blob/4b23d0eccabcc3932369c90468be8b4f36ec64d0/setup.py#L160

I assue it is thus safe to run the test with Py3.7.

Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>

* List MySQL/MariaDB as OS dependecy for test

As raised in issue apache#14052, MySQL (or MariaDB) is required for being able
to install the Python requirements.
(I assume due to `mysqlclient` dependency — cf.
https://github.com/apache/superset/blob/master/requirements/development.txt#L23)

Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>

* Fix which dependencies are installed for tests

To install `tox` (for running the test suite), we want to install the…
testing dependencies, rather than “simply” the local ones.

Note that the `requirements/testing` is a superset of the
`requirements/local`:
https://github.com/apache/superset/blob/master/requirements/testing.txt
vs https://github.com/apache/superset/blob/master/requirements/local.txt

Linked to issue apache#14052

Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>

* Emphasize how to name demo admin user

Related to apache#14052

Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>

* Fix max Python version required

Indeed, Python 3.9 isn't yet supported (cf. e.g., issue apache#14159).

Signed-off-by: Étienne Boisseau-Sierra <etienne.boisseau-sierra@unipart.io>
  • Loading branch information
EBoisseauSierra committed Jul 1, 2021
1 parent a67c172 commit a181a36
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ little bit helps, and credit will always be given.
- [Python Testing](#python-testing)
- [Frontend Testing](#frontend-testing)
- [Integration Testing](#integration-testing)
- [Debugging Server App](#debugging-server-app)
- [Debugging Server App in Kubernetes Environment](#debugging-server-app-in-kubernetes-environment)
- [Storybook](#storybook)
- [Translating](#translating)
- [Enabling language selection](#enabling-language-selection)
Expand Down Expand Up @@ -418,22 +420,23 @@ For example, the image referenced above actually lives in `superset-frontend/ima

#### OS Dependencies

Make sure your machine meets the [OS dependencies](https://superset.apache.org/docs/installation/installing-superset-from-scratch#os-dependencies) before following these steps.
Make sure your machine meets the [OS dependencies](https://superset.apache.org/docs/installation/installing-superset-from-scratch#os-dependencies) before following these steps.
You also need to install MySQL or [MariaDB](https://mariadb.com/downloads).

Ensure Python versions >3.7, Then proceed with:
Ensure that you are using Python version 3.7 or 3.8, then proceed with:

````bash
# Create a virtual environment and activate it (recommended)
python3 -m venv venv # setup a python3 virtualenv
source venv/bin/activate

# Install external dependencies
pip install -r requirements/local.txt
pip install -r requirements/testing.txt

# Install Superset in editable (development) mode
pip install -e .

# Create an admin user in your metadata database
# Create an admin user in your metadata database (use `admin` as username to be able to load the examples)
superset fab create-admin

# Initialize the database
Expand All @@ -442,11 +445,12 @@ superset db upgrade
# Create default roles and permissions
superset init

# Load some data to play with (you must create an Admin user with the username `admin` for this command to work)
# Load some data to play with.
# Note: you MUST have previously created an admin user with the username `admin` for this command to work.
superset load-examples

# Start the Flask dev web server from inside your virtualenv.
# Note that your page may not have css at this point.
# Note that your page may not have CSS at this point.
# See instructions below how to build the front-end assets.
FLASK_ENV=development superset run -p 8088 --with-threads --reload --debugger

Expand Down

0 comments on commit a181a36

Please sign in to comment.