Commit Graph

71 Commits

Author SHA1 Message Date
Bogdan 4e340c8368
feat: Switch from nosetest to pytest (#10177)
* Switch from nosetest to pytest

Fix schedule tests

Collect pytest coverage

Move pytest config into pytest.ini

Move cov to the pytest.ini

* Append coverage for the 2nd run

* Add coverage to all commands

* Coverage only for tests

* Get coverage from 1 place

* Rename classes to be  pytest compatible

* Test coverage for examples and tests

* Max diff to -1

* Explain how to run pytest for the whole project

* Do not append code coverage for the main run

* Do not run coverage on examples

Co-authored-by: bogdan kyryliuk <bogdankyryliuk@dropbox.com>
2020-06-29 15:36:06 -07:00
John Bodley 52285aeb04
build: tox leveraging conditional factors (#9828) 2020-05-18 07:37:25 -07:00
Daniel Vaz Gaspar 4427d65717
tests(celery): improve celery tests infra (#9775) 2020-05-14 16:58:30 +01:00
John Bodley 8ae92b50ad
[fix] Fixing regression from #9161 (#9641)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
2020-04-23 22:51:33 -07:00
Daniel Vaz Gaspar d81f720502
[thumbnails] API and celery task for dashboards and charts (#8947) 2020-04-15 09:40:14 +01:00
David Aaron Suddjian 2913063924 SIP-32: Moving frontend code to the base of the repo (#9098)
* move assets out, get webpack dev working

* update docs to reference superset-frontend

* draw the rest of the owl

* fix docs

* fix webpack script

* rats

* correct docs

* fix tox dox
2020-02-09 17:53:56 -08:00
John Bodley 8a138fbd03
[tox] Allowing running of specific tests (#9097) 2020-02-06 16:45:37 -08:00
Daniel Vaz Gaspar 0ed0031412
[jinja_context] Fix, allow for app factory pattern (#8693)
Better app factory pattern on jinja context and introduces tests for building docs
2019-12-03 09:42:57 +00:00
Craig Rueda e490414484 Flask App factory PR #1 (#8418)
* First cut at app factory

* Setting things back to master

* Working with new FLASK_APP

* Still need to refactor Celery

* CLI mostly working

* Working on unit tests

* Moving cli stuff around a bit

* Removing get in config

* Defaulting test config

* Adding flask-testing

* flask-testing casing

* resultsbackend property bug

* Fixing up cli

* Quick fix for KV api

* Working on save slice

* Fixed core_tests

* Fixed utils_tests

* Most tests working - still need to dig into remaining app_context issue in tests

* All tests passing locally - need to update code comments

* Fixing dashboard tests again

* Blacking

* Sorting imports

* linting

* removing envvar mangling

* blacking

* Fixing unit tests

* isorting

* licensing

* fixing mysql tests

* fixing cypress?

* fixing .flaskenv

* fixing test app_ctx

* fixing cypress

* moving manifest processor around

* moving results backend manager around

* Cleaning up __init__ a bit more

* Addressing PR comments

* Addressing PR comments

* Blacking

* Fixes for running celery worker

* Tuning isort

* Blacking
2019-11-20 15:47:06 +00:00
Beto Dealmeida d66bc5ad90
SIP-23: Persist SQL Lab state in the backend (#8060)
* Squash all commits from VIZ-689

* Fix javascript

* Fix black

* WIP fixing javascript

* Add feature flag SQLLAB_BACKEND_PERSISTENCE

* Use feature flag

* Small fix

* Fix lint

* Fix setQueryEditorSql

* Improve unit tests

* Add unit tests for backend sync

* Rename results to description in table_schema

* Add integration tests

* Fix black

* Migrate query history

* Handle no results backend

* Small improvement

* Address comments

* Store SQL directly instead of reference to query

* Small fixes

* Fix clone tab

* Fix remove query

* Cascade delete

* Cascade deletes

* Fix tab closing

* Small fixes

* Small fix

* Fix error when deleting tab

* Catch 404 when tab is deleted

* Remove tables from state on tab close

* Add index, autoincrement and cascade

* Prevent duplicate table schemas

* Fix mapStateToProps

* Fix lint

* Fix head

* Fix javascript

* Fix mypy

* Fix isort

* Fix javascript

* Fix merge

* Fix heads

* Fix heads

* Fix displayLimit

* Recreate migration script trying to fix heads

* Fix heads
2019-11-14 09:44:57 -08:00
John Bodley 9fc37ea9f1 [ci] Deprecate flake8 (#8409)
* [ci] Deprecate flake8

* Addressing @villebro's comments
2019-10-18 14:44:27 -07:00
Maxime Beauchemin 2f2a3b79b4
Setup FOSSA as part of CI (#7999)
* Setup FOSSA as part of CI

* Add comments and links to FOSSA docs on script
2019-08-07 21:08:10 -07:00
John Bodley fdb62e9865
[flake8] Ignoring I202 (#7988) 2019-08-05 15:01:33 -07:00
Maxime Beauchemin f1d566a90c
Fixing the build after travis upgraded Ubuntu (#7931)
* Fixing the build after travis upgraded Ubuntu

It seems Travis has been updated/ing its build environment to Ubuntu
16.04 from Ubuntu 14 in the past few days. This broke a bunch of things
on our side.

* postgres -> postgresql

* Fix java

* Try openjdk8

* Fix, license check oracle and python

* Fix, license check oracle and python v2

* Fix, license check oracle and python v3

* Fix, license check oracle and python v4

* dummy commit, just to trigger the build
2019-07-27 08:33:03 -07:00
Maxime Beauchemin d65b039219
Improve examples & related tests (#7773)
* [WiP] improve load_examples

related to #7472, longer term we will generate the examples by exporting
them into tarball as in #7472. In the meantime, we need this subset of
the features:

* allowing specifying an alternate database connection for examples
* allowing a --only-metadata flag to `load_examples` to load only
  dashboard and chart definitions, no actual data is loaded

* Improve logging

* Rename data->examples

* Load only if not exist

* By default do not load, add a force flag

* fix build

* set published to true
2019-07-16 21:36:56 -07:00
John Bodley fc8268b086
Update tox.ini (#7867) 2019-07-12 16:20:01 -07:00
John Bodley 5c58fd1802
[format] Using Black (#7769) 2019-06-25 13:34:48 -07:00
Maxime Beauchemin 859d6e7c6a
chore: taking db dependencies out of requirements-dev.txt (#7605)
* chore: taking db dependencies out of requirements-dev.txt

The deps on mysqlclient and psycopg2

* Fix unit tests

* fix tox.ini

* fix tests
2019-06-23 22:37:41 -07:00
Maxime Beauchemin eb4293654e
[FAB] set AppBuilder to update_perms=False (#7561)
* [FAB] set AppBuilder to update_perms=False

Upon start, by default, FAB tries to go and update the permission list
in the database based on the list of views, models and menu items that
exist in the code.

Really this should happen once per deployment/upgrade and
not in module scope, so we have `superset init` for this.

The intent was always to set to False by default, but I think we forgot
to add this flag back in
https://github.com/apache/incubator-superset/pull/7323

* Add superset init to tox
2019-06-01 10:19:49 -07:00
John Bodley cf87173c21
[wtforms] Strip leading/trailing whitespace (#7084) 2019-04-23 12:04:50 -07:00
Dave Smith ba19a62412 Injectable statsd client (#7138)
* Add ability to inject statsd client; some py test/reqs updates

- Updated the metrics logger to allow construction with an existing
statsd client, so that it can be configured by external systems or libs.
- added requirements to requirements-dev.txt which are needed to run
  tests-eg coverage, nose
- removed dependency on mock lib, it is in python stdlib now
- updated tox.ini to remove the now-superfluous deps

* add license to test file, and remove blank line at EOF
2019-03-27 14:08:36 -07:00
John Bodley 2524219f98
[tox] Enforcing consistent ordering (#7060) 2019-03-19 21:14:12 -07:00
Kim Truong 0a8bc84a02 Exclude venv for python linter to ignore (#6965) 2019-03-01 13:38:06 -08:00
bolkedebruin 1fece0d2fa Add licenses to translations (#6732)
* Add licenses

* More licenses

* Ignore messages.json as they are generated

* More licenses

* Also typescript

* Fix alignment

* Add to svg

* Many more licenses

* more licenses

* Better excludes

* Add licenses to docs and md files

* Pre-finalize licenses

* Fix newlines

* Finalize all sourde licenses

* Fix lint
2019-01-22 08:21:13 -08:00
Maxime Beauchemin e03e276571
Bump some of the requirements-dev.txt (#6700)
* Bump some of the requirements-dev.txt

* addressing comments
2019-01-16 20:40:16 -08:00
bolkedebruin 8e6c114195 Add Apache Rat for license checks (#6663) 2019-01-12 20:28:12 -08:00
Maxime Beauchemin 60ccf3eb9d [SIP-14] remove dependency on yarn in favor of npm (#6541)
* [SIP-14] remove dependency on yarn in favor of npm

Find more details here
https://github.com/apache/incubator-superset/issues/6217

* Add core-js to dev deps

* lint

* fix cypress

* break down cypress_build.sh

* fix cypress

* Use 'npm ci' in place of 'npm install'

* Bump npm req to >=6.5.0

* Enforcing  npm@'>=6.5.0'

* Using latest lts of nvm

* Make cache settings global

* remove uneeded 'npm run test' as 'npm run cover' takes care of that

* Prefix with 'time'

* Trying to upgrade babel-eslint instead of downgrading

* upgrading babel-polyfill to '@babel/polyfill'

* Moving to babel 7

* remove unused packages
2018-12-21 10:24:49 -08:00
timifasubaa c17de3940c
Split cypress tests (#6241)
* aplit cypress tests

* split into three
2018-11-15 12:26:33 -08:00
Maxime Beauchemin bbfd69a138 [utils.py] gathering/refactoring into a "utils/" folder (#6095)
* [utils] gathering/refactoring into a "utils/" folder

Moving current utils.py into utils/core.py and moving other *util*
modules under this new "utils/" as well.

Following steps include eroding at "utils/core.py" and breaking it down
into smaller modules.

* Improve tests

* Make loading examples in scope for tests

* Remove test class attrs examples_loaded and requires_examples
2018-10-16 17:59:34 -07:00
timifasubaa 93fe453970
remove redundant mysql (#6049) 2018-10-05 20:27:20 -07:00
Maxime Beauchemin 160e47720c
Deprecate support for Python < 3.6 (#5985)
* Deprecate support for Python < 3.6

This is a first step, beyond this we can:
* remove all from future imports
* remove 'six' lib as a dependency
* start using f-strings
* enjoy ourselves

* fix tox

* Rebasing

* fix
2018-10-05 13:44:45 -04:00
michellethomas d40ded0be8 Adding simple Cypress tests (#5693)
* Adding simple Cypress tests

* Changing visitChart into multiple commands

* Adding Cypress to tox
2018-09-06 14:55:48 -07:00
Octavian 39ff9deb57 update python3 version for testing to 3.6 (#5562)
* update python version for testing to 3.6

* CONTRIBUTING.md states pull requests should work on py27, py36+

* CONTRIBUTING.md states pull requests should work on py27 and py36
2018-08-07 13:22:19 -07:00
Maxime Beauchemin fee5023269
Move flake8-related packages deps to reqs-dev.txt (#5460)
* Move flake8-related packages deps to reqs-dev.txt

My VIM which is integrated with flake8 wouldn't match the output from
travis and would often miss things related to the flake8 plugins
installed using Tox.

By moving this to requirements-dev.txt, we can expect developers would
have the proper configuration locally and get matching results with
Travis when running flake8 or in their IDEs if its integrated with
flake8..

* merging migratinos

* sorting packages

* Specify folder for flake8 processing

* pin pycodestyle==2.3.1

* merge db migrations
2018-07-23 12:29:21 -07:00
John Bodley 7fcc2af68f
[sql] Correct SQL parameter formatting (#5178) 2018-07-21 12:01:26 -07:00
gbates101 90decbc5db Migrated to click (#5410)
* Migrate flask_script to the Flask built-in click.

Flask 0.11 is the built-in integration of the click command line interface.
Flask-Migrate support for the new Flask CLI based on Click after Release 2.0.0.

* Resolved merge conflicts.

* Fixed issue introduced from bad merge.

* Fixed flake8 errors, added build to excluded flake8 stuff.

* * Moved the FlaskGroup declaration to the driver script.
* Moved shell context definition to cli.py
* Switched shell context definition to use decorator.
* Moved create_app definition to cli.py
* Fixed InvocationError with a wrapped function

* Added extra newlines between functions

* Removed flask-script dependency.
2018-07-20 15:26:33 -07:00
Maxime Beauchemin 99ce7b79fa
Add pylint back as a tox env (#5416) 2018-07-18 15:55:01 -07:00
Maxime Beauchemin 2eeff2ae0b Fix the build (#5403)
The travis build has been failing for 2 reasons recently
* pylint takes > 10 minutes without outputing
* bad merge confict auto resolve in controls.jsx
2018-07-16 11:46:13 -07:00
John Bodley d533ce0967
[pylint] prepping for enabling pylint for non-errors (#4884) 2018-04-28 20:08:09 -07:00
John Bodley 44c2d5bdab
[setup] Dropping 3.4 and adding 3.6 (#4835)
* [setup] Dropping 3.4 and 3.6

* Update tox.ini

* Update .travis.yml
2018-04-17 21:30:12 -07:00
John Bodley 1627fd096b
[travis/tox] Restructuring configuration (#4552) 2018-04-10 15:59:44 -07:00
Kyle Travis 31a995714d [bug] Fix CSV upload feature for DB with password (#4562)
* Use sqlalchemy_uri_decrypted in create_engine calls

* Update tox mysql uri

* Include mysql charset=utf8 for py2.7 in tox.ini
2018-03-07 17:42:52 -08:00
John Bodley 4f7258aaca [coverage] Replacing coveralls with codecov 2018-03-04 13:27:26 -08:00
John Bodley d57a37e341 [flake8] Adding flake8-coding (#4477) 2018-02-25 15:06:11 -08:00
John Bodley e112e4417c [flake8] Adding future-import check (#4476) 2018-02-23 16:42:09 -08:00
John Bodley 8aac63e74c [flake8] Fixing additional flake8 issue w/ the presence of ignore (#4474) 2018-02-23 14:46:26 -08:00
Maxime Beauchemin 4b0f252170
Sort out dependencies in travis/tox (#4186)
* Make travis a bit more lean

* Bump npm to 5.6.0
2018-01-10 21:46:10 -08:00
timifasubaa 268edcfedd Import CSV (#3643)
* add upload csv button to sources dropdown

* upload csv to non-hive datasources

* upload csv to hive datasource

* update FAQ page

* add tests

* fix linting errors and merge conflicts

* Update .travis.yml

* Update tox.ini
2017-11-27 21:07:12 -08:00
John Bodley ac57780607 [flake8] Resolving Q??? errors (#3847) 2017-11-13 21:06:51 -08:00
John Bodley 1b4f128f55 [flake8] Resolving F5?? errors (#3846) 2017-11-12 11:09:22 -08:00