Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .mise-tasks/test/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ tests=(
"TestE2E_DynamicEvent_MultipleEventTypes"
"TestE2E_ReplayEvent_JobID_Format"
"TestE2E_ReplayEvent_MultipleReplays"
"TestE2E_BackupProjectData_MinIO"
"TestE2E_BackupProjectData_OnPrem"
"TestE2E_BackupProjectData_MultiTenant"
"TestE2E_BackupProjectData_TimeFiltering"
"TestE2E_BackupProjectData_AllTables"
)

# Counter for passed tests
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ test_e2e:
@go test -v ./e2e/... -run TestE2E_DynamicEvent_MultipleEventTypes -timeout 2m
@go test -v ./e2e/... -run TestE2E_ReplayEvent_JobID_Format -timeout 2m
@go test -v ./e2e/... -run TestE2E_ReplayEvent_MultipleReplays -timeout 2m
@echo "Running Backup E2E tests..."
@go test -v ./e2e/... -run TestE2E_BackupProjectData_MinIO -timeout 2m
@go test -v ./e2e/... -run TestE2E_BackupProjectData_OnPrem -timeout 2m
@go test -v ./e2e/... -run TestE2E_BackupProjectData_MultiTenant -timeout 2m
@go test -v ./e2e/... -run TestE2E_BackupProjectData_TimeFiltering -timeout 2m
@go test -v ./e2e/... -run TestE2E_BackupProjectData_AllTables -timeout 2m
@echo "✅ All E2E tests passed!"

# Run all E2E tests together (may be flaky, use test_e2e for CI)
Expand Down
10 changes: 5 additions & 5 deletions api/handlers/delivery_attempt.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"

"github.com/frain-dev/convoy/database/postgres"
"github.com/frain-dev/convoy/datastore"
"github.com/frain-dev/convoy/internal/delivery_attempts"
"github.com/frain-dev/convoy/util"
)

Expand Down Expand Up @@ -45,8 +45,8 @@ func (h *Handler) GetDeliveryAttempt(w http.ResponseWriter, r *http.Request) {
return
}

attemptsRepo := postgres.NewDeliveryAttemptRepo(h.A.DB)
deliveryAttempt, err := attemptsRepo.FindDeliveryAttemptById(r.Context(), eventDelivery.UID, deliveryAttemptID)
attemptsService := delivery_attempts.New(h.A.Logger, h.A.DB)
deliveryAttempt, err := attemptsService.FindDeliveryAttemptById(r.Context(), eventDelivery.UID, deliveryAttemptID)
if err != nil {
_ = render.Render(w, r, util.NewServiceErrResponse(err))
return
Expand Down Expand Up @@ -76,8 +76,8 @@ func (h *Handler) GetDeliveryAttempts(w http.ResponseWriter, r *http.Request) {
return
}

attemptsRepo := postgres.NewDeliveryAttemptRepo(h.A.DB)
attempts, err := attemptsRepo.FindDeliveryAttempts(r.Context(), eventDelivery.UID)
attemptsService := delivery_attempts.New(h.A.Logger, h.A.DB)
attempts, err := attemptsService.FindDeliveryAttempts(r.Context(), eventDelivery.UID)
if err != nil {
_ = render.Render(w, r, util.NewServiceErrResponse(err))
return
Expand Down
3 changes: 2 additions & 1 deletion cmd/hooks/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/frain-dev/convoy/database/listener"
"github.com/frain-dev/convoy/database/postgres"
"github.com/frain-dev/convoy/datastore"
"github.com/frain-dev/convoy/internal/delivery_attempts"
"github.com/frain-dev/convoy/internal/organisations"
"github.com/frain-dev/convoy/internal/pkg/cli"
fflag2 "github.com/frain-dev/convoy/internal/pkg/fflag"
Expand Down Expand Up @@ -165,7 +166,7 @@ func PreRun(app *cli.App, db *postgres.Postgres) func(cmd *cobra.Command, args [
projectRepo := postgres.NewProjectRepo(postgresDB)

metaEventRepo := postgres.NewMetaEventRepo(postgresDB)
attemptsRepo := postgres.NewDeliveryAttemptRepo(postgresDB)
attemptsRepo := delivery_attempts.New(lo, postgresDB)
endpointListener := listener.NewEndpointListener(q, projectRepo, metaEventRepo)
eventDeliveryListener := listener.NewEventDeliveryListener(q, projectRepo, metaEventRepo, attemptsRepo)

Expand Down
5 changes: 3 additions & 2 deletions cmd/utils/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/frain-dev/convoy/config"
"github.com/frain-dev/convoy/database/postgres"
"github.com/frain-dev/convoy/internal/delivery_attempts"
"github.com/frain-dev/convoy/internal/pkg/cli"
"github.com/frain-dev/convoy/internal/pkg/fflag"
)
Expand Down Expand Up @@ -38,7 +39,7 @@ func AddPartitionCommand(a *cli.App) *cobra.Command {

eventsRepo := postgres.NewEventRepo(a.DB)
eventDeliveryRepo := postgres.NewEventDeliveryRepo(a.DB)
deliveryAttemptsRepo := postgres.NewDeliveryAttemptRepo(a.DB)
deliveryAttemptsRepo := delivery_attempts.New(a.Logger, a.DB)

// if the table name isn't supplied, then we will run all of them at the same time
if len(args) == 0 {
Expand Down Expand Up @@ -122,7 +123,7 @@ func AddUnPartitionCommand(a *cli.App) *cobra.Command {

eventsRepo := postgres.NewEventRepo(a.DB)
eventDeliveryRepo := postgres.NewEventDeliveryRepo(a.DB)
deliveryAttemptsRepo := postgres.NewDeliveryAttemptRepo(a.DB)
deliveryAttemptsRepo := delivery_attempts.New(a.Logger, a.DB)

// if the table name isn't supplied, then we will run all of them at the same time
if len(args) == 0 {
Expand Down
3 changes: 2 additions & 1 deletion cmd/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/frain-dev/convoy/config"
"github.com/frain-dev/convoy/database/postgres"
"github.com/frain-dev/convoy/datastore"
"github.com/frain-dev/convoy/internal/delivery_attempts"
"github.com/frain-dev/convoy/internal/organisations"
"github.com/frain-dev/convoy/internal/pkg/cli"
"github.com/frain-dev/convoy/internal/pkg/fflag"
Expand Down Expand Up @@ -151,7 +152,7 @@ func StartWorker(ctx context.Context, a *cli.App, cfg config.Configuration) erro
eventDeliveryRepo := postgres.NewEventDeliveryRepo(a.DB)
subRepo := postgres.NewSubscriptionRepo(a.DB)
configRepo := postgres.NewConfigRepo(a.DB)
attemptRepo := postgres.NewDeliveryAttemptRepo(a.DB)
attemptRepo := delivery_attempts.New(a.Logger, a.DB)
filterRepo := postgres.NewFilterRepo(a.DB)
batchRetryRepo := postgres.NewBatchRetryRepo(a.DB)

Expand Down
Loading
Loading