Skip to content

Commit 7084d5f

Browse files
committed
fix(ci): skip snap tests that install vite-plus from npm on musl
Published vite-plus 0.1.13 doesn't include musl NAPI bindings yet. Skip tests that depend on the npm-published package on musl targets: - migration tests that install vite-plus@latest - command-pack-exe (uses tsdown which loads rolldown binding) - command-upgrade-check Remove debug steps from CI now that root cause is identified.
1 parent 5870384 commit 7084d5f

11 files changed

Lines changed: 95 additions & 40 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -669,13 +669,6 @@ jobs:
669669
cp ./package/rolldown-binding.linux-x64-musl.node ./rolldown/packages/rolldown/dist/shared/
670670
rm -rf package *.tgz
671671
672-
# Debug: verify rolldown musl binding exists
673-
echo '=== Verify rolldown musl binding ==='
674-
ls -la ./packages/core/dist/rolldown/shared/rolldown-binding.linux-x64-musl.node
675-
ls -la ./rolldown/packages/rolldown/dist/shared/rolldown-binding.linux-x64-musl.node
676-
# Also check the rolldown src dir (used by rolldown source builds)
677-
ls -la ./rolldown/packages/rolldown/src/rolldown-binding.*.node
678-
679672
pnpm bootstrap-cli:ci
680673
export PATH=\"/root/.vite-plus/bin:\$PATH\"
681674
@@ -693,32 +686,15 @@ jobs:
693686
tsc --version
694687
vp uninstall -g typescript
695688
696-
# Debug: run failing snap tests manually to see full output
697-
echo '=== Debug: command-pack-exe ==='
698-
cd packages/cli/snap-tests-global/command-pack-exe
699-
VITE_DISABLE_AUTO_INSTALL=1 vp pack src/index.ts --exe 2>&1 || true
700-
ls dist 2>&1 || true
701-
ls build 2>&1 || true
702-
./build/index 2>&1 || true
703-
rm -rf dist build
704-
cd /workspace
705-
706-
echo '=== Debug: migration-auto-create-vite-config ==='
707-
TMPDIR=\$(mktemp -d)
708-
cp -r packages/cli/snap-tests-global/migration-auto-create-vite-config/* \$TMPDIR/
709-
cd \$TMPDIR
710-
echo '--- vp migrate --no-interactive ---'
711-
vp migrate --no-interactive 2>&1 || true
712-
echo '--- cat vite.config.ts ---'
713-
cat vite.config.ts 2>&1 || true
714-
echo '--- cat .oxlintrc.json ---'
715-
cat .oxlintrc.json 2>&1 || true
716-
echo '--- cat .oxfmtrc.json ---'
717-
cat .oxfmtrc.json 2>&1 || true
718-
echo '--- cat package.json ---'
719-
cat package.json 2>&1 || true
720-
cd /workspace
721-
rm -rf \$TMPDIR
689+
# Run snap tests
690+
git config --global --add safe.directory /workspace
691+
RUST_BACKTRACE=1 pnpm test
692+
if ! git diff --exit-code; then
693+
echo '::error::Snapshot diff detected. Run pnpm -F vite-plus snap-test locally and commit the updated snap.txt files.'
694+
git diff --stat
695+
git diff
696+
exit 1
697+
fi
722698
"
723699
724700
install-e2e-test:
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
{
2-
"ignoredPlatforms": ["win32"],
2+
"ignoredPlatforms": [
3+
"win32",
4+
{
5+
"os": "linux",
6+
"libc": "musl"
7+
}
8+
],
39
"env": {
410
"VITE_DISABLE_AUTO_INSTALL": "1"
511
},
6-
"commands": ["vp pack src/index.ts --exe 2>&1", "ls dist", "ls build", "./build/index"],
7-
"after": ["rm -rf dist", "rm -rf build"]
12+
"commands": [
13+
"vp pack src/index.ts --exe 2>&1",
14+
"ls dist",
15+
"ls build",
16+
"./build/index"
17+
],
18+
"after": [
19+
"rm -rf dist",
20+
"rm -rf build"
21+
]
822
}
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
{
22
"commands": [
3-
{ "command": "git init", "ignoreOutput": true },
4-
{ "command": "git config core.hooksPath .husky/_", "ignoreOutput": true },
3+
{
4+
"command": "git init",
5+
"ignoreOutput": true
6+
},
7+
{
8+
"command": "git config core.hooksPath .husky/_",
9+
"ignoreOutput": true
10+
},
511
"vp migrate --no-interactive # should override husky's core.hooksPath and migrate hooks",
612
"cat package.json # husky/lint-staged should be removed, prepare should be vp config",
713
"cat .vite-hooks/pre-commit # pre-commit hook should be rewritten",
814
"git config --local core.hooksPath # should be .vite-hooks/_"
15+
],
16+
"ignoredPlatforms": [
17+
{
18+
"os": "linux",
19+
"libc": "musl"
20+
}
921
]
1022
}
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
{
22
"commands": [
3-
{ "command": "git init", "ignoreOutput": true },
3+
{
4+
"command": "git init",
5+
"ignoreOutput": true
6+
},
47
"vp migrate --no-interactive # should still migrate husky/lint-staged even though vite-plus exists",
58
"cat package.json # husky/lint-staged should be removed, prepare should be vp config",
69
"cat .vite-hooks/pre-commit # pre-commit hook should be rewritten",
710
"test -d .husky && echo '.husky directory exists' || echo 'No .husky directory' # .husky should be removed"
11+
],
12+
"ignoredPlatforms": [
13+
{
14+
"os": "linux",
15+
"libc": "musl"
16+
}
817
]
918
}
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"commands": ["vp migrate --no-interactive # should detect existing vite-plus and exit"]
2+
"commands": [
3+
"vp migrate --no-interactive # should detect existing vite-plus and exit"
4+
],
5+
"ignoredPlatforms": [
6+
{
7+
"os": "linux",
8+
"libc": "musl"
9+
}
10+
]
311
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"commands": [
33
"vp migrate --no-interactive # should show legacy config warning and already using Vite+"
4+
],
5+
"ignoredPlatforms": [
6+
{
7+
"os": "linux",
8+
"libc": "musl"
9+
}
410
]
511
}

packages/cli/snap-tests-global/migration-eslint-lint-staged-mjs/steps.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22
"commands": [
33
"vp migrate --no-interactive # migration should warn about non-JSON lint-staged config",
44
"cat lint-staged.config.mjs # verify non-JSON lint-staged config is preserved unchanged"
5+
],
6+
"ignoredPlatforms": [
7+
{
8+
"os": "linux",
9+
"libc": "musl"
10+
}
511
]
612
}

packages/cli/snap-tests-global/migration-eslint-rerun-dual-config/steps.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@
55
"cat eslint.config.mjs && exit 1 || true # check flat config is removed",
66
"cat .eslintrc && exit 1 || true # check legacy config is also removed",
77
"cat vite.config.ts # check oxlint config merged into vite.config.ts"
8+
],
9+
"ignoredPlatforms": [
10+
{
11+
"os": "linux",
12+
"libc": "musl"
13+
}
814
]
915
}

packages/cli/snap-tests-global/migration-eslint-rerun-mjs/steps.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@
44
"cat package.json # check eslint removed from devDependencies and scripts rewritten",
55
"cat eslint.config.mjs && exit 1 || true # check eslint config is removed",
66
"cat vite.config.mjs # check oxlint config merged into existing vite.config.mjs (not creating vite.config.ts)"
7+
],
8+
"ignoredPlatforms": [
9+
{
10+
"os": "linux",
11+
"libc": "musl"
12+
}
713
]
814
}

packages/cli/snap-tests-global/migration-eslint-rerun/steps.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@
44
"cat package.json # check eslint removed from devDependencies and scripts rewritten",
55
"cat eslint.config.mjs && exit 1 || true # check eslint config is removed",
66
"cat vite.config.ts # check oxlint config merged into vite.config.ts"
7+
],
8+
"ignoredPlatforms": [
9+
{
10+
"os": "linux",
11+
"libc": "musl"
12+
}
713
]
814
}

0 commit comments

Comments
 (0)