File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
Test/Cardano/Db/Mock/Unit Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ unitTests iom knownMigrations =
39
39
" jsonb-in-schema"
40
40
[ test " jsonb in schema true" Config. configJsonbInSchemaTrue
41
41
, test " jsonb in schema false" Config. configJsonbInSchemaFalse
42
- , expectFailSilent " jsonb in schema should Error" $
43
- Config. configJsonbInSchemaShouldError iom knownMigrations
42
+ , test
43
+ " jsonb true then false should remove datatype from db"
44
+ Config. configJsonbInSchemaShouldAddThenRemove
44
45
]
45
46
, testGroup
46
47
" tx-out"
Original file line number Diff line number Diff line change 4
4
module Test.Cardano.Db.Mock.Unit.Conway.Config.JsonbInSchema (
5
5
configJsonbInSchemaTrue ,
6
6
configJsonbInSchemaFalse ,
7
- configJsonbInSchemaShouldError ,
7
+ configJsonbInSchemaShouldAddThenRemove ,
8
8
) where
9
9
10
10
import qualified Cardano.Db as DB
@@ -74,8 +74,8 @@ configJsonbInSchemaFalse ioManager metadata = do
74
74
{ dncInsertOptions = dncInsertOptions' {sioAddJsonbToSchema = AddJsonbToSchemaConfig False }
75
75
}
76
76
77
- configJsonbInSchemaShouldError :: IOManager -> [(Text , Text )] -> Assertion
78
- configJsonbInSchemaShouldError ioManager metadata = do
77
+ configJsonbInSchemaShouldAddThenRemove :: IOManager -> [(Text , Text )] -> Assertion
78
+ configJsonbInSchemaShouldAddThenRemove ioManager metadata = do
79
79
syncNodeConfig <- mksNodeConfig
80
80
withCustomConfigAndDropDB args (Just syncNodeConfig) cfgDir testLabel action ioManager metadata
81
81
where
@@ -95,11 +95,16 @@ configJsonbInSchemaShouldError ioManager metadata = do
95
95
}
96
96
startDBSync newDbSyncEnv
97
97
threadDelay 7_000_000
98
+ assertEqQuery
99
+ dbSync
100
+ DB. queryJsonbInSchemaExists
101
+ False
102
+ " There should be no jsonb types in database if option has been set to False"
98
103
-- Expected to fail
99
104
checkStillRuns dbSync
100
105
101
106
args = initCommandLineArgs {claFullMode = False }
102
- testLabel = " conwayConfigJsonbInSchemaShouldError "
107
+ testLabel = " configJsonbInSchemaShouldAddThenRemove "
103
108
104
109
cfgDir = conwayConfigDir
105
110
Original file line number Diff line number Diff line change
1
+ []
You can’t perform that action at this time.
0 commit comments