question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run tests successfully as per documentation

See original GitHub issue

I am trying to follow the documentation to setup my VM and successfully run the test suite, yet I’m facing multiple hurdles along the way.

Expected results

Actual results

I’m facing some issues:

  1. one OS dependency is not specified,
  2. one needs an admin actually named admin to load examples
  3. examples can’t be all loaded in one go,
  4. tests fail

How to reproduce the bug

On a new VM running Fedora 32:

  1. OSError: mysql_config not found
# Following https://github.com/apache/superset/blob/master/CONTRIBUTING.md#setup-local-environment-for-development

git clone git@github.com:apache/superset.git
cd superset
git checkout 1.0.1 # to make things reproducible

sudo dnf install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel # as per https://superset.apache.org/docs/installation/installing-superset-from-scratch#os-dependencies

python3.8 -m venv venv
source venv/bin/activate
pip install -r requirements/local.txt

This throws an OSError: mysql_config not found

As per this SO question, the solution is to install mariadb-devel — what actually solves the issue.

  1. Fail to load the examples
# Following https://github.com/apache/superset/blob/master/CONTRIBUTING.md#setup-local-environment-for-development

git clone git@github.com:apache/superset.git
cd superset
git checkout 1.0.1 # to make things reproducible

sudo dnf install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel # as per https://superset.apache.org/docs/installation/installing-superset-from-scratch#os-dependencies
sudo dnf -y install mariadb-devel # FIX as per https://stackoverflow.com/q/22949654/5433628

python3.8 -m venv venv
source venv/bin/activate
pip install -r requirements/local.txt
pip install .

superset fab create-admin --username adent --firstname arthur --lastname dent --email dontp@n.ic --password 42
superset db upgrade
superset init
superset load-examples

This returns the following error:

