From ef4cf2b430095bb22ddbc4cdb65a8f61e3b4e249 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Tue, 29 Jul 2025 22:36:12 -0700 Subject: [PATCH] remove --max-fail 1 on integration tests to iterate faster --- scripts/python_tests.sh | 2 +- tests/integration_tests/charts/api_tests.py | 6 ++---- tests/integration_tests/charts/commands_tests.py | 2 +- tests/integration_tests/core_tests.py | 2 +- tests/integration_tests/dashboards/api_tests.py | 10 +++++----- .../dashboards/security/security_rbac_tests.py | 8 ++++---- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/scripts/python_tests.sh b/scripts/python_tests.sh index e127d0c0206..6f3f3bddb83 100755 --- a/scripts/python_tests.sh +++ b/scripts/python_tests.sh @@ -33,4 +33,4 @@ superset load-test-users echo "Running tests" -pytest --durations-min=2 --maxfail=1 --cov-report= --cov=superset ./tests/integration_tests "$@" +pytest --durations-min=2 --cov-report= --cov=superset ./tests/integration_tests "$@" diff --git a/tests/integration_tests/charts/api_tests.py b/tests/integration_tests/charts/api_tests.py index 89fb23fc393..18f1af5574f 100644 --- a/tests/integration_tests/charts/api_tests.py +++ b/tests/integration_tests/charts/api_tests.py @@ -1077,9 +1077,7 @@ class TestChartApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCase): """ self.login(GAMMA_USERNAME) chart_no_access = ( - db.session.query(Slice) - .filter_by(slice_name="Girl Name Cloud") - .one_or_none() + db.session.query(Slice).filter_by(slice_name="Trends").one_or_none() ) uri = f"api/v1/chart/{chart_no_access.id}" rv = self.client.get(uri) @@ -2062,7 +2060,7 @@ class TestChartApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCase): @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") def test_warm_up_cache_no_datasource(self) -> None: self.login(ADMIN_USERNAME) - slc = self.get_slice("Top 10 Girl Name Share") + slc = self.get_slice("Genders") with mock.patch.object( Slice, diff --git a/tests/integration_tests/charts/commands_tests.py b/tests/integration_tests/charts/commands_tests.py index f50a9ea9685..1fdbd53859c 100644 --- a/tests/integration_tests/charts/commands_tests.py +++ b/tests/integration_tests/charts/commands_tests.py @@ -426,7 +426,7 @@ class TestChartWarmUpCacheCommand(SupersetTestCase): @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") @pytest.mark.skip(reason="This test will be changed to use the api/v1/data") def test_warm_up_cache(self): - slc = self.get_slice("Top 10 Girl Name Share") + slc = self.get_slice("Genders") result = ChartWarmUpCacheCommand(slc.id, None, None).run() assert result == { "chart_id": slc.id, diff --git a/tests/integration_tests/core_tests.py b/tests/integration_tests/core_tests.py index de276c7e9e8..462d271f48c 100644 --- a/tests/integration_tests/core_tests.py +++ b/tests/integration_tests/core_tests.py @@ -227,7 +227,7 @@ class TestCore(SupersetTestCase): def test_slice_data(self): # slice data should have some required attributes self.login(ADMIN_USERNAME) - slc = self.get_slice(slice_name="Top 10 Girl Name Share") + slc = self.get_slice(slice_name="Genders") slc_data_attributes = slc.data.keys() assert "changed_on" in slc_data_attributes assert "modified" in slc_data_attributes diff --git a/tests/integration_tests/dashboards/api_tests.py b/tests/integration_tests/dashboards/api_tests.py index 2f662c32b93..70488946ce4 100644 --- a/tests/integration_tests/dashboards/api_tests.py +++ b/tests/integration_tests/dashboards/api_tests.py @@ -1489,7 +1489,7 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas "alpha2", "password", "Alpha", email="alpha2@superset.org" ) existing_slice = ( - db.session.query(Slice).filter_by(slice_name="Girl Name Cloud").first() + db.session.query(Slice).filter_by(slice_name="Participants").first() ) dashboard = self.insert_dashboard( "title", "slug1", [user_alpha1.id], slices=[existing_slice], published=True @@ -1515,7 +1515,7 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas "alpha2", "password", "Alpha", email="alpha2@superset.org" ) existing_slice = ( - db.session.query(Slice).filter_by(slice_name="Girl Name Cloud").first() + db.session.query(Slice).filter_by(slice_name="Participants").first() ) dashboard_count = 4 @@ -1985,7 +1985,7 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas admin = self.get_user("admin") slices = [] slices.append(db.session.query(Slice).filter_by(slice_name="Trends").one()) - slices.append(db.session.query(Slice).filter_by(slice_name="Boys").one()) + slices.append(db.session.query(Slice).filter_by(slice_name="Genders").one()) # Insert dashboard with admin as owner dashboard = self.insert_dashboard( @@ -2016,7 +2016,7 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas assert rv.status_code == 200 # Check that chart named Boys does not contain alpha 1 in its owners - boys = db.session.query(Slice).filter_by(slice_name="Boys").one() + boys = db.session.query(Slice).filter_by(slice_name="Genders").one() assert user_alpha1 not in boys.owners # Revert owners on slice @@ -2223,7 +2223,7 @@ class TestDashboardApi(ApiOwnersTestCaseMixin, InsertChartMixin, SupersetTestCas "alpha2", "password", "Alpha", email="alpha2@superset.org" ) existing_slice = ( - db.session.query(Slice).filter_by(slice_name="Girl Name Cloud").first() + db.session.query(Slice).filter_by(slice_name="Participants").first() ) dashboard = self.insert_dashboard( "title", "slug1", [user_alpha1.id], slices=[existing_slice], published=True diff --git a/tests/integration_tests/dashboards/security/security_rbac_tests.py b/tests/integration_tests/dashboards/security/security_rbac_tests.py index 4754854047f..0ae553a7da1 100644 --- a/tests/integration_tests/dashboards/security/security_rbac_tests.py +++ b/tests/integration_tests/dashboards/security/security_rbac_tests.py @@ -100,7 +100,7 @@ class TestDashboardRoleBasedSecurity(BaseTestDashboardSecurity): self.create_user_with_roles(username, [new_role], should_create_roles=True) slice = ( db.session.query(Slice) # noqa: F405 - .filter_by(slice_name="Girl Name Cloud") + .filter_by(slice_name="Participants") .one_or_none() ) dashboard_to_access = create_dashboard_to_db(published=True, slices=[slice]) @@ -141,7 +141,7 @@ class TestDashboardRoleBasedSecurity(BaseTestDashboardSecurity): slice = ( db.session.query(Slice) # noqa: F405 - .filter_by(slice_name="Girl Name Cloud") + .filter_by(slice_name="Participants") .one_or_none() ) dashboard = create_dashboard_to_db(published=True, slices=[slice]) @@ -164,7 +164,7 @@ class TestDashboardRoleBasedSecurity(BaseTestDashboardSecurity): slice = ( db.session.query(Slice) # noqa: F405 - .filter_by(slice_name="Girl Name Cloud") + .filter_by(slice_name="Participants") .one_or_none() ) dashboard = create_dashboard_to_db(published=True, slices=[slice]) @@ -192,7 +192,7 @@ class TestDashboardRoleBasedSecurity(BaseTestDashboardSecurity): slice = ( db.session.query(Slice) # noqa: F405 - .filter_by(slice_name="Girl Name Cloud") + .filter_by(slice_name="Participants") .one_or_none() ) dashboard_to_access = create_dashboard_to_db(published=True, slices=[slice])