File tree Expand file tree Collapse file tree
internal/framework/database Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ ARG COMMIT_SHA=unknown
1919ARG BUILD_DATE=unknown
2020
2121# Build the application with CGO disabled for static binary
22- RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
22+ RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build \
2323 -ldflags="-s -w -X main.Version=${VERSION} -X main.CommitSHA=${COMMIT_SHA} -X main.BuildDate=${BUILD_DATE}" \
2424 -o gearbox-agent \
2525 ./cmd/gearbox-agent
Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ func TestWSHandler_HandleEvents(t *testing.T) {
8989 }
9090 defer conn .Close ()
9191
92+ // Wait for subscription to register on the server side
93+ time .Sleep (50 * time .Millisecond )
94+
9295 // Publish an event
9396 testEvent := events .NewEvent (events .EventSyncStarted , map [string ]interface {}{
9497 "test_key" : "test_value" ,
@@ -135,6 +138,9 @@ func TestWSHandler_MultipleEvents(t *testing.T) {
135138 }
136139 defer conn .Close ()
137140
141+ // Wait for subscription to register on the server side
142+ time .Sleep (50 * time .Millisecond )
143+
138144 // Publish multiple events
139145 eventTypes := []events.EventType {
140146 events .EventSyncStarted ,
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ ARG COMMIT_SHA=unknown
3333ARG BUILD_DATE=unknown
3434
3535# Build the application with CGO enabled for sqlite3
36- RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
36+ RUN CGO_ENABLED=1 GOOS=linux GOARCH=${TARGETARCH} go build \
3737 -ldflags="-s -w -X main.Version=${VERSION} -X main.CommitSHA=${COMMIT_SHA} -X main.BuildDate=${BUILD_DATE}" \
3838 -o gearbox \
3939 ./cmd/server
Original file line number Diff line number Diff line change @@ -198,6 +198,14 @@ func TestIsEntityDisabled(t *testing.T) {
198198func TestMigrationSystemInitialization (t * testing.T ) {
199199 db := setupTestDB (t )
200200
201+ // Check if migration files exist using the same logic as the migration manager
202+ mm := NewMigrateManager (db .db , db .logger )
203+ hasMigrations := mm .hasMigrationFiles ()
204+
205+ if ! hasMigrations {
206+ t .Skip ("no migration files present, skipping migration verification" )
207+ }
208+
201209 // Verify migration tracking table exists
202210 var count int
203211 err := db .db .QueryRow ("SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='schema_migrations'" ).Scan (& count )
You can’t perform that action at this time.
0 commit comments