Skip to content

Commit 9f843cf

Browse files
fix: tests
1 parent 520e3e0 commit 9f843cf

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

.github/scripts/test-analyzer.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ base_tests_file=$(mktemp)
77

88
function cleanup {
99
rm -f "$current_tests_file" "$base_tests_file"
10-
# Restore any stashed changes
11-
if git rev-parse --verify --quiet stash@{0} >/dev/null; then
12-
git stash pop >/dev/null 2>&1
13-
fi
1410
}
1511
trap cleanup EXIT
1612

@@ -20,11 +16,16 @@ function extract_tests() {
2016
perl -ne 'if (/^\s*test\(['\''"](.+?)['\''"]/) { print "$1|'$file'\n" }' "$file" 2>/dev/null
2117
}
2218

23-
# Stash any changes
24-
git stash -u >/dev/null 2>&1 || true
25-
26-
# Save current branch name
27-
current_branch=$(git rev-parse --abbrev-ref HEAD)
19+
# Save current state
20+
if [ -n "$(git status --porcelain)" ]; then
21+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
22+
git config --global user.name "github-actions[bot]"
23+
git add .
24+
git commit -m "temp: Save changes before test analysis" >/dev/null 2>&1
25+
need_restore=true
26+
else
27+
need_restore=false
28+
fi
2829

2930
# Extract current branch tests
3031
while IFS= read -r file; do
@@ -42,8 +43,11 @@ while IFS= read -r file; do
4243
fi
4344
done < <(find tests/suites -type f -name "*.test.ts") | sort > "$base_tests_file"
4445

45-
# Return to original branch
46-
git checkout "$current_branch" >/dev/null 2>&1
46+
# Return to original branch and restore changes if needed
47+
git checkout - >/dev/null 2>&1
48+
if [ "$need_restore" = true ]; then
49+
git reset --soft HEAD^ >/dev/null 2>&1
50+
fi
4751

4852
# Compare and collect results
4953
new_tests=0

.github/workflows/quality.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,6 @@ jobs:
217217
name: playwright-artifacts
218218
path: playwright-artifacts
219219

220-
- name: Setup git config
221-
run: |
222-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
223-
git config --global user.name "github-actions[bot]"
224-
225220
- name: Analyze test changes
226221
id: analyze_tests
227222
run: |

0 commit comments

Comments
 (0)