Skip to content

Commit 728dd82

Browse files
committed
debug cli tests
1 parent 8e7951a commit 728dd82

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cmd/dbos/cli_integration_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"bytes"
55
"context"
6+
"database/sql"
67
"encoding/json"
78
"fmt"
89
"io"
@@ -16,6 +17,7 @@ import (
1617
"time"
1718

1819
"github.com/dbos-inc/dbos-transact-golang/dbos"
20+
_ "github.com/jackc/pgx/v5/stdlib"
1921
"github.com/stretchr/testify/assert"
2022
"github.com/stretchr/testify/require"
2123
)
@@ -68,6 +70,17 @@ func TestCLIWorkflow(t *testing.T) {
6870
require.NoError(t, err, "Reset database command failed: %s", string(output))
6971

7072
assert.Contains(t, string(output), "System database has been reset successfully", "Output should confirm database reset")
73+
74+
// log in the database and ensure the dbos schema does not exist anymore
75+
db, err := sql.Open("pgx", getDatabaseURL())
76+
require.NoError(t, err)
77+
defer db.Close()
78+
79+
var exists bool
80+
err = db.QueryRow("SELECT EXISTS(SELECT 1 FROM information_schema.schemata WHERE schema_name = 'dbos')").Scan(&exists)
81+
require.NoError(t, err)
82+
83+
assert.False(t, exists, "DBOS schema should not exist")
7184
})
7285

7386
t.Run("ProjectInitialization", func(t *testing.T) {

0 commit comments

Comments
 (0)