Skip to content

Commit e72b597

Browse files
committed
✨ add diagnostic verbosity level to test jobs in ci pipeline due to xunitv3 (again)
1 parent 6ab56d2 commit e72b597

File tree

1 file changed

+88
-7
lines changed

1 file changed

+88
-7
lines changed

.github/workflows/ci-pipeline.yml

Lines changed: 88 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
projects: ${{ matrix.project }}
7979
build: true # we need to build due to xUnitv3
8080
restore: true # we need to restore since we disabled caching
81+
verbosity-level: diagnostic
8182

8283
test_windows:
8384
name: call-test-windows
@@ -96,6 +97,7 @@ jobs:
9697
test-arguments: -- RunConfiguration.DisableAppDomain=true
9798
build: true # we need to build for .net48
9899
restore: true # apparently we need to restore for .net48
100+
verbosity-level: diagnostic
99101

100102
integration_test:
101103
name: ⚗️ Integration Test
@@ -133,13 +135,92 @@ jobs:
133135

134136
- name: Fix Linux test apphost permissions
135137
run: |
136-
echo "Ensuring xUnit v3 test apphosts are executable on Linux..."
137-
echo "Configuration: ${{ matrix.configuration }}"
138-
# Dump a bit of info for debugging
139-
find . -path "*/bin/${{ matrix.configuration }}/net*/*" -maxdepth 1 -type f -name "*Tests*" -print || true
140-
# Actually fix permissions
141-
find . -path "*/bin/${{ matrix.configuration }}/net*/*" -type f -name "*Tests*" -exec chmod +x {} +
142-
echo "Permissions fixed."
138+
set -euo pipefail
139+
140+
echo "=== Context ==="
141+
echo "Runner: $RUNNER_OS / $RUNNER_ARCH"
142+
echo "Configuration: ${{ inputs.configuration }}"
143+
echo "Workspace: $GITHUB_WORKSPACE"
144+
echo "PWD: $(pwd)"
145+
echo "Event: $GITHUB_EVENT_NAME"
146+
echo "Ref: $GITHUB_REF"
147+
echo "SHA: $GITHUB_SHA"
148+
echo
149+
150+
echo "=== .NET info ==="
151+
dotnet --info || true
152+
echo
153+
154+
echo "=== Git state ==="
155+
git rev-parse HEAD || true
156+
git status --porcelain || true
157+
git rev-parse --is-shallow-repository || true
158+
echo
159+
160+
# Paths we care about
161+
BIN_GLOB="*/bin/${{ inputs.configuration }}/net*/*"
162+
OBJ_GLOB="*/obj/${{ inputs.configuration }}/net*/*"
163+
164+
echo "=== Brute-force chmod (bin + obj) ==="
165+
find . -type f \( -path "$BIN_GLOB" -o -path "$OBJ_GLOB" \) -exec chmod a+x {} + 2>/dev/null || true
166+
echo "chmod completed (errors ignored)."
167+
echo
168+
169+
echo "=== Mount options (look for noexec) ==="
170+
# If binaries live on a noexec mount, chmod won't help.
171+
mount | sed -n '1,200p' || true
172+
echo
173+
174+
echo "=== Candidate executables (top 200) ==="
175+
# Show what we might execute; exclude obvious managed files
176+
find . -type f -path "$BIN_GLOB" \
177+
! -name "*.dll" ! -name "*.pdb" ! -name "*.json" ! -name "*.xml" \
178+
-printf "%m %u:%g %s %p\n" | head -n 200 || true
179+
echo
180+
181+
echo "=== Likely xUnit / test hosts (if present) ==="
182+
# These names vary; do not rely on just *Tests*
183+
find . -type f -path "$BIN_GLOB" \( \
184+
-name "testhost*" -o \
185+
-name "*xunit*" -o \
186+
-name "*Tests*" -o \
187+
-name "*.runsettings" \
188+
\) -printf "%m %u:%g %s %p\n" | head -n 200 || true
189+
echo
190+
191+
echo "=== Deep diagnostics for any 'testhost' or apphost candidates ==="
192+
# For each likely executable, show the facts that explain 'permission denied' vs 'exec format error'
193+
while IFS= read -r f; do
194+
echo "--- $f ---"
195+
ls -la "$f" || true
196+
197+
# Identify file type and architecture
198+
file -L "$f" || true
199+
200+
# If it's an ELF binary, show its dynamic interpreter and linked libs (exec format errors often show up here)
201+
if file -L "$f" | grep -q "ELF"; then
202+
echo "readelf -l (interpreter):"
203+
readelf -l "$f" 2>/dev/null | sed -n '1,80p' || true
204+
echo "ldd (dependencies):"
205+
ldd "$f" 2>/dev/null || true
206+
fi
207+
208+
# If it's a script, CRLF in the shebang can cause 'Exec format error'
209+
if head -c 2 "$f" 2>/dev/null | grep -q "#!"; then
210+
echo "shebang:"
211+
head -n 1 "$f" | cat -A || true
212+
fi
213+
214+
echo
215+
done < <(
216+
find . -type f -path "$BIN_GLOB" \( \
217+
-name "testhost*" -o \
218+
-name "*xunit*" -o \
219+
-name "*Tests*" \
220+
\) | head -n 50
221+
) || true
222+
223+
echo "=== Done diagnostics step ==="
143224
shell: bash
144225

145226
- name: Test with ${{ matrix.configuration }} build

0 commit comments

Comments
 (0)