diff --git a/discovery-provider/.vscode/settings.json b/discovery-provider/.vscode/settings.json index 12b47db8ba4..4c47a9a31d1 100644 --- a/discovery-provider/.vscode/settings.json +++ b/discovery-provider/.vscode/settings.json @@ -15,9 +15,10 @@ "python.languageServer": "Pylance", "editor.tabSize": 4, "python.testing.pytestArgs": [ - "tests" + "src", + "integration_tests" ], "python.testing.unittestEnabled": false, "python.testing.nosetestsEnabled": false, "python.testing.pytestEnabled": true -} \ No newline at end of file +} diff --git a/discovery-provider/tests/__init__.py b/discovery-provider/integration_tests/__init__.py similarity index 100% rename from discovery-provider/tests/__init__.py rename to discovery-provider/integration_tests/__init__.py diff --git a/discovery-provider/tests/resolve_url_test.py b/discovery-provider/integration_tests/api/v1/utils/resolve_url_test.py similarity index 100% rename from discovery-provider/tests/resolve_url_test.py rename to discovery-provider/integration_tests/api/v1/utils/resolve_url_test.py diff --git a/discovery-provider/tests/index_helpers.py b/discovery-provider/integration_tests/challenges/index_helpers.py similarity index 100% rename from discovery-provider/tests/index_helpers.py rename to discovery-provider/integration_tests/challenges/index_helpers.py diff --git a/discovery-provider/tests/test_challenges.py b/discovery-provider/integration_tests/challenges/test_challenges.py similarity index 99% rename from discovery-provider/tests/test_challenges.py rename to discovery-provider/integration_tests/challenges/test_challenges.py index 80bd6b4d0db..2e061237fdb 100644 --- a/discovery-provider/tests/test_challenges.py +++ b/discovery-provider/integration_tests/challenges/test_challenges.py @@ -4,8 +4,8 @@ from sqlalchemy.orm.session import Session import redis -from tests.test_get_challenges import DefaultUpdater -from tests.utils import populate_mock_db_blocks +from integration_tests.queries.test_get_challenges import DefaultUpdater +from integration_tests.utils import populate_mock_db_blocks from src.models.models import Block from src.models import Challenge, UserChallenge, ChallengeType diff --git a/discovery-provider/tests/test_connect_verified_challenge.py b/discovery-provider/integration_tests/challenges/test_connect_verified_challenge.py similarity index 100% rename from discovery-provider/tests/test_connect_verified_challenge.py rename to discovery-provider/integration_tests/challenges/test_connect_verified_challenge.py diff --git a/discovery-provider/tests/test_create_new_challenges.py b/discovery-provider/integration_tests/challenges/test_create_new_challenges.py similarity index 100% rename from discovery-provider/tests/test_create_new_challenges.py rename to discovery-provider/integration_tests/challenges/test_create_new_challenges.py diff --git a/discovery-provider/tests/test_listen_streak_challenge.py b/discovery-provider/integration_tests/challenges/test_listen_streak_challenge.py similarity index 100% rename from discovery-provider/tests/test_listen_streak_challenge.py rename to discovery-provider/integration_tests/challenges/test_listen_streak_challenge.py diff --git a/discovery-provider/tests/test_mobile_install_challenge.py b/discovery-provider/integration_tests/challenges/test_mobile_install_challenge.py similarity index 100% rename from discovery-provider/tests/test_mobile_install_challenge.py rename to discovery-provider/integration_tests/challenges/test_mobile_install_challenge.py diff --git a/discovery-provider/tests/test_profile_completion_challenge.py b/discovery-provider/integration_tests/challenges/test_profile_completion_challenge.py similarity index 100% rename from discovery-provider/tests/test_profile_completion_challenge.py rename to discovery-provider/integration_tests/challenges/test_profile_completion_challenge.py diff --git a/discovery-provider/tests/test_referral_challenge.py b/discovery-provider/integration_tests/challenges/test_referral_challenge.py similarity index 100% rename from discovery-provider/tests/test_referral_challenge.py rename to discovery-provider/integration_tests/challenges/test_referral_challenge.py diff --git a/discovery-provider/tests/test_track_upload_challenge.py b/discovery-provider/integration_tests/challenges/test_track_upload_challenge.py similarity index 100% rename from discovery-provider/tests/test_track_upload_challenge.py rename to discovery-provider/integration_tests/challenges/test_track_upload_challenge.py diff --git a/discovery-provider/tests/test_trending_challenge.py b/discovery-provider/integration_tests/challenges/test_trending_challenge.py similarity index 99% rename from discovery-provider/tests/test_trending_challenge.py rename to discovery-provider/integration_tests/challenges/test_trending_challenge.py index d621ad12863..4ab84b65a0c 100644 --- a/discovery-provider/tests/test_trending_challenge.py +++ b/discovery-provider/integration_tests/challenges/test_trending_challenge.py @@ -18,7 +18,7 @@ from src.tasks.calculate_trending_challenges import enqueue_trending_challenges from src.tasks.index_aggregate_plays import _update_aggregate_plays from src.trending_strategies.trending_strategy_factory import TrendingStrategyFactory -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db REDIS_URL = shared_config["redis"]["url"] logger = logging.getLogger(__name__) diff --git a/discovery-provider/tests/conftest.py b/discovery-provider/integration_tests/conftest.py similarity index 100% rename from discovery-provider/tests/conftest.py rename to discovery-provider/integration_tests/conftest.py diff --git a/discovery-provider/tests/test_model_validator.py b/discovery-provider/integration_tests/models/test_model_validator.py similarity index 96% rename from discovery-provider/tests/test_model_validator.py rename to discovery-provider/integration_tests/models/test_model_validator.py index fca78d4ed55..2cde6e8ff8d 100644 --- a/discovery-provider/tests/test_model_validator.py +++ b/discovery-provider/integration_tests/models/test_model_validator.py @@ -73,7 +73,7 @@ def test_schema_missing(): def test_schema_invalid_json(): - ModelValidator.BASE_PATH = "./tests/res/" + ModelValidator.BASE_PATH = "./integration_tests/res/" try: ModelValidator.validate(to_validate={}, field="title", model="bad") assert False, "test_model_validator [test_schema_invalid_json] failed" @@ -82,7 +82,7 @@ def test_schema_invalid_json(): def test_schema_missing_model_key(): - ModelValidator.BASE_PATH = "./tests/res/" + ModelValidator.BASE_PATH = "./integration_tests/res/" try: ModelValidator.validate(to_validate={}, field="title", model="user_bad") diff --git a/discovery-provider/tests/test_track_tag_mat_view.py b/discovery-provider/integration_tests/models/test_track_tag_mat_view.py similarity index 97% rename from discovery-provider/tests/test_track_tag_mat_view.py rename to discovery-provider/integration_tests/models/test_track_tag_mat_view.py index 1c12a431063..5838c984c39 100644 --- a/discovery-provider/tests/test_track_tag_mat_view.py +++ b/discovery-provider/integration_tests/models/test_track_tag_mat_view.py @@ -2,7 +2,7 @@ from src.models import TagTrackUserMatview from src.utils.db_session import get_db -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db def test_track_tag_mat_view(app): diff --git a/discovery-provider/tests/test_get_aggregate_app_metrics.py b/discovery-provider/integration_tests/queries/test_get_aggregate_app_metrics.py similarity index 100% rename from discovery-provider/tests/test_get_aggregate_app_metrics.py rename to discovery-provider/integration_tests/queries/test_get_aggregate_app_metrics.py diff --git a/discovery-provider/tests/test_get_aggregate_route_metrics.py b/discovery-provider/integration_tests/queries/test_get_aggregate_route_metrics.py similarity index 100% rename from discovery-provider/tests/test_get_aggregate_route_metrics.py rename to discovery-provider/integration_tests/queries/test_get_aggregate_route_metrics.py diff --git a/discovery-provider/tests/test_get_aggregate_route_metrics_trailing_month.py b/discovery-provider/integration_tests/queries/test_get_aggregate_route_metrics_trailing_month.py similarity index 100% rename from discovery-provider/tests/test_get_aggregate_route_metrics_trailing_month.py rename to discovery-provider/integration_tests/queries/test_get_aggregate_route_metrics_trailing_month.py diff --git a/discovery-provider/tests/test_get_app_name_metrics.py b/discovery-provider/integration_tests/queries/test_get_app_name_metrics.py similarity index 100% rename from discovery-provider/tests/test_get_app_name_metrics.py rename to discovery-provider/integration_tests/queries/test_get_app_name_metrics.py diff --git a/discovery-provider/tests/test_get_attestation.py b/discovery-provider/integration_tests/queries/test_get_attestation.py similarity index 98% rename from discovery-provider/tests/test_get_attestation.py rename to discovery-provider/integration_tests/queries/test_get_attestation.py index 321d368f0f9..c59f2c1a0dc 100644 --- a/discovery-provider/tests/test_get_attestation.py +++ b/discovery-provider/integration_tests/queries/test_get_attestation.py @@ -19,7 +19,7 @@ from src.utils.config import shared_config from src.tasks.index_oracles import oracle_addresses_key -from tests.test_get_challenges import setup_db +from integration_tests.queries.test_get_challenges import setup_db REDIS_URL = shared_config["redis"]["url"] redis_handle = redis.Redis.from_url(url=REDIS_URL) diff --git a/discovery-provider/tests/test_get_challenges.py b/discovery-provider/integration_tests/queries/test_get_challenges.py similarity index 100% rename from discovery-provider/tests/test_get_challenges.py rename to discovery-provider/integration_tests/queries/test_get_challenges.py diff --git a/discovery-provider/tests/test_get_genre_metrics.py b/discovery-provider/integration_tests/queries/test_get_genre_metrics.py similarity index 100% rename from discovery-provider/tests/test_get_genre_metrics.py rename to discovery-provider/integration_tests/queries/test_get_genre_metrics.py diff --git a/discovery-provider/tests/test_get_historical_app_metrics.py b/discovery-provider/integration_tests/queries/test_get_historical_app_metrics.py similarity index 100% rename from discovery-provider/tests/test_get_historical_app_metrics.py rename to discovery-provider/integration_tests/queries/test_get_historical_app_metrics.py diff --git a/discovery-provider/tests/test_get_historical_route_metrics.py b/discovery-provider/integration_tests/queries/test_get_historical_route_metrics.py similarity index 100% rename from discovery-provider/tests/test_get_historical_route_metrics.py rename to discovery-provider/integration_tests/queries/test_get_historical_route_metrics.py diff --git a/discovery-provider/tests/test_get_history_for_user.py b/discovery-provider/integration_tests/queries/test_get_history_for_user.py similarity index 98% rename from discovery-provider/tests/test_get_history_for_user.py rename to discovery-provider/integration_tests/queries/test_get_history_for_user.py index ddf546feb3d..667181012b5 100644 --- a/discovery-provider/tests/test_get_history_for_user.py +++ b/discovery-provider/integration_tests/queries/test_get_history_for_user.py @@ -1,6 +1,6 @@ from src.queries.get_track_history import _get_track_history from src.utils.db_session import get_db -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db test_entities = { "plays": [ diff --git a/discovery-provider/tests/test_get_plays_metrics.py b/discovery-provider/integration_tests/queries/test_get_plays_metrics.py similarity index 100% rename from discovery-provider/tests/test_get_plays_metrics.py rename to discovery-provider/integration_tests/queries/test_get_plays_metrics.py diff --git a/discovery-provider/tests/test_get_related_artists.py b/discovery-provider/integration_tests/queries/test_get_related_artists.py similarity index 99% rename from discovery-provider/tests/test_get_related_artists.py rename to discovery-provider/integration_tests/queries/test_get_related_artists.py index e2d7d0cc35d..4b73efcf0d8 100644 --- a/discovery-provider/tests/test_get_related_artists.py +++ b/discovery-provider/integration_tests/queries/test_get_related_artists.py @@ -9,7 +9,7 @@ ) from src.utils.db_session import get_db -from .utils import populate_mock_db +from integration_tests.utils import populate_mock_db entities = { diff --git a/discovery-provider/tests/test_get_repost_feed_for_user.py b/discovery-provider/integration_tests/queries/test_get_repost_feed_for_user.py similarity index 99% rename from discovery-provider/tests/test_get_repost_feed_for_user.py rename to discovery-provider/integration_tests/queries/test_get_repost_feed_for_user.py index 7c0131ea4e4..eb6b801a5fb 100644 --- a/discovery-provider/tests/test_get_repost_feed_for_user.py +++ b/discovery-provider/integration_tests/queries/test_get_repost_feed_for_user.py @@ -1,6 +1,6 @@ from src.queries.get_repost_feed_for_user import _get_repost_feed_for_user from src.utils.db_session import get_db -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db def test_get_repost_feed_for_user(app): diff --git a/discovery-provider/tests/test_get_route_metrics.py b/discovery-provider/integration_tests/queries/test_get_route_metrics.py similarity index 100% rename from discovery-provider/tests/test_get_route_metrics.py rename to discovery-provider/integration_tests/queries/test_get_route_metrics.py diff --git a/discovery-provider/tests/test_get_top_user_track_tags.py b/discovery-provider/integration_tests/queries/test_get_top_user_track_tags.py similarity index 94% rename from discovery-provider/tests/test_get_top_user_track_tags.py rename to discovery-provider/integration_tests/queries/test_get_top_user_track_tags.py index 999acf4ea51..d38803c48de 100644 --- a/discovery-provider/tests/test_get_top_user_track_tags.py +++ b/discovery-provider/integration_tests/queries/test_get_top_user_track_tags.py @@ -1,6 +1,6 @@ from src.queries.get_top_user_track_tags import _get_top_user_track_tags from src.utils.db_session import get_db -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db def test_get_top_user_track_tags(app): diff --git a/discovery-provider/tests/test_get_tracks.py b/discovery-provider/integration_tests/queries/test_get_tracks.py similarity index 99% rename from discovery-provider/tests/test_get_tracks.py rename to discovery-provider/integration_tests/queries/test_get_tracks.py index 666631d5227..aff171a8a2d 100644 --- a/discovery-provider/tests/test_get_tracks.py +++ b/discovery-provider/integration_tests/queries/test_get_tracks.py @@ -4,7 +4,7 @@ from src.queries.get_tracks import _get_tracks from src.utils.db_session import get_db -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db def populate_tracks(db): diff --git a/discovery-provider/tests/test_get_user_signals.py b/discovery-provider/integration_tests/queries/test_get_user_signals.py similarity index 98% rename from discovery-provider/tests/test_get_user_signals.py rename to discovery-provider/integration_tests/queries/test_get_user_signals.py index 42ea35f4ee5..f754a1ae8da 100644 --- a/discovery-provider/tests/test_get_user_signals.py +++ b/discovery-provider/integration_tests/queries/test_get_user_signals.py @@ -1,6 +1,6 @@ from src.queries.get_user_signals import _get_user_signals from src.utils.db_session import get_db -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db def make_user( diff --git a/discovery-provider/tests/test_populate_playlist_metadata.py b/discovery-provider/integration_tests/queries/test_populate_playlist_metadata.py similarity index 99% rename from discovery-provider/tests/test_populate_playlist_metadata.py rename to discovery-provider/integration_tests/queries/test_populate_playlist_metadata.py index 78e213dbd24..793fa263f8e 100644 --- a/discovery-provider/tests/test_populate_playlist_metadata.py +++ b/discovery-provider/integration_tests/queries/test_populate_playlist_metadata.py @@ -3,7 +3,7 @@ from src.models import RepostType, SaveType from src.queries.query_helpers import populate_playlist_metadata from src.utils.db_session import get_db -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db logger = logging.getLogger(__name__) diff --git a/discovery-provider/tests/test_populate_track_metadata.py b/discovery-provider/integration_tests/queries/test_populate_track_metadata.py similarity index 98% rename from discovery-provider/tests/test_populate_track_metadata.py rename to discovery-provider/integration_tests/queries/test_populate_track_metadata.py index ab62bb4536a..278749b23c0 100644 --- a/discovery-provider/tests/test_populate_track_metadata.py +++ b/discovery-provider/integration_tests/queries/test_populate_track_metadata.py @@ -2,7 +2,7 @@ from src.queries import response_name_constants from src.queries.query_helpers import populate_track_metadata from src.utils.db_session import get_db -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db logger = logging.getLogger(__name__) diff --git a/discovery-provider/tests/test_populate_user_metadata.py b/discovery-provider/integration_tests/queries/test_populate_user_metadata.py similarity index 99% rename from discovery-provider/tests/test_populate_user_metadata.py rename to discovery-provider/integration_tests/queries/test_populate_user_metadata.py index 1a1d858641a..a7bbbefd5bc 100644 --- a/discovery-provider/tests/test_populate_user_metadata.py +++ b/discovery-provider/integration_tests/queries/test_populate_user_metadata.py @@ -2,7 +2,7 @@ from src.queries import response_name_constants from src.queries.query_helpers import populate_user_metadata from src.utils.db_session import get_db -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db logger = logging.getLogger(__name__) diff --git a/discovery-provider/tests/test_search.py b/discovery-provider/integration_tests/queries/test_search.py similarity index 100% rename from discovery-provider/tests/test_search.py rename to discovery-provider/integration_tests/queries/test_search.py diff --git a/discovery-provider/tests/test_search_track_tags.py b/discovery-provider/integration_tests/queries/test_search_track_tags.py similarity index 96% rename from discovery-provider/tests/test_search_track_tags.py rename to discovery-provider/integration_tests/queries/test_search_track_tags.py index 458630c7783..3aed4357b7f 100644 --- a/discovery-provider/tests/test_search_track_tags.py +++ b/discovery-provider/integration_tests/queries/test_search_track_tags.py @@ -1,7 +1,7 @@ from src.queries.search_track_tags import search_track_tags from src.utils.db_session import get_db from src.tasks.index_aggregate_plays import _update_aggregate_plays -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db def test_search_track_tags(app): diff --git a/discovery-provider/tests/test_search_user_tags.py b/discovery-provider/integration_tests/queries/test_search_user_tags.py similarity index 97% rename from discovery-provider/tests/test_search_user_tags.py rename to discovery-provider/integration_tests/queries/test_search_user_tags.py index 6edf65e8b71..c29f06d8f48 100644 --- a/discovery-provider/tests/test_search_user_tags.py +++ b/discovery-provider/integration_tests/queries/test_search_user_tags.py @@ -1,6 +1,6 @@ from src.queries.search_user_tags import search_user_tags from src.utils.db_session import get_db -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db def test_search_user_tags(app): diff --git a/discovery-provider/tests/test_set_indexing_error.py b/discovery-provider/integration_tests/queries/test_set_indexing_error.py similarity index 100% rename from discovery-provider/tests/test_set_indexing_error.py rename to discovery-provider/integration_tests/queries/test_set_indexing_error.py diff --git a/discovery-provider/tests/test_undisbursed_challeges.py b/discovery-provider/integration_tests/queries/test_undisbursed_challeges.py similarity index 99% rename from discovery-provider/tests/test_undisbursed_challeges.py rename to discovery-provider/integration_tests/queries/test_undisbursed_challeges.py index 5724dc4b21d..a62dbd4d6f5 100644 --- a/discovery-provider/tests/test_undisbursed_challeges.py +++ b/discovery-provider/integration_tests/queries/test_undisbursed_challeges.py @@ -2,7 +2,7 @@ from src.models import Challenge, UserChallenge, ChallengeType, User from src.utils.db_session import get_db from src.queries.get_undisbursed_challenges import get_undisbursed_challenges -from tests.utils import populate_mock_db_blocks +from integration_tests.utils import populate_mock_db_blocks def setup_challenges(app): diff --git a/discovery-provider/tests/res/bad_schema.json b/discovery-provider/integration_tests/res/bad_schema.json similarity index 100% rename from discovery-provider/tests/res/bad_schema.json rename to discovery-provider/integration_tests/res/bad_schema.json diff --git a/discovery-provider/tests/res/test_audio_file.mp3 b/discovery-provider/integration_tests/res/test_audio_file.mp3 similarity index 100% rename from discovery-provider/tests/res/test_audio_file.mp3 rename to discovery-provider/integration_tests/res/test_audio_file.mp3 diff --git a/discovery-provider/tests/res/user_bad_schema.json b/discovery-provider/integration_tests/res/user_bad_schema.json similarity index 100% rename from discovery-provider/tests/res/user_bad_schema.json rename to discovery-provider/integration_tests/res/user_bad_schema.json diff --git a/discovery-provider/tests/test_generate_trending.py b/discovery-provider/integration_tests/tasks/test_generate_trending.py similarity index 100% rename from discovery-provider/tests/test_generate_trending.py rename to discovery-provider/integration_tests/tasks/test_generate_trending.py diff --git a/discovery-provider/tests/test_index_aggregate_plays.py b/discovery-provider/integration_tests/tasks/test_index_aggregate_plays.py similarity index 99% rename from discovery-provider/tests/test_index_aggregate_plays.py rename to discovery-provider/integration_tests/tasks/test_index_aggregate_plays.py index ef64ddd3f0c..cb4e736d1f8 100644 --- a/discovery-provider/tests/test_index_aggregate_plays.py +++ b/discovery-provider/integration_tests/tasks/test_index_aggregate_plays.py @@ -6,7 +6,7 @@ from src.models import AggregatePlays from src.utils.config import shared_config from src.utils.db_session import get_db -from .utils import populate_mock_db +from integration_tests.utils import populate_mock_db REDIS_URL = shared_config["redis"]["url"] diff --git a/discovery-provider/tests/test_index_listen_count_milestone.py b/discovery-provider/integration_tests/tasks/test_index_listen_count_milestone.py similarity index 99% rename from discovery-provider/tests/test_index_listen_count_milestone.py rename to discovery-provider/integration_tests/tasks/test_index_listen_count_milestone.py index cb3e765b149..8c7c46182bf 100644 --- a/discovery-provider/tests/test_index_listen_count_milestone.py +++ b/discovery-provider/integration_tests/tasks/test_index_listen_count_milestone.py @@ -13,7 +13,7 @@ from src.utils.config import shared_config from src.utils.redis_cache import set_json_cached_key from src.tasks.index_aggregate_plays import _update_aggregate_plays -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db REDIS_URL = shared_config["redis"]["url"] DEFAULT_EVENT = "" diff --git a/discovery-provider/tests/test_index_playlists.py b/discovery-provider/integration_tests/tasks/test_index_playlists.py similarity index 99% rename from discovery-provider/tests/test_index_playlists.py rename to discovery-provider/integration_tests/tasks/test_index_playlists.py index 965c3285ad6..22c052a291b 100644 --- a/discovery-provider/tests/test_index_playlists.py +++ b/discovery-provider/integration_tests/tasks/test_index_playlists.py @@ -6,7 +6,7 @@ from src.utils.playlist_event_constants import playlist_event_types_lookup from src.utils import helpers from src.challenges.challenge_event_bus import setup_challenge_bus -from tests.index_helpers import AttrDict, IPFSClient, UpdateTask +from integration_tests.challenges.index_helpers import AttrDict, IPFSClient, UpdateTask block_hash = b"0x8f19da326900d171642af08e6770eedd83509c6c44f6855c98e6a752844e2521" diff --git a/discovery-provider/tests/test_index_related_artists.py b/discovery-provider/integration_tests/tasks/test_index_related_artists.py similarity index 98% rename from discovery-provider/tests/test_index_related_artists.py rename to discovery-provider/integration_tests/tasks/test_index_related_artists.py index 2ff05eae80a..ebe193e87a0 100644 --- a/discovery-provider/tests/test_index_related_artists.py +++ b/discovery-provider/integration_tests/tasks/test_index_related_artists.py @@ -13,7 +13,7 @@ from src.utils.config import shared_config from src.utils.db_session import get_db -from .utils import populate_mock_db +from integration_tests.utils import populate_mock_db REDIS_URL = shared_config["redis"]["url"] diff --git a/discovery-provider/tests/test_index_rewards_manager.py b/discovery-provider/integration_tests/tasks/test_index_rewards_manager.py similarity index 99% rename from discovery-provider/tests/test_index_rewards_manager.py rename to discovery-provider/integration_tests/tasks/test_index_rewards_manager.py index c9ed6c8b398..1e9587bc8df 100644 --- a/discovery-provider/tests/test_index_rewards_manager.py +++ b/discovery-provider/integration_tests/tasks/test_index_rewards_manager.py @@ -11,7 +11,7 @@ from src.utils.redis_connection import get_redis from src.solana.solana_client_manager import SolanaClientManager -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db REWARDS_MANAGER_PROGRAM = shared_config["solana"]["rewards_manager_program_address"] REWARDS_MANAGER_ACCOUNT = shared_config["solana"]["rewards_manager_account"] diff --git a/discovery-provider/tests/test_index_tracks.py b/discovery-provider/integration_tests/tasks/test_index_tracks.py similarity index 99% rename from discovery-provider/tests/test_index_tracks.py rename to discovery-provider/integration_tests/tasks/test_index_tracks.py index 288594d58bb..f5542a172da 100644 --- a/discovery-provider/tests/test_index_tracks.py +++ b/discovery-provider/integration_tests/tasks/test_index_tracks.py @@ -12,7 +12,7 @@ from src.utils import helpers from src.utils.db_session import get_db from src.challenges.challenge_event_bus import ChallengeEventBus, setup_challenge_bus -from tests.index_helpers import AttrDict, IPFSClient, UpdateTask +from integration_tests.challenges.index_helpers import AttrDict, IPFSClient, UpdateTask block_hash = b"0x8f19da326900d171642af08e6770eedd83509c6c44f6855c98e6a752844e2521" diff --git a/discovery-provider/tests/test_index_user_listening_history.py b/discovery-provider/integration_tests/tasks/test_index_user_listening_history.py similarity index 99% rename from discovery-provider/tests/test_index_user_listening_history.py rename to discovery-provider/integration_tests/tasks/test_index_user_listening_history.py index 40a8c46fdd4..5a070397068 100644 --- a/discovery-provider/tests/test_index_user_listening_history.py +++ b/discovery-provider/integration_tests/tasks/test_index_user_listening_history.py @@ -8,7 +8,7 @@ ) from src.utils.config import shared_config from src.utils.db_session import get_db -from .utils import populate_mock_db +from integration_tests.utils.utils import populate_mock_db REDIS_URL = shared_config["redis"]["url"] diff --git a/discovery-provider/tests/test_index_users.py b/discovery-provider/integration_tests/tasks/test_index_users.py similarity index 99% rename from discovery-provider/tests/test_index_users.py rename to discovery-provider/integration_tests/tasks/test_index_users.py index 69ae4880040..c09ebfbf7f6 100644 --- a/discovery-provider/tests/test_index_users.py +++ b/discovery-provider/integration_tests/tasks/test_index_users.py @@ -11,7 +11,7 @@ from src.utils.redis_connection import get_redis from src.utils.user_event_constants import user_event_types_lookup -from tests.index_helpers import AttrDict, IPFSClient +from integration_tests.challenges.index_helpers import AttrDict, IPFSClient block_hash = b"0x8f19da326900d171642af08e6770eedd83509c6c44f6855c98e6a752844e2521" diff --git a/discovery-provider/tests/test_update_trending.py b/discovery-provider/integration_tests/tasks/test_update_trending.py similarity index 99% rename from discovery-provider/tests/test_update_trending.py rename to discovery-provider/integration_tests/tasks/test_update_trending.py index e047a7c7c64..bad40dccf28 100644 --- a/discovery-provider/tests/test_update_trending.py +++ b/discovery-provider/integration_tests/tasks/test_update_trending.py @@ -7,7 +7,7 @@ TrendingTracksStrategyaSPET, ) from src.tasks.index_aggregate_plays import _update_aggregate_plays -from tests.utils import populate_mock_db +from integration_tests.utils import populate_mock_db logger = logging.getLogger(__name__) diff --git a/discovery-provider/tests/test_flask_app.py b/discovery-provider/integration_tests/test_flask_app.py similarity index 100% rename from discovery-provider/tests/test_flask_app.py rename to discovery-provider/integration_tests/test_flask_app.py diff --git a/discovery-provider/tests/utils.py b/discovery-provider/integration_tests/utils.py similarity index 100% rename from discovery-provider/tests/utils.py rename to discovery-provider/integration_tests/utils.py diff --git a/discovery-provider/tests/test_index_operations.py b/discovery-provider/integration_tests/utils/test_index_operations.py similarity index 94% rename from discovery-provider/tests/test_index_operations.py rename to discovery-provider/integration_tests/utils/test_index_operations.py index d0cc44f97ed..bc2b83d79eb 100644 --- a/discovery-provider/tests/test_index_operations.py +++ b/discovery-provider/integration_tests/utils/test_index_operations.py @@ -6,7 +6,7 @@ import src.utils.multihash from src.utils.helpers import remove_test_file -from tests.utils import query_creator_by_name, to_bytes +from integration_tests.utils import query_creator_by_name, to_bytes @pytest.mark.skip( @@ -14,9 +14,9 @@ ) def test_index_operations(app, client, celery_app, contracts): """Confirm indexing of creator operations results in expected state change""" - test_file = "tests/res/test_audio_file.mp3" - creator_metadata_json_file = "tests/res/test_creator_metadata.json" - track_metadata_json_file = "tests/res/test_track_metadata.json" + test_file = "integration_tests/res/test_audio_file.mp3" + creator_metadata_json_file = "integration_tests/res/test_creator_metadata.json" + track_metadata_json_file = "integration_tests/res/test_track_metadata.json" user_factory_contract = contracts["user_factory_contract"] track_factory_contract = contracts["track_factory_contract"] diff --git a/discovery-provider/tests/test_ipfs_functionality.py b/discovery-provider/integration_tests/utils/test_ipfs_functionality.py similarity index 99% rename from discovery-provider/tests/test_ipfs_functionality.py rename to discovery-provider/integration_tests/utils/test_ipfs_functionality.py index 00f1cc642ad..89b13c3d14f 100644 --- a/discovery-provider/tests/test_ipfs_functionality.py +++ b/discovery-provider/integration_tests/utils/test_ipfs_functionality.py @@ -10,7 +10,7 @@ IPFS_FETCH = 'get_metadata_from_ipfs_node' GATEWAY_FETCH = 'get_metadata_from_gateway' -JSON_FILE = "tests/res/test_ipfs.json" +JSON_FILE = "integration_tests/res/test_ipfs.json" # Helpers def get_ipfs_client(app): diff --git a/discovery-provider/scripts/lint.sh b/discovery-provider/scripts/lint.sh index 6de17ffdb0b..0482c5ee193 100755 --- a/discovery-provider/scripts/lint.sh +++ b/discovery-provider/scripts/lint.sh @@ -1,5 +1,5 @@ set -e pylint src/ -pylint tests/ +pylint integration_tests/ mypy --ignore-missing-imports --follow-imports=silent --show-column-numbers src/ \ No newline at end of file diff --git a/discovery-provider/scripts/test.sh b/discovery-provider/scripts/test.sh index ed1bfdaf13d..2f3bd509d01 100755 --- a/discovery-provider/scripts/test.sh +++ b/discovery-provider/scripts/test.sh @@ -71,4 +71,4 @@ sleep 5 pytest src # Integration tests -pytest tests +pytest integration_tests diff --git a/discovery-provider/src/models/test_base_model_validation.py b/discovery-provider/src/models/models_unit_test.py similarity index 100% rename from discovery-provider/src/models/test_base_model_validation.py rename to discovery-provider/src/models/models_unit_test.py diff --git a/discovery-provider/src/queries/get_app_name_metrics_test.py b/discovery-provider/src/queries/get_app_name_metrics_test.py deleted file mode 100644 index 39eb693277c..00000000000 --- a/discovery-provider/src/queries/get_app_name_metrics_test.py +++ /dev/null @@ -1,2 +0,0 @@ -def test(): - """See /tests/test_get_app_name_metrics.py""" diff --git a/discovery-provider/src/queries/get_app_name_metrics_unit_test.py b/discovery-provider/src/queries/get_app_name_metrics_unit_test.py new file mode 100644 index 00000000000..2dba2e3a73d --- /dev/null +++ b/discovery-provider/src/queries/get_app_name_metrics_unit_test.py @@ -0,0 +1,2 @@ +def test(): + """See /integration_tests/test_get_app_name_metrics.py""" diff --git a/discovery-provider/src/queries/get_app_names_test.py b/discovery-provider/src/queries/get_app_names_unit_test.py similarity index 100% rename from discovery-provider/src/queries/get_app_names_test.py rename to discovery-provider/src/queries/get_app_names_unit_test.py diff --git a/discovery-provider/src/queries/get_block_confirmation_test.py b/discovery-provider/src/queries/get_block_confirmation_unit_test.py similarity index 100% rename from discovery-provider/src/queries/get_block_confirmation_test.py rename to discovery-provider/src/queries/get_block_confirmation_unit_test.py diff --git a/discovery-provider/src/queries/get_genre_metrics_test.py b/discovery-provider/src/queries/get_genre_metrics_test.py deleted file mode 100644 index e384f53bff4..00000000000 --- a/discovery-provider/src/queries/get_genre_metrics_test.py +++ /dev/null @@ -1,2 +0,0 @@ -def test(): - """See /tests/test_get_genre_metrics.py""" diff --git a/discovery-provider/src/queries/get_genre_metrics_unit_test.py b/discovery-provider/src/queries/get_genre_metrics_unit_test.py new file mode 100644 index 00000000000..4948559bc05 --- /dev/null +++ b/discovery-provider/src/queries/get_genre_metrics_unit_test.py @@ -0,0 +1,2 @@ +def test(): + """See /integration_tests/test_get_genre_metrics.py""" diff --git a/discovery-provider/src/queries/get_health_test.py b/discovery-provider/src/queries/get_health_unit_test.py similarity index 100% rename from discovery-provider/src/queries/get_health_test.py rename to discovery-provider/src/queries/get_health_unit_test.py diff --git a/discovery-provider/src/queries/get_latest_play_test.py b/discovery-provider/src/queries/get_latest_play_unit_test.py similarity index 100% rename from discovery-provider/src/queries/get_latest_play_test.py rename to discovery-provider/src/queries/get_latest_play_unit_test.py diff --git a/discovery-provider/src/queries/get_plays_metrics_test.py b/discovery-provider/src/queries/get_plays_metrics_test.py deleted file mode 100644 index 8d6511cc6dc..00000000000 --- a/discovery-provider/src/queries/get_plays_metrics_test.py +++ /dev/null @@ -1,2 +0,0 @@ -def test(): - """See /tests/test_get_plays_metrics.py""" diff --git a/discovery-provider/src/queries/get_plays_metrics_unit_test.py b/discovery-provider/src/queries/get_plays_metrics_unit_test.py new file mode 100644 index 00000000000..c74948a8499 --- /dev/null +++ b/discovery-provider/src/queries/get_plays_metrics_unit_test.py @@ -0,0 +1,2 @@ +def test(): + """See /integration_tests/test_get_plays_metrics.py""" diff --git a/discovery-provider/src/queries/get_route_metrics_test.py b/discovery-provider/src/queries/get_route_metrics_test.py deleted file mode 100644 index fff04d3a77c..00000000000 --- a/discovery-provider/src/queries/get_route_metrics_test.py +++ /dev/null @@ -1,2 +0,0 @@ -def test(): - """See /tests/test_get_route_metrics.py""" diff --git a/discovery-provider/src/queries/get_route_metrics_unit_test.py b/discovery-provider/src/queries/get_route_metrics_unit_test.py new file mode 100644 index 00000000000..90f8123226b --- /dev/null +++ b/discovery-provider/src/queries/get_route_metrics_unit_test.py @@ -0,0 +1,2 @@ +def test(): + """See /integration_tests/test_get_route_metrics.py""" diff --git a/discovery-provider/src/solana/solana_client_manager_test.py b/discovery-provider/src/solana/solana_client_manager_unit_test.py similarity index 100% rename from discovery-provider/src/solana/solana_client_manager_test.py rename to discovery-provider/src/solana/solana_client_manager_unit_test.py diff --git a/discovery-provider/src/tasks/index_metrics_test.py b/discovery-provider/src/tasks/index_metrics_unit_test.py similarity index 100% rename from discovery-provider/src/tasks/index_metrics_test.py rename to discovery-provider/src/tasks/index_metrics_unit_test.py diff --git a/discovery-provider/src/utils/helpers_test.py b/discovery-provider/src/utils/helpers_unit_test.py similarity index 100% rename from discovery-provider/src/utils/helpers_test.py rename to discovery-provider/src/utils/helpers_unit_test.py diff --git a/discovery-provider/src/utils/redis_cache_test.py b/discovery-provider/src/utils/redis_cache_unit_test.py similarity index 100% rename from discovery-provider/src/utils/redis_cache_test.py rename to discovery-provider/src/utils/redis_cache_unit_test.py