diff --git a/tests/data_generator/datagenerator_test.go b/tests/data_generator/datagenerator_test.go index a0a546e..302650a 100644 --- a/tests/data_generator/datagenerator_test.go +++ b/tests/data_generator/datagenerator_test.go @@ -88,26 +88,26 @@ func TestRunDataGeneration(t *testing.T) { if countCohorts != 5 { t.Errorf("Expected 5 cohort_definition records, found %d", countCohorts) } -} -func TestRunDataGeneration2(t *testing.T) { + // second part of the test...added here to avoid running in parallel with part above: + tearDown() setUp(t) RunDataGeneration("example_test_data_config") - countCohorts := tests.GetCount(db.GetAtlasDB(), "cohort_definition") + countCohorts = tests.GetCount(db.GetAtlasDB(), "cohort_definition") if countCohorts != 3 { t.Errorf("Expected 3 cohort_definition records, found %d", countCohorts) } - countPersons := tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "person") + countPersons = tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "person") if countPersons != 36 { t.Errorf("Expected 36 persons, found %d", countPersons) } - countObservations := tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "observation") + countObservations = tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "observation") if countObservations != 60 { t.Errorf("Expected 60 observations, found %d", countObservations) } - countConcepts := tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "concept") + countConcepts = tests.GetCount(tests.GetOmopDataSourceForSourceId(tests.GetTestSourceId()), "concept") if countConcepts != 11 { t.Errorf("Expected 11 concepts, found %d", countConcepts) }