Skip to content

Instantly share code, notes, and snippets.

@patrickmscott
patrickmscott / blog.md
Last active July 13, 2020 12:44
Testing @ Even

Testing @ Even

We run lots (~4200) of tests every time an engineer at Even makes a pull request. At first, running all of those tests was slow and required a bunch of complicated support code. But since I joined in October 2018, we have totally revamped the way we run tests. This post tells the story of how we made testing faster and easier on our backend services. If you're interested in learning more, or want to help us improve testing our React Native mobile apps, we're hiring.

TL;DR;

@patrickmscott
patrickmscott / model.go
Created November 2, 2018 15:06
Longer example
type PayrollModel interface {
GetPayrollForCustomerID(context.Context, CustomerID) (*Payroll, error)
InsertOrUpdatePayroll(context.Context, UpsertPayrollInput) error
}
type payrollModelImpl struct {
dbx db.SQLExecutor
}
func (impl *payrollModelImpl) GetPayrollForCustomerID(ctx context.Context, CustomerID) (*Payroll, error) {
@patrickmscott
patrickmscott / model.go
Created November 2, 2018 13:06
Model interface proposal
type PayrollModel interface {
Get(context.Context) (*Payroll, error)
}
func NewPayrollModel(dbx db.SQLExecutor) PayrollModel {
return &payrollModelImpl{db: db}
}
type payrollModelImpl struct {
db db.SQLExecutor