Skip to content

Commit 52c0432

Browse files
alnrory-bot
authored andcommitted
feat: bump CRDB, establish foreign key,
GitOrigin-RevId: ca6d967ddb2e2eeb2d2eaf25e851652dddbc1d47
1 parent 8ff62f8 commit 52c0432

File tree

5 files changed

+8
-15
lines changed

5 files changed

+8
-15
lines changed

oryx/logrusx/logrus.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -245,22 +245,10 @@ func NewT(t testing.TB, opts ...Option) *Logger {
245245
t.Fatalf("Logger exited with code %d", code)
246246
}))
247247
l := New(t.Name(), "test", opts...)
248-
l.Logger.Out = &testOutput{t}
248+
l.Logger.Out = t.Output()
249249
return l
250250
}
251251

252-
type testOutput struct {
253-
t testing.TB
254-
}
255-
256-
func (t *testOutput) Write(p []byte) (n int, err error) {
257-
if t.t == nil {
258-
return os.Stdout.Write(p)
259-
}
260-
t.t.Log(t.t.Name() + " " + string(p))
261-
return len(p), nil
262-
}
263-
264252
func NewAudit(name string, version string, opts ...Option) *Logger {
265253
return New(name, version, opts...).WithField("audience", "audit")
266254
}

oryx/popx/migrator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ func (mb *MigrationBox) UpTo(ctx context.Context, step int) (applied int, err er
138138

139139
// Down runs pending "down" migrations and rolls back the
140140
// database by the specified number of steps.
141+
// If step <= 0, all down migrations are run.
141142
func (mb *MigrationBox) Down(ctx context.Context, steps int) (err error) {
142143
ctx, span := startSpan(ctx, MigrationDownOpName, trace.WithAttributes(attribute.Int("steps", steps)))
143144
defer otelx.End(span, &err)

oryx/popx/transaction.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ func WithTransaction(ctx context.Context, tx *pop.Connection) context.Context {
2222
return context.WithValue(ctx, transactionKey, tx)
2323
}
2424

25+
func InTransaction(ctx context.Context) bool {
26+
return ctx.Value(transactionKey) != nil
27+
}
28+
2529
func Transaction(ctx context.Context, connection *pop.Connection, callback func(context.Context, *pop.Connection) error) error {
2630
c := ctx.Value(transactionKey)
2731
if c != nil {

oryx/sqlcon/dockertest/cockroach.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
func NewLocalTestCRDBServer(t testing.TB) string {
14-
ts, err := testserver.NewTestServer(testserver.CustomVersionOpt("23.1.13"))
14+
ts, err := testserver.NewTestServer(testserver.CustomVersionOpt("25.3.3"))
1515
require.NoError(t, err)
1616
t.Cleanup(ts.Stop)
1717

oryx/sqlcon/dockertest/test_helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ func RunTestCockroachDB(t testing.TB) string {
356356
return RunTestCockroachDBWithVersion(t, "")
357357
}
358358

359-
// RunTestCockroachDB runs a CockroachDB database and returns the URL to it.
359+
// RunTestCockroachDBWithVersion runs a CockroachDB database and returns the URL to it.
360360
// If a docker container is started for the database, the container be removed
361361
// at the end of the test.
362362
func RunTestCockroachDBWithVersion(t testing.TB, version string) string {

0 commit comments

Comments
 (0)