Skip to content

Commit 0ecdaae

Browse files
authored
chore: mount vsix artifact in separated folder (#2602)
Address issue where container mounting fails to do use trying to mount a file at root level.
1 parent ec6cdbd commit 0ecdaae

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
.idea
99
.nyc_output
1010
.pytest_cache
11+
.venv
1112
*.pyc
1213
*.pyo
1314
.task

Taskfile.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ tasks:
226226
- pyproject.toml
227227
- test/ui-selenium/**/*
228228
- uv.lock
229+
- "out/data/ansible-latest.vsix"
229230
generates:
230231
- out/junit/ui-selenium-test-results.xml
231232
cmds:
@@ -263,6 +264,7 @@ tasks:
263264
- yarn.lock
264265
generates:
265266
- "out/*.vsix"
267+
- "out/data/ansible-latest.vsix"
266268
- "out/@ansible-ansible-mcp-server*.tgz"
267269
- "out/@ansible-ansible-language-server*.tgz"
268270
cmds:

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# Override VSIX path: VSX_FILE=./out/ansible-1.2.3.vsix
44
# cspell: ignore healthcheck
5-
version: "3.8"
65
services:
76
selenium-vscode:
87
image: quay.io/tshinhar/selenium-vscode-multi:latest
@@ -13,7 +12,8 @@ services:
1312
- "4444:4444"
1413
- "5999:5999"
1514
volumes:
16-
- ${VSX_FILE:-./out/ansible-latest.vsix}:/ansible-latest.vsix:ro
15+
# apparently podman does not want to mount file as container root
16+
- ${VSX_FILE:-./out/data/ansible-latest.vsix}:/data/ansible-latest.vsix:ro
1717
- ./.vscode-test/user-data/User/settings.json:/home/selenium/.local/share/code-server/User/settings.json:rw
1818
- ./out/ui-selenium/logs:/home/selenium/.local/share/code-server/logs:rw
1919
restart: "no"

test/selenium/utils/ui_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def vscode_install_vsix(driver: WebDriver) -> None:
400400
vscode_run_command(driver, ">Extensions: Install from VSix")
401401
vsix_file = wait_displayed(
402402
driver,
403-
"//span[text()='ansible-latest.vsix']",
403+
"//span[text()='/data/ansible-latest.vsix']",
404404
timeout=10,
405405
)
406406
vsix_file.click()

tools/helper

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"""Utility that helps with extension building and testing."""
44

55
import argparse
6-
import glob
76
import logging
87
import pathlib
98
import subprocess
109
import sys
1110
from datetime import datetime
11+
from pathlib import Path
1212

1313

1414
def run(cmd: str) -> subprocess.CompletedProcess[bytes]:
@@ -127,7 +127,8 @@ def cli() -> None:
127127
sys.exit(0)
128128
pre_release_arg = "--pre-release" if pre_release else ""
129129
if opt.publish:
130-
vsix_files = glob.glob("out/*.vsix")
130+
# glob pattern does match ansible-latest.vsix on purpose
131+
vsix_files = list(Path("out").glob("ansible-[0-9]*.vsix"))
131132
if len(vsix_files) != 1:
132133
msg = (
133134
"Publish command requires presence of exactly one '.vsix' on disk, found:"
@@ -160,6 +161,10 @@ def cli() -> None:
160161
run(
161162
f"vsce package --no-update-package-json --out={vsix_file} {pre_release_arg} {version}"
162163
)
164+
vsix_file_fixed = Path("out/data/ansible-latest.vsix")
165+
vsix_file_fixed.parent.mkdir(parents=True, exist_ok=True)
166+
vsix_file_fixed.unlink(missing_ok=True)
167+
vsix_file_fixed.hardlink_to(Path(vsix_file))
163168
# --yarn needed to avoid a warning message as package.json config does not prevent it
164169
# run("vsce ls --yarn | sort > out/log/package.log")
165170
run("mkdir -p out/log")

0 commit comments

Comments
 (0)