Skip to content

Commit

Permalink
feat: add setter for sourceId
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterlukasse committed Oct 3, 2024
1 parent 56f7a64 commit c23877f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/data_generator/datagenerator.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ func main() {
environment := flag.String("e", "development", "Environment/prefix of config .yaml file name")
testData := flag.String("d", "models_tests_data_config", "Prefix of test data config .yaml file name")
sourceId := flag.Int("s", 1, "Source id for Omop DB")
tests.SetTestSourceId(*sourceId)
flag.Parse()
Init(*environment, *sourceId)
log.Printf("\n\n=============== GENERATING TEST DATA BASED ON CONFIG ============================\n\n")
Expand Down
9 changes: 8 additions & 1 deletion tests/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ import (
"gorm.io/gorm"
)

// Global variable
var testSourceId int = 1

func GetTestSourceId() int {
return 1 // TODO - ideally this should also be used when populating "source" tables in test Atlas DB in the first place...
return testSourceId
}

func SetTestSourceId(id int) {
testSourceId = id
}

func GetTestDummyContinuousConceptId() int64 {
Expand Down

0 comments on commit c23877f

Please sign in to comment.