@@ -45,135 +45,6 @@ jobs:
4545 fi
4646 shell : bash
4747
48- # For these tests, we want ripgrep to ignore the same files as refaktor
49- - name : Setup .rgignore
48+ - name : Run e2e test
5049 run : |
51- cp .rfignore .rgignore
52- echo .rgignore >> .git/info/exclude
53-
54- - name : Build refaktor
55- run : |
56- cargo build --release
57- ./target/release/refaktor --version
58-
59- - name : Test refaktor -> smart_search_and_replace
60- run : |
61- echo "=== Testing refaktor rename to smart_search_and_replace ==="
62-
63- # Use refaktor to rename itself using plan/apply
64- ./target/release/refaktor plan refaktor smart_search_and_replace --preview table
65- ./target/release/refaktor apply
66-
67- # Verify no instances of "refaktor" remain in the codebase (case-insensitive)
68- echo "Checking for remaining instances of 'refaktor'..."
69- if rg -i refaktor; then
70- echo "ERROR: Found remaining instances of 'refaktor' in the codebase!"
71- exit 1
72- fi
73-
74- # Verify the rename worked by checking key dirs / files
75- if [ -d "refaktor-core" ]; then
76- echo "ERROR: refaktor-core directory still exists!"
77- exit 1
78- fi
79- if [ ! -f "smart-search-and-replace-core/Cargo.toml" ]; then
80- echo "ERROR: smart-search-and-replace-core/Cargo.toml not found!"
81- exit 1
82- fi
83-
84- echo "✓ No instances of 'refaktor' found"
85- shell : bash
86-
87- - name : Test undo
88- run : |
89- echo "=== Testing undo functionality ==="
90-
91- # Undo the rename
92- ./target/release/refaktor undo latest
93-
94- # Verify the undo worked
95- if [ -f "smart-search-and-replace-core/Cargo.toml" ]; then
96- echo "ERROR: smart-search-and-replace-core/Cargo.toml still exists!"
97- exit 1
98- fi
99-
100- # The working directory should be clean after the undo
101- if [ -n "$(git status --porcelain)" ]; then
102- echo "ERROR: Working directory is not clean after undo!"
103- git status
104- git diff
105- exit 1
106- fi
107-
108- echo "✓ Working directory is clean - undo successful!"
109- shell : bash
110-
111- - name : Test redo
112- run : |
113- echo "=== Testing redo functionality ==="
114-
115- # Redo the rename
116- ./target/release/refaktor redo latest
117-
118- # Verify no instances of "refaktor" remain in the codebase (case-insensitive)
119- echo "Checking for remaining instances of 'refaktor'..."
120- if rg -i "refaktor"; then
121- echo "ERROR: Found remaining instances of 'refaktor' in the codebase!"
122- exit 1
123- fi
124- echo "✓ No instances of 'refaktor' found"
125- shell : bash
126-
127- - name : Build smart_search_and_replace
128- run : |
129- rm -rf target
130- cargo build --release
131- ./target/release/smart_search_and_replace --version
132-
133- - name : Test smart_search_and_replace -> refaktor
134- run : |
135- echo "=== Testing smart_search_and_replace rename back to refaktor ==="
136-
137- # Use smart_search_and_replace to rename itself back
138- ./target/release/smart_search_and_replace rename smart_search_and_replace refaktor --preview table
139-
140- # Verify the rename worked
141- if [ -f "smart-search-and-replace-core/Cargo.toml" ]; then
142- echo "ERROR: smart-search-and-replace-core/Cargo.toml still exists!"
143- exit 1
144- fi
145- if [ ! -f "refaktor-core/Cargo.toml" ]; then
146- echo "ERROR: refaktor-core/Cargo.toml not found!"
147- exit 1
148- fi
149-
150- # Verify no instances of "smart_search_and_replace" or "smart-search-and-replace" remain
151- echo "Checking for remaining instances of 'smart_search_and_replace' or 'smart-search-and-replace'..."
152- if rg "(smart_search_and_replace|smart-search-and-replace|smartsearchandreplace)"; then
153- echo "ERROR: Found remaining instances of 'smart_search_and_replace' in the codebase!"
154- exit 1
155- fi
156- echo "✓ No instances of 'smart_search_and_replace' found"
157-
158- - name : Build refaktor again
159- run : |
160- # Clean and rebuild with original name
161- rm -rf target
162- cargo build --release
163-
164- # Final verification
165- ./target/release/refaktor --version
166- ./target/release/refaktor --help
167- shell : bash
168-
169- - name : Verify git status is clean
170- run : |
171- # The working directory should be clean after the round-trip
172- if [ -n "$(git status --porcelain)" ]; then
173- echo "ERROR: Working directory is not clean after round-trip!"
174- git status
175- git diff
176- exit 1
177- fi
178- echo "✓ Working directory is clean - round-trip successful!"
179- shell : bash
50+ ./scripts/e2e-test.sh
0 commit comments