Skip to content

Commit 32c9e60

Browse files
authored
chore(build): fixes (#2322)
1 parent 82533df commit 32c9e60

File tree

10 files changed

+30
-46
lines changed

10 files changed

+30
-46
lines changed

.c8rc renamed to .c8rc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"test{,s}/**"
1818
],
1919
"exclude-after-remap": true,
20-
"reporter": ["cobertura", "lcov"],
20+
"reporter": ["cobertura", "lcovonly"],
2121
"reports-dir": "./out/coverage/ui",
2222
"temp-directory": "./out/tmp/.c8-tmp-ui"
2323
}

.config/mise.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ _.python.venv = { create = true, path = "~/.local/share/virtualenvs/vsa", python
1515
"--seed",
1616
] } # pass args to uv venv
1717
_.file = { path = ".env", tools = true }
18+
_.path = ["./node_modules/.bin"]
1819

1920
# Do not use other hooks than preinstall or postinstall because they will
2021
# not work without 'mise activate' command, something that we do not use on CI.

.github/workflows/ci.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,31 +326,36 @@ jobs:
326326
EOT
327327
podman info
328328
329+
- name: Save ready_to_test=true
330+
id: ready_to_test
331+
if: ${{ contains(matrix.name, 'test') && success() }}
332+
run: echo "ready_to_test=true" >> "$GITHUB_OUTPUT"
333+
329334
- name: task ${{ matrix.task-name }}
330-
if: "${{ !contains(matrix.name, 'test') }}"
335+
if: "${{ !contains(matrix.name, 'test') && steps.ready_to_test.outputs.ready_to_test == 'true' }}"
331336
run: task ${{ matrix.task-name }} ${{ matrix.env.TASKFILE_ARGS }}
332337

333338
- name: task mcp
334-
if: contains(matrix.name, 'test')
339+
if: contains(matrix.name, 'test') && steps.ready_to_test.outputs.ready_to_test == 'true'
335340
run: task mcp:test ${{ matrix.env.TASKFILE_ARGS }}
336341

337342
- name: task unit
338-
if: contains(matrix.name, 'test')
343+
if: contains(matrix.name, 'test') && steps.ready_to_test.outputs.ready_to_test == 'true'
339344
run: task unit ${{ matrix.env.TASKFILE_ARGS }}
340345

341346
- name: task ui
342347
# https://github.com/ansible/vscode-ansible/issues/1451
343-
if: ${{ !cancelled() && contains(matrix.name, 'test') && !contains(matrix.name, 'wsl') }}
348+
if: ${{ !cancelled() && contains(matrix.name, 'test') && !contains(matrix.name, 'wsl') && steps.ready_to_test.outputs.ready_to_test == 'true'}}
344349
run: task ui ${{ matrix.env.TASKFILE_ARGS }}
345350

346351
- name: task e2e
347352
# https://github.com/ansible/vscode-ansible/issues/1451
348-
if: ${{ !cancelled() && contains(matrix.name, 'test') }}
353+
if: ${{ !cancelled() && contains(matrix.name, 'test') && steps.ready_to_test.outputs.ready_to_test == 'true' }}
349354
run: task e2e ${{ matrix.env.TASKFILE_ARGS }}
350355

351356
- name: task als
352357
# https://github.com/ansible/vscode-ansible/issues/1451
353-
if: ${{ !cancelled() && contains(matrix.name, 'test') }}
358+
if: ${{ !cancelled() && contains(matrix.name, 'test') && steps.ready_to_test.outputs.ready_to_test == 'true' }}
354359
run: task als ${{ matrix.env.TASKFILE_ARGS }}
355360

356361
- name: Upload vsix artifact

