chore: make flask-talisman work with test config (#29277)

This commit is contained in:
Maxime Beauchemin 2024-06-18 14:46:40 -07:00 committed by GitHub
parent 4537ab6b1a
commit 796726376a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 5 additions and 4 deletions

View File

@ -97,7 +97,6 @@ ALERT_REPORTS_NOTIFICATION_DRY_RUN = True
WEBDRIVER_BASEURL = "http://superset:8088/" # When using docker compose baseurl should be http://superset_app:8088/ WEBDRIVER_BASEURL = "http://superset:8088/" # When using docker compose baseurl should be http://superset_app:8088/
# The base URL for the email report hyperlinks. # The base URL for the email report hyperlinks.
WEBDRIVER_BASEURL_USER_FRIENDLY = WEBDRIVER_BASEURL WEBDRIVER_BASEURL_USER_FRIENDLY = WEBDRIVER_BASEURL
SQLLAB_CTAS_NO_LIMIT = True SQLLAB_CTAS_NO_LIMIT = True
# #

View File

@ -61,7 +61,10 @@ function test_init() {
DB_NAME="test" DB_NAME="test"
DB_USER="superset" DB_USER="superset"
DB_PASSWORD="superset" DB_PASSWORD="superset"
# Pointing to use the test database in local docker-compose setup
export SUPERSET__SQLALCHEMY_DATABASE_URI=${SUPERSET__SQLALCHEMY_DATABASE_URI:-postgresql+psycopg2://"${DB_USER}":"${DB_PASSWORD}"@localhost/"${DB_NAME}"} export SUPERSET__SQLALCHEMY_DATABASE_URI=${SUPERSET__SQLALCHEMY_DATABASE_URI:-postgresql+psycopg2://"${DB_USER}":"${DB_PASSWORD}"@localhost/"${DB_NAME}"}
export SUPERSET_CONFIG=${SUPERSET_CONFIG:-tests.integration_tests.superset_test_config} export SUPERSET_CONFIG=${SUPERSET_CONFIG:-tests.integration_tests.superset_test_config}
RUN_INIT=1 RUN_INIT=1
RUN_RESET_DB=1 RUN_RESET_DB=1

View File

@ -261,7 +261,7 @@ WTF_CSRF_EXEMPT_LIST = [
] ]
# Whether to run the web server in debug mode or not # Whether to run the web server in debug mode or not
DEBUG = os.environ.get("FLASK_DEBUG") DEBUG = parse_boolean_string(os.environ.get("FLASK_DEBUG"))
FLASK_USE_RELOAD = True FLASK_USE_RELOAD = True
# Enable profiling of Python calls. Turn this on and append ``?_instrument=1`` # Enable profiling of Python calls. Turn this on and append ``?_instrument=1``

View File

@ -586,7 +586,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
talisman_enabled = self.config["TALISMAN_ENABLED"] talisman_enabled = self.config["TALISMAN_ENABLED"]
talisman_config = ( talisman_config = (
self.config["TALISMAN_DEV_CONFIG"] self.config["TALISMAN_DEV_CONFIG"]
if self.superset_app.debug if self.superset_app.debug or self.config["DEBUG"]
else self.config["TALISMAN_CONFIG"] else self.config["TALISMAN_CONFIG"]
) )
csp_warning = self.config["CONTENT_SECURITY_POLICY_WARNING"] csp_warning = self.config["CONTENT_SECURITY_POLICY_WARNING"]

View File

@ -40,7 +40,6 @@ SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join( # noqa: F405
DATA_DIR, DATA_DIR,
"unittests.integration_tests.db", # noqa: F405 "unittests.integration_tests.db", # noqa: F405
) )
DEBUG = False
SILENCE_FAB = False SILENCE_FAB = False
# Allowing SQLALCHEMY_DATABASE_URI and SQLALCHEMY_EXAMPLES_URI to be defined as an env vars for # Allowing SQLALCHEMY_DATABASE_URI and SQLALCHEMY_EXAMPLES_URI to be defined as an env vars for
# continuous integration # continuous integration