INFO:superset.utils.core:Creating database reference for examples
Loading examples metadata and related data into examples
Traceback (most recent call last):
  File "/home/fedora/superset/venv/bin/superset", line 11, in <module>
    load_entry_point('apache-superset==1.0.1', 'console_scripts', 'superset')()
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/flask/cli.py", line 426, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/cli.py", line 187, in load_examples
    load_examples_run(load_test_data, only_metadata, force)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/cli.py", line 120, in load_examples_run
    from superset import examples
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/examples/__init__.py", line 18, in <module>
    from .birth_names import load_birth_names
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/examples/birth_names.py", line 46, in <module>
    raise NoDataException(
superset.exceptions.NoDataException: Admin user does not exist. Please, check if test users are properly loaded (`superset load_test_users`).

We can then explicitely create an admin user:

# Following https://github.com/apache/superset/blob/master/CONTRIBUTING.md#setup-local-environment-for-development

git clone git@github.com:apache/superset.git
cd superset
git checkout 1.0.1 # to make things reproducible

sudo dnf install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel # as per https://superset.apache.org/docs/installation/installing-superset-from-scratch#os-dependencies
sudo dnf -y install mariadb-devel # FIX as per https://stackoverflow.com/q/22949654/5433628

python3.8 -m venv venv
source venv/bin/activate
pip install -r requirements/local.txt
pip install .

superset fab create-admin --username admin --firstname Ad --lastname Ministrator --email admin@email.com --password secret # FIX explicitely create an admin user with username exactly `admin`
superset db upgrade
superset init
superset load-examples

But the following error is still returned

[…]
INFO:superset.models.helpers:Updating table_columns gender
Loading data inside the import transaction
INFO:superset.datasets.commands.importers.v1.utils:Loading data inside the import transaction
Traceback (most recent call last):
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: too many SQL variables

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/commands/importers/v1/examples.py", line 67, in run
    self._import(db.session, self._configs, self.overwrite, self.force_data)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/commands/importers/v1/examples.py", line 99, in _import
    dataset = import_dataset(
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/datasets/commands/importers/v1/utils.py", line 119, in import_dataset
    load_data(data_uri, dataset, example_database, session)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/datasets/commands/importers/v1/utils.py", line 146, in load_data
    df.to_sql(
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/pandas/core/generic.py", line 2605, in to_sql
    sql.to_sql(
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/pandas/io/sql.py", line 589, in to_sql
    pandas_sql.to_sql(
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/pandas/io/sql.py", line 1406, in to_sql
    raise err
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/pandas/io/sql.py", line 1398, in to_sql
    table.insert(chunksize, method=method)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/pandas/io/sql.py", line 830, in insert
    exec_insert(conn, keys, chunk_iter)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/pandas/io/sql.py", line 758, in _execute_insert_multi
    conn.execute(self.table.insert(data))
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in _execute_clauseelement
    ret = self._execute_context(
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
    self._handle_dbapi_exception(
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
    util.raise_(
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
    self.dialect.do_execute(
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) too many SQL variables
[SQL: INSERT INTO "FCC 2018 Survey" ("ID", is_software_dev, is_first_dev_job, months_job_search, job_pref, job_intr_fllstck, job_intr_backend, job_intr_frntend, job_intr_mobile, job_intr_devops, job_intr_datasci, job_intr_teacher, job_intr_qa_engn, job_intr_ux_engn, job_intr_projm, job_intr_gamedev, job_intr_infosec, job_intr_dataengn, job_intr_other, when_appl_job, expected_earn, job_lctn_pref, job_relocate, reasons_to_code, reasons_to_code_other, rsrc_fcc, rsrc_mdn, rsrc_so, rsrc_edx, rsrc_coursera, rsrc_khan_acdm, rsrc_pluralsght, rsrc_codeacdm, rsrc_udacity, rsrc_udemy, rsrc_code_wars, rsrc_treehouse, rsrc_hackerrank, rsrc_frntendmstr, rsrc_lynda, rsrc_egghead, rsrc_css_tricks, rsrc_other, codeevnt_fcc, codeevnt_hackthn, codeevnt_confs, codeevnt_workshps, codeevnt_startupwknd, codeevnt_nodeschl, codeevnt_womenwc, codeevnt_girldevit, codeevnt_coderdojo, codeevnt_meetup, codeevnt_railsbrdg, codeevnt_gamejam, codeevnt_railsgrls, codeevnt_djangogrls, codeevnt_wkndbtcmp, codeevnt_other, podcast_fcc, podcast_codenewbie, podcast_changelog, podcast_sedaily, podcast_js_jabber, podcast_syntaxfm, podcast_ltcwm, podcast_fullstckrd, podcast_frnthppyhr, podcast_codingblcks, podcast_shoptalk, podcast_devtea, podcast_progthrwdwn, podcast_geekspeak, podcast_hanselmnts, podcast_talkpythonme, podcast_rubyrogues, podcast_codepenrd, podcast_seradio, podcast_other, yt_mit_ocw, yt_fcc, yt_computerphile, yt_devtips, yt_cs_dojo, yt_engn_truth, yt_learncodeacdm, yt_lvluptuts, yt_funfunfunct, yt_codingtuts360, yt_codingtrain, yt_derekbanas, yt_simplilearn, yt_simpleprog, yt_mozillahacks, yt_googledevs, yt_other, hours_learning, months_programming, bootcamp_attend, bootcamp_name, bootcamp_finished, bootcamp_have_loan, bootcamp_recommend, money_for_learning, age, gender, gender_other, country_citizen, country_live, live_city_population, is_ethnic_minority, lang_at_home, school_degree, school_major, marital_status, has_finance_depends, has_children, num_children, do_finance_support, debt_amt, home_mrtg_has, home_mrtg_owe, student_debt_has, student_debt_amt, curr_emplymnt, curr_emplymnt_other, curr_field, last_yr_income, communite_time, is_self_employed, has_served_military, is_recv_disab_bnft, has_high_spd_ntnet, time_start, time_end, network_id, time_total_sec) VALUES

[…]

(Background on this error at: http://sqlalche.me/e/13/e3q8)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/fedora/superset/venv/bin/superset", line 11, in <module>
    load_entry_point('apache-superset==1.0.1', 'console_scripts', 'superset')()
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/flask/cli.py", line 426, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/cli.py", line 187, in load_examples
    load_examples_run(load_test_data, only_metadata, force)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/cli.py", line 171, in load_examples_run
    examples.load_from_configs(force)
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/examples/utils.py", line 30, in load_from_configs
    command.run()
  File "/home/fedora/superset/venv/lib64/python3.8/site-packages/superset/commands/importers/v1/examples.py", line 71, in run
    raise self.import_error()
superset.commands.exceptions.CommandException

Weirdly, the solution seems to be… running superset load-examples again.

  1. Test suite not passing
# Following https://github.com/apache/superset/blob/master/CONTRIBUTING.md#setup-local-environment-for-development

git clone git@github.com:apache/superset.git
cd superset
git checkout 1.0.1 # to make things reproducible

sudo dnf install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel # as per https://superset.apache.org/docs/installation/installing-superset-from-scratch#os-dependencies
sudo dnf -y install mariadb-devel # FIX as per https://stackoverflow.com/q/22949654/5433628

python3.8 -m venv venv
source venv/bin/activate
pip install -r requirements/local.txt
pip install .

superset fab create-admin --username admin --firstname Ad --lastname Ministrator --email admin@email.com --password secret # FIX explicitely create an admin user with username exactly `admin`
superset db upgrade
superset init
superset load-examples || superset load-examples # FIX

pip install -r requirements/testing.txt # FIX as, btw, this isn't specified but otherwise `tox` isn't installed
tox -e py38

and this fails:

[…]
======================================================= test session starts =======================================================
platform linux -- Python 3.8.7, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
cachedir: .tox/py38/.pytest_cache
rootdir: /home/fedora/superset, configfile: pytest.ini, testpaths: tests
plugins: cov-2.10.1, celery-4.4.7
collected 1194 items
[…]
=========================== short test summary info ============================
FAILED tests/cache_tests.py::TestCache::test_no_data_cache - redis.exceptions...
FAILED tests/cache_tests.py::TestCache::test_slice_data_cache - redis.excepti...
FAILED tests/celery_tests.py::test_run_async_cta_query[TABLE] - sqlalchemy.ex...
FAILED tests/celery_tests.py::test_run_async_cta_query[VIEW] - sqlalchemy.exc...
FAILED tests/celery_tests.py::test_run_async_cta_query_with_lower_limit[TABLE]
FAILED tests/celery_tests.py::test_run_async_cta_query_with_lower_limit[VIEW]
FAILED tests/core_tests.py::TestCore::test_annotation_json_endpoint - Excepti...
FAILED tests/core_tests.py::TestCore::test_cache_logging - AttributeError: 'N...
FAILED tests/core_tests.py::TestCore::test_explore_json - AssertionError: 500...
FAILED tests/core_tests.py::TestCore::test_explore_json_async - AssertionErro...
FAILED tests/core_tests.py::TestCore::test_explore_json_async_results_format
FAILED tests/core_tests.py::TestCore::test_explore_json_data - AssertionError...
FAILED tests/core_tests.py::TestCore::test_explore_json_data_invalid_cache_key
FAILED tests/core_tests.py::TestCore::test_explore_json_dist_bar_order - KeyE...
FAILED tests/druid_tests.py::TestDruid::test_client - Exception: http request...
FAILED tests/druid_tests.py::TestDruid::test_druid_time_granularities - Excep...
FAILED tests/import_export_tests.py::TestImportExport::test_import_new_dashboard_slice_reset_ownership
FAILED tests/import_export_tests.py::TestImportExport::test_import_override_dashboard_slice_reset_ownership
FAILED tests/import_export_tests.py::TestImportExport::test_import_slices_override
FAILED tests/query_context_tests.py::TestQueryContext::test_cache - redis.exc...
FAILED tests/query_context_tests.py::TestQueryContext::test_csv_response_format
FAILED tests/query_context_tests.py::TestQueryContext::test_query_object_unknown_fields
FAILED tests/query_context_tests.py::TestQueryContext::test_samples_response_type
FAILED tests/query_context_tests.py::TestQueryContext::test_sql_injection_via_columns
FAILED tests/query_context_tests.py::TestQueryContext::test_sql_injection_via_groupby
FAILED tests/query_context_tests.py::TestQueryContext::test_sql_injection_via_metrics
FAILED tests/security_tests.py::TestRolePermission::test_alpha_permissions - ...
FAILED tests/security_tests.py::TestRolePermission::test_gamma_permissions - ...
FAILED tests/security_tests.py::TestRolePermission::test_gamma_permissions_basic
FAILED tests/security_tests.py::TestRolePermission::test_gamma_user_schema_access_to_tables
FAILED tests/security_tests.py::TestRolePermission::test_granter_permissions
FAILED tests/security_tests.py::TestRolePermission::test_hybrid_perm_database
FAILED tests/security_tests.py::TestRolePermission::test_hybrid_perm_druid_cluster
FAILED tests/security_tests.py::TestRolePermission::test_is_admin_only - Attr...
FAILED tests/security_tests.py::TestRolePermission::test_is_alpha_only - Attr...
FAILED tests/security_tests.py::TestRolePermission::test_is_gamma_pvm - Attri...
FAILED tests/security_tests.py::TestRolePermission::test_public_permissions_basic
FAILED tests/security_tests.py::TestRolePermission::test_public_sync_role_builtin_perms
FAILED tests/security_tests.py::TestRolePermission::test_public_sync_role_data_perms
FAILED tests/security_tests.py::TestRolePermission::test_schemas_accessible_by_user_admin
FAILED tests/security_tests.py::TestRolePermission::test_schemas_accessible_by_user_datasource_access
FAILED tests/security_tests.py::TestRolePermission::test_schemas_accessible_by_user_datasource_and_schema_access
FAILED tests/security_tests.py::TestRolePermission::test_schemas_accessible_by_user_schema_access
FAILED tests/security_tests.py::TestRolePermission::test_set_perm_database - ...
FAILED tests/security_tests.py::TestRolePermission::test_set_perm_druid_cluster
FAILED tests/security_tests.py::TestRolePermission::test_set_perm_slice - Att...
FAILED tests/security_tests.py::TestRolePermission::test_set_perm_sqla_table
FAILED tests/security_tests.py::TestRolePermission::test_sql_lab_permissions
FAILED tests/security_tests.py::TestRolePermission::test_sqllab_gamma_user_schema_access_to_sqllab
FAILED tests/security_tests.py::TestRolePermission::test_views_are_secured - ...
FAILED tests/utils_tests.py::TestUtils::test_log_this - Exception: http reque...
FAILED tests/annotation_layers/api_tests.py::TestAnnotationLayerApi::test_get_list_annotation_layer
FAILED tests/cachekeys/api_tests.py::test_invalidate_existing_cache - redis.e...
FAILED tests/cachekeys/api_tests.py::test_invalidate_existing_caches - redis....
FAILED tests/databases/api_tests.py::TestDatabaseApi::test_database_schemas
FAILED tests/databases/api_tests.py::TestDatabaseApi::test_update_database - ...
FAILED tests/databases/api_tests.py::TestDatabaseApi::test_update_database_uri_validate
FAILED tests/databases/commands_tests.py::TestExportDatabasesCommand::test_export_database_command
FAILED tests/tasks/async_queries_tests.py::TestAsyncQueries::test_load_chart_data_into_cache
FAILED tests/tasks/async_queries_tests.py::TestAsyncQueries::test_load_explore_json_into_cache
ERROR tests/access_tests.py::TestRequestAccess::test_clean_requests_after_schema_grant
ERROR tests/base_api_tests.py::TestBaseModelRestApi::test_default_missing_declaration_get
ERROR tests/base_api_tests.py::TestBaseModelRestApi::test_default_missing_declaration_put
ERROR tests/celery_tests.py::test_run_async_cta_query[TABLE] - sqlalchemy.exc...
ERROR tests/celery_tests.py::test_run_async_cta_query[VIEW] - sqlalchemy.exc....
ERROR tests/celery_tests.py::test_run_async_cta_query_with_lower_limit[TABLE]
ERROR tests/celery_tests.py::test_run_async_cta_query_with_lower_limit[VIEW]
ERROR tests/core_tests.py::TestCore::test_feature_flag_serialization - sqlalc...
ERROR tests/dashboard_tests.py::TestDashboard::test_save_dash_with_filter - s...
ERROR tests/dashboard_tests.py::TestDashboard::test_save_dash_with_invalid_filters
ERROR tests/import_export_tests.py::TestImportExport::test_export_2_dashboards
ERROR tests/import_export_tests.py::TestImportExport::test_import_1_slice - s...
ERROR tests/import_export_tests.py::TestImportExport::test_import_2_slices_for_same_table
ERROR tests/import_export_tests.py::TestImportExport::test_import_dashboard_1_slice
ERROR tests/schedules_test.py::TestSchedules::test_dashboard_chrome_like - sq...
ERROR tests/schedules_test.py::TestSchedules::test_deliver_dashboard_as_attachment
ERROR tests/schedules_test.py::TestSchedules::test_deliver_dashboard_inline
ERROR tests/schedules_test.py::TestSchedules::test_deliver_email_options - sq...
ERROR tests/schedules_test.py::TestSchedules::test_deliver_slice_attachment
ERROR tests/schedules_test.py::TestSchedules::test_deliver_slice_csv_attachment
ERROR tests/schedules_test.py::TestSchedules::test_deliver_slice_csv_inline
ERROR tests/schedules_test.py::TestSchedules::test_deliver_slice_inline_image
ERROR tests/security_tests.py::TestRolePermission::test_admin_permissions - s...
ERROR tests/security_tests.py::TestRolePermission::test_gamma_user_schema_access_to_charts
ERROR tests/security_tests.py::TestRolePermission::test_gamma_user_schema_access_to_dashboards
ERROR tests/security_tests.py::TestRolePermission::test_set_perm_druid_datasource
ERROR tests/utils_tests.py::TestUtils::test_build_extra_filters - sqlalchemy....
ERROR tests/charts/api_tests.py::TestChartApi::test_admin_gets_filtered_energy_slices
ERROR tests/charts/api_tests.py::TestChartApi::test_bulk_delete_chart_with_report
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_annotations - ...
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_applied_time_extras
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_async - redis....
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_async_invalid_token
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_async_results_type
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_cache - redis....
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_cache_key_error
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_cache_no_login
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_cache_run_failed
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_csv_result_format
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_default_row_limit
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_default_sample_limit
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_incorrect_request
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_incorrect_result_format
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_incorrect_result_type
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_invalid_form_data
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_jinja_filter_request
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_limit_offset
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_mixed_case_filter_op
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_no_data - redi...
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_prophet - redi...
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_query_missing_filter
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_query_result_type
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_rowcount - red...
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_simple - redis...
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_timegrains - r...
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_with_invalid_datasource
ERROR tests/charts/api_tests.py::TestChartApi::test_chart_data_with_invalid_enum_value
ERROR tests/charts/api_tests.py::TestChartApi::test_create_chart - redis.exce...
ERROR tests/charts/api_tests.py::TestChartApi::test_create_chart_validate_datasource
ERROR tests/charts/api_tests.py::TestChartApi::test_create_chart_validate_owners
ERROR tests/charts/api_tests.py::TestChartApi::test_create_chart_validate_params
ERROR tests/charts/api_tests.py::TestChartApi::test_create_simple_chart - red...
ERROR tests/charts/api_tests.py::TestChartApi::test_delete_bulk_chart_admin_not_owned
ERROR tests/charts/api_tests.py::TestChartApi::test_delete_bulk_chart_bad_request
ERROR tests/charts/api_tests.py::TestChartApi::test_delete_bulk_chart_not_owned
ERROR tests/charts/api_tests.py::TestChartApi::test_delete_bulk_charts - redi...
ERROR tests/charts/api_tests.py::TestChartApi::test_delete_bulk_charts_not_found
ERROR tests/charts/api_tests.py::TestChartApi::test_delete_chart - redis.exce...
ERROR tests/charts/api_tests.py::TestChartApi::test_delete_chart_admin_not_owned
ERROR tests/charts/api_tests.py::TestChartApi::test_delete_chart_not_owned - ...
ERROR tests/charts/api_tests.py::TestChartApi::test_delete_chart_with_report
ERROR tests/charts/api_tests.py::TestChartApi::test_delete_not_found_chart - ...
ERROR tests/charts/api_tests.py::TestChartApi::test_export_chart - redis.exce...
ERROR tests/charts/api_tests.py::TestChartApi::test_export_chart_gamma - redi...
ERROR tests/charts/api_tests.py::TestChartApi::test_export_chart_not_found - ...
ERROR tests/charts/api_tests.py::TestChartApi::test_get_chart - redis.excepti...
ERROR tests/charts/api_tests.py::TestChartApi::test_get_chart_no_data_access
ERROR tests/charts/api_tests.py::TestChartApi::test_get_chart_not_found - red...
ERROR tests/charts/api_tests.py::TestChartApi::test_get_charts - redis.except...
ERROR tests/charts/api_tests.py::TestChartApi::test_get_charts_changed_on - r...
ERROR tests/charts/api_tests.py::TestChartApi::test_get_charts_custom_filter
ERROR tests/charts/api_tests.py::TestChartApi::test_get_charts_favorite_filter
ERROR tests/charts/api_tests.py::TestChartApi::test_get_charts_filter - redis...
ERROR tests/charts/api_tests.py::TestChartApi::test_get_charts_no_data_access
ERROR tests/charts/api_tests.py::TestChartApi::test_get_charts_page - redis.e...
ERROR tests/charts/api_tests.py::TestChartApi::test_get_current_user_favorite_status
ERROR tests/charts/api_tests.py::TestChartApi::test_get_filter_related_owners
ERROR tests/charts/api_tests.py::TestChartApi::test_get_ids_related_owners - ...
ERROR tests/charts/api_tests.py::TestChartApi::test_get_related_fail - redis....
ERROR tests/charts/api_tests.py::TestChartApi::test_get_related_owners - redi...
ERROR tests/charts/api_tests.py::TestChartApi::test_get_repeated_ids_related_owners
ERROR tests/charts/api_tests.py::TestChartApi::test_get_time_range - redis.ex...
ERROR tests/charts/api_tests.py::TestChartApi::test_import_chart - redis.exce...
ERROR tests/charts/api_tests.py::TestChartApi::test_import_chart_invalid - re...
ERROR tests/charts/api_tests.py::TestChartApi::test_import_chart_overwrite - ...
ERROR tests/charts/api_tests.py::TestChartApi::test_info_security_chart - red...
ERROR tests/charts/api_tests.py::TestChartApi::test_not_update_chart_none_dashboards
ERROR tests/charts/api_tests.py::TestChartApi::test_query_exec_not_allowed - ...
ERROR tests/charts/api_tests.py::TestChartApi::test_update_chart - redis.exce...
ERROR tests/charts/api_tests.py::TestChartApi::test_update_chart_new_dashboards
ERROR tests/charts/api_tests.py::TestChartApi::test_update_chart_new_owner - ...
ERROR tests/charts/api_tests.py::TestChartApi::test_update_chart_not_owned - ...
ERROR tests/charts/api_tests.py::TestChartApi::test_update_chart_validate_datasource
ERROR tests/charts/api_tests.py::TestChartApi::test_update_chart_validate_owners
ERROR tests/charts/api_tests.py::TestChartApi::test_user_gets_none_filtered_energy_slices
ERROR tests/dashboards/api_tests.py::TestDashboardApi::test_export - sqlalche...
ERROR tests/dashboards/api_tests.py::TestDashboardApi::test_get_dashboard_not_found
ERROR tests/dashboards/commands_tests.py::TestExportDashboardsCommand::test_append_charts
ERROR tests/dashboards/commands_tests.py::TestExportDashboardsCommand::test_export_dashboard_command
ERROR tests/dashboards/commands_tests.py::TestExportDashboardsCommand::test_export_dashboard_command_invalid_dataset
ERROR tests/dashboards/commands_tests.py::TestExportDashboardsCommand::test_export_dashboard_command_key_order
ERROR tests/dashboards/commands_tests.py::TestExportDashboardsCommand::test_export_dashboard_command_no_access
ERROR tests/dashboards/dao_tests.py::TestDashboardDAO::test_set_dash_metadata
ERROR tests/databases/api_tests.py::TestDatabaseApi::test_get_database_related_objects
ERROR tests/datasets/commands_tests.py::TestImportDatasetsCommand::test_import_v0_dataset_cli_export
ERROR tests/datasets/commands_tests.py::TestImportDatasetsCommand::test_import_v0_dataset_ui_export
ERROR tests/reports/commands_tests.py::test_email_chart_report_schedule - sql...
ERROR tests/reports/commands_tests.py::test_email_dashboard_report_schedule
ERROR tests/reports/commands_tests.py::test_slack_chart_report_schedule - sql...
ERROR tests/reports/commands_tests.py::test_report_schedule_not_found - sqlal...
ERROR tests/reports/commands_tests.py::test_report_schedule_working - sqlalch...
ERROR tests/reports/commands_tests.py::test_report_schedule_working_timeout
ERROR tests/reports/commands_tests.py::test_report_schedule_success_grace - s...
ERROR tests/reports/commands_tests.py::test_report_schedule_success_grace_end
ERROR tests/reports/commands_tests.py::test_alert_limit_is_applied[alert1] - ...
ERROR tests/reports/commands_tests.py::test_alert_limit_is_applied[alert2] - ...
ERROR tests/reports/commands_tests.py::test_alert_limit_is_applied[alert3] - ...
ERROR tests/reports/commands_tests.py::test_alert_limit_is_applied[alert4] - ...
ERROR tests/reports/commands_tests.py::test_alert_limit_is_applied[alert5] - ...
ERROR tests/reports/commands_tests.py::test_alert_limit_is_applied[alert6] - ...
ERROR tests/reports/commands_tests.py::test_alert_limit_is_applied[alert7] - ...
ERROR tests/reports/commands_tests.py::test_email_dashboard_report_fails - sq...
ERROR tests/reports/commands_tests.py::test_slack_chart_alert[alert1] - sqlal...
ERROR tests/reports/commands_tests.py::test_slack_chart_alert[alert2] - sqlal...
ERROR tests/reports/commands_tests.py::test_slack_chart_alert[alert3] - sqlal...
ERROR tests/reports/commands_tests.py::test_slack_chart_alert[alert4] - sqlal...
ERROR tests/reports/commands_tests.py::test_slack_chart_alert[alert5] - sqlal...
ERROR tests/reports/commands_tests.py::test_slack_chart_alert[alert6] - sqlal...
ERROR tests/reports/commands_tests.py::test_slack_chart_alert[alert7] - sqlal...
ERROR tests/reports/commands_tests.py::test_email_chart_no_alert[alert1] - sq...
ERROR tests/reports/commands_tests.py::test_email_chart_no_alert[alert2] - sq...
ERROR tests/reports/commands_tests.py::test_email_chart_no_alert[alert3] - sq...
ERROR tests/reports/commands_tests.py::test_email_chart_no_alert[alert4] - sq...
ERROR tests/reports/commands_tests.py::test_email_chart_no_alert[alert5] - sq...
ERROR tests/reports/commands_tests.py::test_email_chart_no_alert[alert6] - sq...
ERROR tests/reports/commands_tests.py::test_email_chart_no_alert[alert7] - sq...
ERROR tests/reports/commands_tests.py::test_email_chart_no_alert[alert8] - sq...
ERROR tests/reports/commands_tests.py::test_email_chart_no_alert[alert9] - sq...
ERROR tests/reports/commands_tests.py::test_email_mul_alert[alert1] - sqlalch...
ERROR tests/reports/commands_tests.py::test_email_mul_alert[alert2] - sqlalch...
ERROR tests/reports/commands_tests.py::test_invalid_sql_alert[alert1] - sqlal...
ERROR tests/reports/commands_tests.py::test_invalid_sql_alert[alert2] - sqlal...
= 60 failed, 1113 passed, 16 skipped, 229 warnings, 152 errors in 1043.72s (0:17:23) =
ERROR: InvocationError for command /home/fedora/superset/.tox/py38/bin/pytest -s (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   py38: commands failed

One could also run the shell script to run tests faster:

# Following https://github.com/apache/superset/blob/master/CONTRIBUTING.md#setup-local-environment-for-development

git clone git@github.com:apache/superset.git
cd superset
git checkout 1.0.1 # to make things reproducible

sudo dnf install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel # as per https://superset.apache.org/docs/installation/installing-superset-from-scratch#os-dependencies
sudo dnf -y install mariadb-devel # FIX as per https://stackoverflow.com/q/22949654/5433628

python3.8 -m venv venv
source venv/bin/activate
pip install -r requirements/local.txt
pip install .

superset fab create-admin --username admin --firstname Ad --lastname Ministrator --email admin@email.com --password secret # FIX explicitely create an admin user with username exactly `admin`
superset db upgrade
superset init
superset load-examples || superset load-examples # FIX

pip install -r requirements/testing.txt # FIX as, btw, this isn't specified but otherwise `tox` isn't installed
scripts/tests/run.sh

but then it misses some OS dependencies:

------------------------------------
DB_URI=postgresql+psycopg2://superset:superset@localhost/test
Superset config module=tests.superset_test_config
Run init procedures=1
Run reset DB=1
Test to run:tests
------------------------------------
--------------------
Reseting test DB
--------------------
scripts/tests/run.sh: line 29: docker-compose: command not found
scripts/tests/run.sh: line 40: docker: command not found

So after installing it and setting it up:

# Following https://github.com/apache/superset/blob/master/CONTRIBUTING.md#setup-local-environment-for-development

git clone git@github.com:apache/superset.git
cd superset
git checkout 1.0.1 # to make things reproducible

sudo dnf install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel cyrus-sasl-devel openldap-devel # as per https://superset.apache.org/docs/installation/installing-superset-from-scratch#os-dependencies
sudo dnf -y install mariadb-devel # FIX as per https://stackoverflow.com/q/22949654/5433628

# FIX install docker as per https://docs.docker.com/engine/install/fedora/
sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl enable docker
sudo groupadd docker
sudo usermod -aG docker $USER
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

sudo reboot

python3.8 -m venv venv
source venv/bin/activate
pip install -r requirements/local.txt
pip install .

superset fab create-admin --username admin --firstname Ad --lastname Ministrator --email admin@email.com --password secret # FIX explicitely create an admin user with username exactly `admin`
superset db upgrade
superset init
superset load-examples || superset load-examples # FIX

pip install -r requirements/testing.txt # FIX as, btw, this isn't specified but otherwise `tox` isn't installed
scripts/tests/run.sh

But I get

scripts/tests/run.sh
------------------------------------
DB_URI=postgresql+psycopg2://superset:superset@localhost/test
Superset config module=tests.superset_test_config
Run init procedures=1
Run reset DB=1
Test to run:tests
------------------------------------
--------------------
Reseting test DB
--------------------
Error: No such container: superset_db

Environment

(please complete the following information):

  • superset version: 1.0.1 (tested with 667eb83 — latest commit passing CI at 2021-04-09T14:58:35Z — as well)
  • python version: 3.8.7
  • node.js version: n/a

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven’t found one similar.

Additional information

It may well be that I’m not reading the instructions correctly!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
EBoisseauSierracommented, May 7, 2021

Thanks @etr2460 for having had a deeper look.

I have uploaded here (⚠️ 91MiB file) the SQLite db generated (in /home/fedora/.superset/superset.db) by the script detailed above.

I’m afraid I won’t be able to prioritise investigating this (i.e. why running the tests fails when installing Superset bare metal) further at the moment, as I’ve been able to solve my actual issue (i.e. “how to run the test suite locally, so that if it passes there, the Github CI will be ok too?”).

To do so, I’ve given up on the “bare metal” install, and went for docker instead. The process is detailed here (kudos to @kleegnik for this!). I now intend to improve the related PR a bit further and close the whole matter once done.

How does that sound to you?

0reactions
stale[bot]commented, May 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit test fail when I run "gradle test" but run in Intellij ...
When I open this project in Intellij, and switch to each single unit test file. All the test can be passed. But when...
Read more >
No tests found for given includes Error, when running ...
Go to Preferences -> Build, Execution, Deployment -> Gradle -> change "Run tests using" to "IntelliJ IDEA". Run your test. Go again to...
Read more >
Run tests | IntelliJ IDEA Documentation
Rerun a single test · Right-click a test on the Test Runner tab of the Run tool window and select Run 'test name'....
Read more >
dotnet test command - .NET CLI
The test host executes tests in the given project using a test framework, for example: MSTest, NUnit, or xUnit, and reports the success...
Read more >
Unit test reports - GitLab Docs
Introduced in GitLab 15.2. You can copy the name and path of failed tests when there are failed tests listed in the Test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found