Skip to content

Commit 29cb66e

Browse files
committed
go/cmd/dolt/commands: Declare bankruptcy on signed commit test for now.
1 parent ff7aebb commit 29cb66e

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Diff for: go/cmd/dolt/commands/signed_commits_test.go

+7-10
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"testing"
2525

2626
"github.com/dolthub/dolt/go/cmd/dolt/cli"
27-
"github.com/dolthub/dolt/go/libraries/doltcore/dbfactory"
2827
"github.com/dolthub/dolt/go/libraries/doltcore/env"
2928
"github.com/dolthub/dolt/go/libraries/utils/argparser"
3029
"github.com/dolthub/dolt/go/libraries/utils/config"
@@ -46,9 +45,10 @@ func importKey(t *testing.T, ctx context.Context) {
4645
}
4746

4847
func setupTestDB(t *testing.T, ctx context.Context, fs filesys.Filesys) string {
49-
dir := t.TempDir()
48+
dir, err := os.MkdirTemp(os.TempDir(), "signed_commits")
49+
require.NoError(t, err)
5050
dbDir := filepath.Join(dir, "db")
51-
err := filesys.CopyDir("testdata/signed_commits/db/", dbDir, fs)
51+
err = filesys.CopyDir("testdata/signed_commits/db/", dbDir, fs)
5252
require.NoError(t, err)
5353

5454
log.Println(dbDir)
@@ -79,9 +79,6 @@ func TestSignAndVerifyCommit(t *testing.T) {
7979
ctx := context.Background()
8080
importKey(t, ctx)
8181
dbDir := setupTestDB(t, ctx, filesys.LocalFS)
82-
t.Cleanup(func() {
83-
dbfactory.CloseAllLocalDatabases()
84-
})
8582

8683
global := map[string]string{
8784
"user.name": "First Last",
@@ -93,7 +90,7 @@ func TestSignAndVerifyCommit(t *testing.T) {
9390
apr, err := cli.CreateCommitArgParser().Parse(test.commitArgs)
9491
require.NoError(t, err)
9592

96-
_, err = execCommand(ctx, t, dbDir, CommitCmd{}, test.commitArgs, apr, map[string]string{}, global)
93+
_, err = execCommand(ctx, dbDir, CommitCmd{}, test.commitArgs, apr, map[string]string{}, global)
9794

9895
if test.expectErr {
9996
require.Error(t, err)
@@ -106,14 +103,14 @@ func TestSignAndVerifyCommit(t *testing.T) {
106103
apr, err = cli.CreateLogArgParser(false).Parse(args)
107104
require.NoError(t, err)
108105

109-
logOutput, err := execCommand(ctx, t, dbDir, LogCmd{}, args, apr, map[string]string{}, global)
106+
logOutput, err := execCommand(ctx, dbDir, LogCmd{}, args, apr, map[string]string{}, global)
110107
require.NoError(t, err)
111108
require.Contains(t, logOutput, "Good signature from \"Test User <[email protected]>\"")
112109
})
113110
}
114111
}
115112

116-
func execCommand(ctx context.Context, t *testing.T, wd string, cmd cli.Command, args []string, apr *argparser.ArgParseResults, local, global map[string]string) (output string, err error) {
113+
func execCommand(ctx context.Context, wd string, cmd cli.Command, args []string, apr *argparser.ArgParseResults, local, global map[string]string) (output string, err error) {
117114
err = os.Chdir(wd)
118115
if err != nil {
119116
err = fmt.Errorf("error changing directory to %s: %w", wd, err)
@@ -160,7 +157,7 @@ func execCommand(ctx context.Context, t *testing.T, wd string, cmd cli.Command,
160157

161158
initialOut := os.Stdout
162159
initialErr := os.Stderr
163-
f, err := os.CreateTemp(t.TempDir(), "signed-commit-test-*")
160+
f, err := os.CreateTemp(os.TempDir(), "signed-commit-test-*")
164161
if err != nil {
165162
err = fmt.Errorf("error creating temp file: %w", err)
166163
return

0 commit comments

Comments
 (0)