Skip to content

Commit c23877f

Browse files
committed
feat: add setter for sourceId
1 parent 56f7a64 commit c23877f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

tests/data_generator/datagenerator.go

+1
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ func main() {
325325
environment := flag.String("e", "development", "Environment/prefix of config .yaml file name")
326326
testData := flag.String("d", "models_tests_data_config", "Prefix of test data config .yaml file name")
327327
sourceId := flag.Int("s", 1, "Source id for Omop DB")
328+
tests.SetTestSourceId(*sourceId)
328329
flag.Parse()
329330
Init(*environment, *sourceId)
330331
log.Printf("\n\n=============== GENERATING TEST DATA BASED ON CONFIG ============================\n\n")

tests/testutils.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,15 @@ import (
1717
"gorm.io/gorm"
1818
)
1919

20+
// Global variable
21+
var testSourceId int = 1
22+
2023
func GetTestSourceId() int {
21-
return 1 // TODO - ideally this should also be used when populating "source" tables in test Atlas DB in the first place...
24+
return testSourceId
25+
}
26+
27+
func SetTestSourceId(id int) {
28+
testSourceId = id
2229
}
2330

2431
func GetTestDummyContinuousConceptId() int64 {

0 commit comments

Comments
 (0)