fix os_clear and integration test
This commit is contained in:
parent
fe84ab5df0
commit
6a1a785714
2 changed files with 15 additions and 4 deletions
6
.github/workflows/test-integration.yml
vendored
6
.github/workflows/test-integration.yml
vendored
|
|
@ -38,8 +38,12 @@ jobs:
|
|||
docker builder prune -af || true
|
||||
docker-compose -f docker-compose.yml down -v --remove-orphans || true
|
||||
|
||||
- name: Cleanup OpenSearch data (root-owned files)
|
||||
run: |
|
||||
docker run --rm -v $(pwd):/work alpine rm -rf /work/opensearch-data || true
|
||||
|
||||
- run: df -h
|
||||
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
|
|
|
|||
|
|
@ -14,10 +14,17 @@ from src.tui.managers.container_manager import ContainerManager
|
|||
async def main():
|
||||
"""Clear OpenSearch data directory."""
|
||||
cm = ContainerManager()
|
||||
|
||||
opensearch_data_path = Path("opensearch-data")
|
||||
|
||||
# Get opensearch data path from env config (same as container_manager uses)
|
||||
from src.tui.managers.env_manager import EnvManager
|
||||
env_manager = EnvManager()
|
||||
env_manager.load_existing_env()
|
||||
opensearch_data_path = Path(
|
||||
env_manager.config.opensearch_data_path.replace("$HOME", str(Path.home()))
|
||||
).expanduser()
|
||||
|
||||
if not opensearch_data_path.exists():
|
||||
print("opensearch-data directory does not exist")
|
||||
print(f"opensearch-data directory does not exist at {opensearch_data_path}")
|
||||
return 0
|
||||
|
||||
print("Clearing OpenSearch data directory...")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue