From baf42bc2c528fa4005da7049ef074618c1845522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Boisseau-Sierra?= <37387755+EBoisseauSierra@users.noreply.github.com> Date: Thu, 1 Jul 2021 12:11:03 +0100 Subject: [PATCH] docs: improve docs on running tests locally (#14102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix missing items in ToC Thanks to whatever autoformatting tool was running (: Signed-off-by: Étienne Boisseau-Sierra * 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 * List MySQL/MariaDB as OS dependecy for test As raised in issue #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 * 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 #14052 Signed-off-by: Étienne Boisseau-Sierra * Emphasize how to name demo admin user Related to #14052 Signed-off-by: Étienne Boisseau-Sierra * Fix max Python version required Indeed, Python 3.9 isn't yet supported (cf. e.g., issue #14159). Signed-off-by: Étienne Boisseau-Sierra --- CONTRIBUTING.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cda776186..ccbaa1e72 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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) @@ -418,9 +420,10 @@ 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) @@ -428,12 +431,12 @@ 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 @@ -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