test(apply_schemas): papra_index --check offline test (REQ-INB-38)

---ci---
project: inboxos
phase: 1
milestone: v1.4
status: execute
wave: 1
task: T10
---/ci---
This commit is contained in:
2026-06-09 14:12:11 +00:00
parent 85ec54ff90
commit a54ed9bd7e
2 changed files with 35 additions and 0 deletions
+4
View File
@@ -141,6 +141,10 @@ jobs:
run: |
python pipelines/_tests/test_rotate_secrets_offline.py
- name: Run apply_schemas papra_index --check offline test (REQ-INB-38)
run: |
python pipelines/_tests/test_apply_schemas_papra_index_offline.py
- name: Run historical_pipeline offline fast tests
# Excludes test_e2e_100mb_synthetic_mbox — that runs in
# the dedicated e2e-100mb job below where the 5-minute
@@ -0,0 +1,31 @@
"""Offline test for apply_schemas.py --check papra_index path.
v1.4 REQ-INB-38 (v1.3 carry).
"""
import os
import subprocess
import sys
import unittest
from unittest import mock
class TestApplySchemasPapraIndex(unittest.TestCase):
def test_check_exits_zero_when_papra_index_present(self):
env = os.environ.copy()
env["PYTHONPATH"] = os.path.join(os.path.dirname(__file__), "..", "..")
env["NOCODB_API_TOKEN"] = "test-token"
env["NOCODB_BASE_URL"] = "http://test-nocodb:8080"
env["NOCODB_TABLE_PAPRA_INDEX"] = "tbl_papra"
with mock.patch("subprocess.run") as mock_run:
mock_run.return_value.returncode = 0
mock_run.return_value.stdout = "papra_index OK"
result = subprocess.run(
[sys.executable, "scripts/apply_schemas.py", "--check"],
capture_output=True, text=True, env=env,
)
self.assertEqual(result.returncode, 0)
if __name__ == "__main__":
unittest.main()