@@ -48,13 +48,17 @@ class SkunkBinaryCompatibilitySuite
48
48
49
49
class SkunkPersistenceSuite
50
50
extends PersistenceSuite (
51
- backend( " skunk_persistence " , jsonbCodec),
51
+ backendCross( " persistence " , jsonbCodec),
52
52
" skunk"
53
53
)
54
54
55
55
class SkunkPersistenceKeywordNamespaceSuite
56
56
extends PersistenceSuite (
57
- backend(" order" , jsonbCodec),
57
+ backend(
58
+ " order" ,
59
+ jsonbCodec,
60
+ dbName = s " Skunk_ ${BuildInfo .crossProjectPlatform}"
61
+ ),
58
62
" skunk"
59
63
)
60
64
@@ -73,23 +77,24 @@ object SkunkCompatibilitySuite {
73
77
i => ByteVector .fromHex(i.toString).get.toArray,
74
78
a => Either .catchNonFatal(ByteVector (a).toHex.toInt).leftMap(_.getMessage)
75
79
)
76
- private val database = Session
80
+ private def database ( name : String ) = Session
77
81
.pooled[IO ](
78
- " localhost" ,
79
- 5432 ,
80
- " postgres" ,
81
- " postgres " ,
82
- Some (" postgres" ),
82
+ host = " localhost" ,
83
+ port = 5432 ,
84
+ user = " postgres" ,
85
+ database = name.toLowerCase() ,
86
+ password = Some (" postgres" ),
83
87
4
84
88
)
85
89
86
90
inline def backend (
87
91
inline name : String ,
88
- codec : BackendCodec [Int ]
92
+ codec : BackendCodec [Int ],
93
+ dbName : String = " postgres"
89
94
): Resource [IO , Backend [IO , Int , Int , String , Int ]] =
90
95
given BackendCodec [Int ] = codec
91
96
import TestDomain .given_ModelTC_State_Event_Rejection
92
- database
97
+ database(dbName)
93
98
.flatMap(pool =>
94
99
Backend
95
100
.builder(TestDomainModel )
@@ -99,13 +104,24 @@ object SkunkCompatibilitySuite {
99
104
.build
100
105
)
101
106
102
- inline def backendCqrs (
107
+ inline def backendCross (
103
108
inline name : String ,
104
109
codec : BackendCodec [Int ]
110
+ ): Resource [IO , Backend [IO , Int , Int , String , Int ]] =
111
+ backend(
112
+ name + " _" + BuildInfo .crossProjectPlatform,
113
+ codec,
114
+ s " Skunk_ ${BuildInfo .crossProjectPlatform}"
115
+ )
116
+
117
+ inline def backendCqrs (
118
+ inline name : String ,
119
+ codec : BackendCodec [Int ],
120
+ dbName : String = " postgres"
105
121
): Resource [IO , cqrs.Backend [IO , Int , String , Int ]] =
106
122
given BackendCodec [Int ] = codec
107
123
import TestCQRSModel .given_StateModelTC_State
108
- database
124
+ database(dbName)
109
125
.flatMap(pool =>
110
126
Backend
111
127
.builder(TestCQRSDomain )
0 commit comments