Skip to content

Commit ff28cc0

Browse files
committed
Fix Vespa test app copy in CI
1 parent 4972305 commit ff28cc0

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

integrations/vespa/tests/conftest.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
from haystack_integrations.document_stores.vespa import VespaDocumentStore
1717

18+
VESPA_APP_CONTAINER_DIR = "/tmp/vespa_app" # noqa: S108
19+
1820
HOSTS_XML = """<?xml version="1.0" encoding="utf-8" ?>
1921
<hosts>
2022
<host name="localhost">
@@ -150,15 +152,28 @@ def deployed_vespa_app(tmp_path_factory):
150152
pytest.skip("Set VESPA_RUN_INTEGRATION_TESTS=1 and start Vespa with docker compose.")
151153

152154
app_dir = _write_vespa_app(tmp_path_factory.mktemp("vespa_app"))
153-
subprocess.run(["docker", "cp", str(app_dir), "vespa:/tmp/vespa_app"], check=True)
154155
subprocess.run(
155156
[
156157
"docker",
157158
"exec",
158159
"vespa",
159160
"bash",
160161
"-lc",
161-
"/opt/vespa/bin/vespa-deploy prepare /tmp/vespa_app && /opt/vespa/bin/vespa-deploy activate",
162+
f"rm -rf {VESPA_APP_CONTAINER_DIR} && mkdir -p {VESPA_APP_CONTAINER_DIR}",
163+
],
164+
check=True,
165+
)
166+
subprocess.run(["docker", "cp", str(app_dir) + os.sep + ".", f"vespa:{VESPA_APP_CONTAINER_DIR}"], check=True)
167+
subprocess.run(
168+
[
169+
"docker",
170+
"exec",
171+
"vespa",
172+
"bash",
173+
"-lc",
174+
f"test -f {VESPA_APP_CONTAINER_DIR}/services.xml && "
175+
f"/opt/vespa/bin/vespa-deploy prepare {VESPA_APP_CONTAINER_DIR} && "
176+
"/opt/vespa/bin/vespa-deploy activate",
162177
],
163178
check=True,
164179
)

0 commit comments

Comments
 (0)