storj/storagenode/storagenodedb/infodb_test.go
Jeff Wendling b9d8ddaad1
storagenode: remove datetime calls in favor of UTC (#2557)
* storagenode: remove datetime calls in favor of UTC

datetime only has second level granularity whereas string
comparisons don't. Since we're wiping everything anyway, it's
easier to just use UTC everywhere rather than migrate to
datetime calls.

* add utcdb to check that arguments are utc

* storagenodedb: add trivial tests to ensure calls work

This at least tests that all of the timestamps passed in are
in the UTC timezone.

* fix truncated comment and change migrations to be UTC
2019-07-15 13:38:08 -04:00

30 lines
564 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package storagenodedb
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"go.uber.org/zap/zaptest"
"storj.io/storj/internal/testcontext"
)
func Run(t *testing.T, test func(t *testing.T, ctx context.Context, db *DB)) {
log := zaptest.NewLogger(t)
ctx := testcontext.New(t)
defer ctx.Cleanup()
db, err := NewInMemory(log, ctx.Dir("storage"))
require.NoError(t, err)
defer ctx.Check(db.Close)
require.NoError(t, db.CreateTables())
test(t, ctx, db)
}