.vscode-test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default defineConfig({
3131
timeout: 50_000,
3232
reporter: "cypress-multi-reporters",
3333
reporterOptions: {
34-
reporterEnabled: "spec, mocha-junit-reporter",
34+
reporterEnabled: "spec,mocha-junit-reporter",
3535
mochaJunitReporterReporterOptions: {
3636
attachments: true,
3737
includePending: true,

Containerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ libxrandr2 \
5555
libxshmfence1 \
5656
lsof \
5757
sudo \
58+
xauth \
5859
xvfb \
5960
2> /dev/null && \
6061
mkdir -p /root/.local/bin && \

Taskfile.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,6 @@ tasks:
219219
- tools/helper
220220
- src/**/*
221221
- test/**/*
222-
- packages/*/src/**/*
223-
- packages/*/test/**/*
224222
- media/**/*
225223
generates:
226224
- "*.vsix"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@
11261126
"test-ui": "yarn run test-ui-current && yarn run test-ui-oldest",
11271127
"test-ui-current": "./tools/test-launcher.sh",
11281128
"test-ui-oldest": "CODE_VERSION='min' ./tools/test-launcher.sh",
1129-
"unit-tests": "sh -c \"c8 --config test/unit/.c8rc mocha --recursive test/unit/lightspeed test/unit/mcp ${MOCHA_OPTS:-}\"",
1129+
"unit-tests": "sh -c \"c8 --config test/unit/.c8rc.json mocha --recursive test/unit/lightspeed test/unit/mcp ${MOCHA_OPTS:-}\"",
11301130
"vite-build": "vue-tsc --noEmit && vite build",
11311131
"vite-dev": "vite build && vue-tsc --noEmit && vite",
11321132
"vite-preview": "vite preview",

packages/ansible-language-server/.c8rc renamed to packages/ansible-language-server/.c8rc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"check-coverage": true,
3-
"extends": "../../.c8rc",
42
"branches": 80.31,
3+
"check-coverage": true,
4+
"extends": "../../.c8rc.json",
55
"lines": 0,
66
"reporter": ["cobertura", "lcov", "text", "text-summary"],
77
"reports-dir": "../../out/coverage/als",

test/unit/.c8rc renamed to test/unit/.c8rc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"check-coverage": true,
3-
"lines": 91.45,
43
"clean": true,
54
"exclude": [
65
"**/__tests__/**",
@@ -17,6 +16,7 @@
1716
"test{,s}/**"
1817
],
1918
"exclude-after-remap": true,
19+
"lines": 91.45,
2020
"reporter": ["cobertura", "lcov", "text"],
2121
"reports-dir": "./out/coverage/unit",
2222
"temp-directory": "./out/tmp/.c8-tmp-unit"

tools/test-setup.sh

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ EE_ANSIBLE_VERSION=null
2020
EE_ANSIBLE_LINT_VERSION=null
2121

2222
if command -v sudo >/dev/null 2>&1; then
23-
SUDO=""
24-
else
2523
SUDO=sudo
24+
else
25+
SUDO=""
2626
fi
2727

2828
mkdir -p out/log
@@ -51,28 +51,6 @@ get_version () {
5151
fi
5252
}
5353

54-
find_powershell() {
55-
# Sometimes these are not in PATH under wsl, so we need to look deeper
56-
local candidates=(
57-
"pwsh.exe"
58-
"powershell.exe"
59-
"/mnt/c/Program Files/PowerShell/7/pwsh.exe"
60-
"/mnt/c/Program Files (x86)/PowerShell/7/pwsh.exe"
61-
"/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe"
62-
)
63-
for exe in "${candidates[@]}"; do
64-
if cmd=$(command -v "$exe" 2>/dev/null); then
65-
echo "$cmd"
66-
exit 0
67-
elif [ -x "$exe" ]; then
68-
echo "$exe"
69-
exit 0
70-
fi
71-
done
72-
log error "Failed to find powershell executable"
73-
exit 2
74-
}
75-
7654
if [[ -z "${HOSTNAME:-}" ]]; then
7755
export HOSTNAME=${HOSTNAME:-${HOST:-$(hostname)}}
7856
log warning "Defined HOSTNAME=${HOSTNAME} as we were not able to found a value already defined.."
@@ -150,11 +128,8 @@ else
150128
OS_VERSION="$(lsb_release --id --short 2> /dev/null)-$(lsb_release --release --short 2> /dev/null)"
151129
OS_VERSION="${OS_VERSION,,}"
152130
if [[ "$WSL" -eq 1 ]]; then
153-
OS_VERSION=$($(find_powershell) -Command 'Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object -property Caption, BuildNumber' | grep "Microsoft " | \
154-
tr -d '\r' | \
155-
sed 's/^Microsoft //I' | \
156-
tr '[:upper:]' '[:lower:]' | \
157-
sed 's/[ -]\+/-/g')-wsl-$OS_VERSION
131+
# is wsl is configured with interop disabled, calling cmd.exe can fail ugly and without output on GHA
132+
OS_VERSION=$(cmd.exe /c ver 2>/dev/null | awk '/Version/ {match($0, /\[Version ([0-9.]+)\]/, a); print a[1]}' || echo 'unknown')
158133
fi
159134
else # when inside a container this would be needed
160135
# shellcheck disable=SC1091
@@ -173,7 +148,7 @@ if [[ -f "/usr/bin/apt-get" ]]; then
173148
# qemu-user-static is required by podman on arm64
174149
# python3-dev is needed for headers as some packages might need to compile
175150
# DEBS=(curl file git python3-dev python3-venv python3-pip qemu-user-static xvfb x11-xserver-utils libgbm-dev libssh-dev libonig-dev)
176-
DEBS=(curl file git)
151+
DEBS=(curl file git gcc libonig-dev)
177152
# add nodejs to DEBS only if node is not already installed because
178153
# GHA has newer versions preinstalled and installing the rpm would
179154
# basically downgrade it
@@ -298,9 +273,13 @@ fi
298273
VIRTUAL_ENV=${EXPECTED_VENV}
299274
if [[ -d "${VIRTUAL_ENV}" ]]; then
300275
log notice "Running uv sync ..."
276+
if [[ "$WSL" -eq 1 ]]; then
277+
log warning "Setting UV_CONCURRENT_INSTALLS=1 because WSL was detected, see https://github.com/astral-sh/uv/issues/13481#issuecomment-3375527015"
278+
export UV_CONCURRENT_INSTALLS=1
279+
fi
301280
timed uv sync --no-progress -q || {
302-
log warning "Removing broken venv from ${VIRTUAL_ENV} ..."
303-
rm -rf "${VIRTUAL_ENV}"
281+
log warning "Removing broken venv from ${VIRTUAL_ENV} ..."
282+
rm -rf "${VIRTUAL_ENV}"
304283
}
305284
fi
306285
if [[ ! -d "${VIRTUAL_ENV}" ]]; then

0 commit comments

Comments
 (0)