Skip to content

Commit 69b6e0d

Browse files
committed
fix(ci): use git diff --quiet to avoid duplicate diff output in musl E2E
1 parent 871dce8 commit 69b6e0d

4 files changed

Lines changed: 3 additions & 6 deletions

File tree

  • .github/workflows
  • packages/cli
    • snap-tests-global
      • migration-eslint-lintstagedrc
      • migration-existing-lint-staged-config
    • snap-tests/command-init-inline-config-existing

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ jobs:
435435
- name: Run CLI snapshot tests
436436
run: |
437437
RUST_BACKTRACE=1 pnpm test
438-
if ! git diff --exit-code; then
438+
if ! git diff --quiet; then
439439
echo "::error::Snapshot diff detected. Run 'pnpm -F vite-plus snap-test' locally and commit the updated snap.txt files."
440440
git diff --stat
441441
git diff
@@ -690,7 +690,7 @@ jobs:
690690
# Run snap tests
691691
git config --global --add safe.directory /workspace
692692
RUST_BACKTRACE=1 pnpm test
693-
if ! git diff --exit-code; then
693+
if ! git diff --quiet; then
694694
echo '::error::Snapshot diff detected. Run pnpm -F vite-plus snap-test locally and commit the updated snap.txt files.'
695695
git diff --stat
696696
git diff

packages/cli/snap-tests-global/migration-eslint-lintstagedrc/snap.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ VITE+ - The Unified Toolchain for the Web
2727
}
2828

2929
> test ! -f .lintstagedrc.json # check lintstagedrc.json is removed
30-
3130
> cat vite.config.ts # check oxlint config merged into vite.config.ts
3231
import { defineConfig } from 'vite-plus';
3332

packages/cli/snap-tests-global/migration-existing-lint-staged-config/snap.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ VITE+ - The Unified Toolchain for the Web
2727
}
2828

2929
> test ! -f .lintstagedrc.json # check lintstagedrc.json (should be deleted after inlining to vite.config.ts)
30-
3130
> cat vite.config.ts # check staged config migrated to vite.config.ts
3231
import { defineConfig } from 'vite-plus';
3332

packages/cli/snap-tests/command-init-inline-config-existing/snap.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
Skipped initialization: 'lint' already exists in 'vite.config.ts'.
33

44
> test ! -f .oxlintrc.json # check .oxlintrc.json is not created
5-
65
> vp fmt --init
76
Skipped initialization: 'fmt' already exists in 'vite.config.ts'.
87

9-
> test ! -f .oxfmtrc.json # check .oxfmtrc.json is not created
8+
> test ! -f .oxfmtrc.json # check .oxfmtrc.json is not created

0 commit comments

Comments
 (0)