diff --git a/.gitea/workflows/integration.yml b/.gitea/workflows/integration.yml index df22c52..34c788c 100644 --- a/.gitea/workflows/integration.yml +++ b/.gitea/workflows/integration.yml @@ -2,9 +2,9 @@ name: Integration tests (full workflow) on: push: - branches: [ main ] + branches: [ main, Next ] pull_request: - branches: [ main ] + branches: [ main, Next ] jobs: integration: diff --git a/tests/integration_full_workflow_test.py b/tests/integration_full_workflow_test.py index af63ba7..84aa69f 100644 --- a/tests/integration_full_workflow_test.py +++ b/tests/integration_full_workflow_test.py @@ -14,6 +14,16 @@ from pathlib import Path import time import shutil +# Make imports robust when running the script directly from different working directories. +# Ensure the repository root and this tests folder are on sys.path so the script can import +# both the package (`ytplaylist`) and local test helpers (`tests.temp_config`). +REPO_ROOT = Path(__file__).resolve().parents[1] +TESTS_DIR = Path(__file__).resolve().parent +if str(REPO_ROOT) not in sys.path: + sys.path.insert(0, str(REPO_ROOT)) +if str(TESTS_DIR) not in sys.path: + sys.path.insert(0, str(TESTS_DIR)) + if not os.getenv("INTEGRATION_TEST"): print("Skipping full integration test (set INTEGRATION_TEST=1 to enable)") sys.exit(0)