Skip to content

Commit da528c3

Browse files
authored
Merge branch 'main' into fix/sequence_number_bug
2 parents 36647e3 + 8e4cbb6 commit da528c3

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ jobs:
3838
matrix:
3939
go: [1.21]
4040
store-type:
41+
-
4142
- memory
4243
- file
44+
- mongo
4345
fix-version:
4446
-
4547
- fix40
@@ -65,10 +67,15 @@ jobs:
6567
uses: ruby/setup-ruby@v1
6668
with:
6769
ruby-version: '3.0'
68-
- name: Test
70+
- name: Unit test
71+
env:
72+
FIX_TEST: ${{ matrix.fix-version }}
73+
STORE_TYPE: ${{ matrix.store-type }}
74+
run: if [ -z $FIX_TEST ] && [ -z $STORE_TYPE ]; then make build-src && make test-ci; fi
75+
- name: Acceptance test
6976
env:
7077
GO111MODULE: on
7178
MONGODB_TEST_CXN: mongodb://localhost:27017
7279
FIX_TEST: ${{ matrix.fix-version }}
7380
STORE_TYPE: ${{ matrix.store-type }}
74-
run: if [ -z $FIX_TEST ]; then make build-src && make test-ci; else make generate-ci && make build && make $FIX_TEST; fi
81+
run: if [ $FIX_TEST ] && [ $STORE_TYPE ]; then make generate-ci && make build && make $FIX_TEST; fi

_test/test-server/main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,23 @@ func main() {
139139

140140
var acceptor *quickfix.Acceptor
141141
switch strings.ToUpper(storeType) {
142+
case "MONGO":
143+
mongoDbCxn := "mongodb://localhost:27017"
144+
mongoDatabase := "automated_testing_database"
145+
mongoReplicaSet := "replicaset"
146+
147+
appSettings.GlobalSettings().Set(config.MongoStoreConnection, mongoDbCxn)
148+
appSettings.GlobalSettings().Set(config.MongoStoreDatabase, mongoDatabase)
149+
appSettings.GlobalSettings().Set(config.MongoStoreReplicaSet, mongoReplicaSet)
150+
appSettings.GlobalSettings().Set(config.DynamicSessions, "Y")
151+
152+
acceptor, err = quickfix.NewAcceptor(app, quickfix.NewMongoStoreFactory(appSettings), appSettings, fileLogFactory)
142153
case "FILE":
143154
fileStoreRootPath := path.Join(os.TempDir(), fmt.Sprintf("FileStoreTestSuite-%d", os.Getpid()))
144155
fileStorePath := path.Join(fileStoreRootPath, fmt.Sprintf("%d", time.Now().UnixNano()))
145156
appSettings.GlobalSettings().Set(config.FileStorePath, fileStorePath)
157+
appSettings.GlobalSettings().Set(config.DynamicSessions, "Y")
158+
146159
acceptor, err = quickfix.NewAcceptor(app, quickfix.NewFileStoreFactory(appSettings), appSettings, fileLogFactory)
147160
case "MEMORY":
148161
acceptor, err = quickfix.NewAcceptor(app, quickfix.NewMemoryStoreFactory(), appSettings, fileLogFactory)

filestore.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ func (f fileStoreFactory) Create(sessionID SessionID) (msgStore MessageStore, er
7676

7777
dirname, err := sessionSettings.Setting(config.FileStorePath)
7878
if err != nil {
79-
dirname, err = globalSettings.Setting(config.FileStorePath)
8079
if err != nil {
8180
return nil, err
8281
}

0 commit comments

Comments
 (0)