Skip to content

Commit 076c0b8

Browse files
committed
refactor(visual-regressions): only check img files
1 parent d5e7364 commit 076c0b8

File tree

1 file changed

+10
-42
lines changed

1 file changed

+10
-42
lines changed

core/scripts/testing/e2e-script.sh

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,53 +21,11 @@ if [ "$updateTruths" = "y" ]; then
2121
# New line
2222
echo ""
2323

24-
# Keep track of whether there are uncommitted changes
25-
hasUncommittedChanges=false
26-
27-
# check if there are any uncommitted changes
28-
if [ -n "$(git status --porcelain)" ]; then
29-
# There are uncommitted changes
30-
hasUncommittedChanges=true
31-
32-
# Inform the user that there are uncommitted changes
33-
echo "There are uncommitted changes in the current branch. Stashing the changes temporarily to avoid conflicts..."
34-
35-
# New line
36-
echo ""
37-
38-
# Stash the local changes
39-
git stash
40-
fi
41-
42-
# Inform the user that the base branch is being updated
43-
echo "Updating the base branch..."
44-
45-
# New line
46-
echo ""
47-
4824
# Check if the user provided a base branch
4925
if [ -z "$baseBranch" ]; then
5026
# Default base branch is main
5127
baseBranch="main"
5228
fi
53-
54-
# Update the base branch without checking out the branch
55-
git pull origin $baseBranch
56-
57-
# New line
58-
echo ""
59-
60-
# If there were uncommitted changes then pop the stash
61-
if [ "$hasUncommittedChanges" = true ]; then
62-
# Inform the user that the local changes are being popped
63-
echo "Popping local changes..."
64-
65-
# New line
66-
echo ""
67-
68-
# Pop the local changes
69-
git stash pop
70-
fi
7129
fi
7230

7331
# inform the user that the core is being built
@@ -147,3 +105,13 @@ read -n 1 viewReport
147105
if [ "$viewReport" = "y" ]; then
148106
npx playwright show-report
149107
fi
108+
109+
# Clean up the local ground truths
110+
git reset -- src/**/*-linux.png
111+
git restore -- src/**/*-linux.png
112+
113+
# New line
114+
echo ""
115+
116+
# Inform the user that the script has finished running
117+
echo "Script has finished running. Local ground truths have been restored to their original state in order to avoid committing them."

0 commit comments

Comments
 (0)