Skip to content

Commit 9f44ecd

Browse files
committed
adjust test
1 parent a8776d5 commit 9f44ecd

File tree

1 file changed

+38
-9
lines changed

1 file changed

+38
-9
lines changed

.github/workflows/test-migrations.yml

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,24 @@ jobs:
9090
sleep 5
9191
9292
- name: Verify migrations applied
93+
working-directory: taco
9394
env:
9495
PGPASSWORD: postgres
9596
run: |
96-
echo "Checking if atlas_schema_revisions table exists..."
97-
psql -h localhost -U postgres -d opentaco_test -c "\dt" | grep atlas_schema_revisions
97+
# Check if migrations applied successfully from binary output
98+
if grep -q "migrations applied successfully" statesman.log; then
99+
echo "✅ Migrations applied successfully"
100+
else
101+
echo "❌ Migration success message not found in binary output"
102+
exit 1
103+
fi
104+
105+
# Verify golang-migrate tracking table exists
106+
echo "Checking if schema_migrations table exists..."
107+
psql -h localhost -U postgres -d opentaco_test -c "\dt" | grep schema_migrations
98108
99109
echo "Checking applied migrations..."
100-
psql -h localhost -U postgres -d opentaco_test -c "SELECT version FROM atlas_schema_revisions ORDER BY version;"
110+
psql -h localhost -U postgres -d opentaco_test -c "SELECT version, dirty FROM schema_migrations;"
101111
102112
echo "Checking if key tables exist..."
103113
psql -h localhost -U postgres -d opentaco_test -c "\dt" | grep -E "units|organizations|users|rules"
@@ -172,12 +182,22 @@ jobs:
172182
sleep 5
173183
174184
- name: Verify migrations applied
185+
working-directory: taco
175186
run: |
176-
echo "Checking if atlas_schema_revisions table exists..."
177-
mysql -h 127.0.0.1 -u mysql -pmysql opentaco_test -e "SHOW TABLES;" | grep atlas_schema_revisions
187+
# Check if migrations applied successfully from binary output
188+
if grep -q "migrations applied successfully" statesman.log; then
189+
echo "✅ Migrations applied successfully"
190+
else
191+
echo "❌ Migration success message not found in binary output"
192+
exit 1
193+
fi
194+
195+
# Verify golang-migrate tracking table exists
196+
echo "Checking if schema_migrations table exists..."
197+
mysql -h 127.0.0.1 -u mysql -pmysql opentaco_test -e "SHOW TABLES;" | grep schema_migrations
178198
179199
echo "Checking applied migrations..."
180-
mysql -h 127.0.0.1 -u mysql -pmysql opentaco_test -e "SELECT version FROM atlas_schema_revisions ORDER BY version;"
200+
mysql -h 127.0.0.1 -u mysql -pmysql opentaco_test -e "SELECT version, dirty FROM schema_migrations;"
181201
182202
echo "Checking if key tables exist..."
183203
mysql -h 127.0.0.1 -u mysql -pmysql opentaco_test -e "SHOW TABLES;" | grep -E "units|organizations|users|rules"
@@ -229,11 +249,20 @@ jobs:
229249
- name: Verify migrations applied
230250
working-directory: taco
231251
run: |
232-
echo "Checking if atlas_schema_revisions table exists..."
233-
sqlite3 test.db ".tables" | grep atlas_schema_revisions
252+
# Check if migrations applied successfully from binary output
253+
if grep -q "migrations applied successfully" statesman.log; then
254+
echo "✅ Migrations applied successfully"
255+
else
256+
echo "❌ Migration success message not found in binary output"
257+
exit 1
258+
fi
259+
260+
# Verify golang-migrate tracking table exists
261+
echo "Checking if schema_migrations table exists..."
262+
sqlite3 test.db ".tables" | grep schema_migrations
234263
235264
echo "Checking applied migrations..."
236-
sqlite3 test.db "SELECT version FROM atlas_schema_revisions ORDER BY version;"
265+
sqlite3 test.db "SELECT version, dirty FROM schema_migrations;"
237266
238267
echo "Checking if key tables exist..."
239268
sqlite3 test.db ".tables" | grep -E "units|organizations|users|rules"

0 commit comments

Comments
 (0)