Skip to content

Commit

Permalink
chore: Re-enable asnyc event API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitor-Avila committed Jan 31, 2025
1 parent 5fc11fb commit b58e648
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/integration_tests/async_events/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@
from typing import Any, Optional, Type
from unittest import mock

import pytest

from superset.async_events.cache_backend import (
RedisCacheBackend,
RedisSentinelCacheBackend,
)
from superset.extensions import async_query_manager
from superset.utils import json
from tests.integration_tests.base_tests import SupersetTestCase
from tests.integration_tests.conftest import with_feature_flags
from tests.integration_tests.constants import ADMIN_USERNAME
from tests.integration_tests.test_app import app


@pytest.skip(reason="Needs to investigate this test", allow_module_level=True)
class TestAsyncEventApi(SupersetTestCase):
UUID = "943c920-32a5-412a-977d-b8e47d36f5a4"

Expand Down Expand Up @@ -118,22 +116,26 @@ def _test_events_results_logic(self, mock_cache):
}
assert response == expected

@with_feature_flags(GLOBAL_ASYNC_QUERIES=True)
@mock.patch("uuid.uuid4", return_value=UUID)
def test_events_redis_cache_backend(self, mock_uuid4):
self.run_test_with_cache_backend(RedisCacheBackend, self._test_events_logic)

@with_feature_flags(GLOBAL_ASYNC_QUERIES=True)
@mock.patch("uuid.uuid4", return_value=UUID)
def test_events_redis_sentinel_cache_backend(self, mock_uuid4):
self.run_test_with_cache_backend(
RedisSentinelCacheBackend, self._test_events_logic
)

@with_feature_flags(GLOBAL_ASYNC_QUERIES=True)
def test_events_no_login(self):
app._got_first_request = False
async_query_manager.init_app(app)
rv = self.fetch_events()
assert rv.status_code == 401

@with_feature_flags(GLOBAL_ASYNC_QUERIES=True)
def test_events_no_token(self):
self.login(ADMIN_USERNAME)
self.client.set_cookie(app.config["GLOBAL_ASYNC_QUERIES_JWT_COOKIE_NAME"], "")
Expand Down

0 comments on commit b58e648

Please sign in to comment.