Skip to content

Errors when launching tests #252

@LucasRenaudineau

Description

@LucasRenaudineau

Hello,

I'm new to contributing. I tried to launch some tests of the project, but I have lots of errors. I could not find if there was an automated way for launching tests. Here is the error when I try to launch the test_client.py test.

python tests/test_client.py
===================================================================== test session starts ======================================================================
platform linux -- Python 3.12.0, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/lucas/Documents/work/git/podcastfy
configfile: pyproject.toml
plugins: anyio-4.9.0, xdist-3.6.1, langsmith-0.3.18
collected 48 items / 2 errors

============================================================================ ERRORS ============================================================================
__________________________________________________________ ERROR collecting test_perso/test_perso.py ___________________________________________________________
venv/lib/python3.12/site-packages/google/api_core/grpc_helpers.py:76: in error_remapped_callable
return callable_(*args, **kwargs)
venv/lib/python3.12/site-packages/grpc/_interceptor.py:277: in call
response, ignored_call = self._with_call(
venv/lib/python3.12/site-packages/grpc/_interceptor.py:332: in _with_call
return call.result(), call
venv/lib/python3.12/site-packages/grpc/_channel.py:440: in result
raise self
venv/lib/python3.12/site-packages/grpc/_interceptor.py:315: in continuation
response, call = self._thunk(new_method).with_call(
venv/lib/python3.12/site-packages/grpc/_channel.py:1198: in with_call
return _end_unary_response_blocking(state, call, True, None)
venv/lib/python3.12/site-packages/grpc/_channel.py:1006: in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
E grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
E status = StatusCode.PERMISSION_DENIED
E details = "Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
E debug_error_string = "UNKNOWN:Error received from peer ipv6:%5B2a00:1450:4007:819::200a%5D:443 {created_time:"2025-03-25T13:18:44.344644945+01:00", grpc_status:7, grpc_message:"Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."}"
E >

The above exception was the direct cause of the following exception:
venv/lib/python3.12/site-packages/podcastfy/tts/providers/geminimulti.py:299: in generate_audio
response = self.client.synthesize_speech(
venv/lib/python3.12/site-packages/google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py:945: in synthesize_speech
response = rpc(
venv/lib/python3.12/site-packages/google/api_core/gapic_v1/method.py:131: in call
return wrapped_func(*args, **kwargs)
venv/lib/python3.12/site-packages/google/api_core/grpc_helpers.py:78: in error_remapped_callable
raise exceptions.from_grpc_error(exc) from exc
E google.api_core.exceptions.PermissionDenied: 403 Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. [reason: "SERVICE_DISABLED"
E domain: "googleapis.com"
E metadata {
E key: "service"
E value: "texttospeech.googleapis.com"
E }
E metadata {
E key: "serviceTitle"
E value: "Cloud Text-to-Speech API"
E }
E metadata {
E key: "containerInfo"
E value: "82536206816"
E }
E metadata {
E key: "consumer"
E value: "projects/82536206816"
E }
E metadata {
E key: "activationUrl"
E value: "https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816"
E }
E , locale: "en-US"
E message: "Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
E , links {
E description: "Google developers console API activation"
E url: "https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816"
E }
E ]

The above exception was the direct cause of the following exception:
test_perso/test_perso.py:18: in
audio_file = generate_podcast(urls=["https://www.youtube.com/watch?v=_q5L0JLi0zo"],
venv/lib/python3.12/site-packages/podcastfy/client.py:372: in generate_podcast
return process_content(
venv/lib/python3.12/site-packages/podcastfy/client.py:138: in process_content
text_to_speech.convert_to_speech(qa_content, audio_file)
venv/lib/python3.12/site-packages/podcastfy/text_to_speech.py:104: in convert_to_speech
audio_data_list = self.provider.generate_audio(
venv/lib/python3.12/site-packages/podcastfy/tts/providers/geminimulti.py:313: in generate_audio
raise RuntimeError(f"Failed to generate audio: {str(e)}") from e
E RuntimeError: Failed to generate audio: 403 Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. [reason: "SERVICE_DISABLED"
E domain: "googleapis.com"
E metadata {
E key: "service"
E value: "texttospeech.googleapis.com"
E }
E metadata {
E key: "serviceTitle"
E value: "Cloud Text-to-Speech API"
E }
E metadata {
E key: "containerInfo"
E value: "82536206816"
E }
E metadata {
E key: "consumer"
E value: "projects/82536206816"
E }
E metadata {
E key: "activationUrl"
E value: "https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816"
E }
E , locale: "en-US"
E message: "Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
E , links {
E description: "Google developers console API activation"
E url: "https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816"
E }
E ]
----------------------------------------------------------------------- Captured stdout ------------------------------------------------------------------------
Generating podcast...
Generating 1 parts
Generated part 1/1: Size 16745 characters.
Transcript saved to ./data/transcripts/transcript_7c4c9dda093d424dac318be6b5309468.txt
----------------------------------------------------------------------- Captured stderr ------------------------------------------------------------------------
2025-03-25 13:18:24,158 - podcastfy.client - INFO - Processing 1 links
2025-03-25 13:18:44,351 - podcastfy.client - ERROR - An error occurred in the process_content function: Failed to generate audio: 403 Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. [reason: "SERVICE_DISABLED"
domain: "googleapis.com"
metadata {
key: "service"
value: "texttospeech.googleapis.com"
}
metadata {
key: "serviceTitle"
value: "Cloud Text-to-Speech API"
}
metadata {
key: "containerInfo"
value: "82536206816"
}
metadata {
key: "consumer"
value: "projects/82536206816"
}
metadata {
key: "activationUrl"
value: "https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816"
}
, locale: "en-US"
message: "Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
, links {
description: "Google developers console API activation"
url: "https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816"
}
]
2025-03-25 13:18:44,351 - podcastfy.client - ERROR - An error occurred: Failed to generate audio: 403 Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. [reason: "SERVICE_DISABLED"
domain: "googleapis.com"
metadata {
key: "service"
value: "texttospeech.googleapis.com"
}
metadata {
key: "serviceTitle"
value: "Cloud Text-to-Speech API"
}
metadata {
key: "containerInfo"
value: "82536206816"
}
metadata {
key: "consumer"
value: "projects/82536206816"
}
metadata {
key: "activationUrl"
value: "https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816"
}
, locale: "en-US"
message: "Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
, links {
description: "Google developers console API activation"
url: "https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=82536206816"
}
]
______________________________________________________________ ERROR collecting tests/test_api.py ______________________________________________________________
ImportError while importing test module '/home/lucas/Documents/work/git/podcastfy/tests/test_api.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/home/lucas/.pyenv/versions/3.12.0/lib/python3.12/importlib/init.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_api.py:3: in
from podcastfy.api.fast_app import app
E ModuleNotFoundError: No module named 'podcastfy.api'
======================================================================= warnings summary =======================================================================
venv/lib/python3.12/site-packages/_pytest/config/init.py:1277
/home/lucas/Documents/work/git/podcastfy/venv/lib/python3.12/site-packages/_pytest/config/init.py:1277: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: anyio
self._mark_plugins_for_rewrite(hook)

venv/lib/python3.12/site-packages/_pytest/config/init.py:1277
/home/lucas/Documents/work/git/podcastfy/venv/lib/python3.12/site-packages/_pytest/config/init.py:1277: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: langsmith
self._mark_plugins_for_rewrite(hook)

venv/lib/python3.12/site-packages/langsmith/client.py:277
/home/lucas/Documents/work/git/podcastfy/venv/lib/python3.12/site-packages/langsmith/client.py:277: LangSmithMissingAPIKeyWarning: API key must be provided when using hosted LangSmith API
warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================================== short test summary info ====================================================================
ERROR test_perso/test_perso.py - RuntimeError: Failed to generate audio: 403 Cloud Text-to-Speech API has not been used in project 82536206816 before or it is disabled. Enable it by visiti...
ERROR tests/test_api.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
================================================================ 3 warnings, 2 errors in 20.76s ================================================================
sys:1: DeprecationWarning: builtin type swigvarlink has no module attribute

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions