Skip to content

Commit

Permalink
add failure warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tianj7 committed Oct 21, 2024
1 parent 97c4931 commit 83c8143
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tests/setup_local_db/ddl_results_and_cdm.sql
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@ CREATE TABLE dbo.VersionInfo(
AppliedOn timestamp NULL,
Description varchar(1024) NULL
)

CREATE TABLEE dbo.VersionInfo(
Version bigint NOT NULL,
)
2 changes: 2 additions & 0 deletions tests/setup_local_db/test_data_results_and_cdm.sql
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ INSERT INTO dbo.VersionInfo
Values(0, '20240101 09:30:00 AM', 'Initial Version'),
(1, '20240901 09:30:00 AM', 'Table Update');

DROP Table IF EXISTS misc.DATA_DICTIONARY;

WITH cte_counts AS (SELECT observation_concept_id,
COUNT(DISTINCT person_id) AS number_of_people_with_variable,
COUNT(DISTINCT CASE WHEN value_as_number IS NOT NULL THEN person_id END) AS number_of_people_where_value_is_filled_number,
Expand Down
7 changes: 5 additions & 2 deletions tests/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ func ExecSQLScript(sqlFilePath string, sourceId int) {
}
fileContents, err2 := os.ReadFile(path)
if err2 != nil {
panic(err)
panic(err2)
}
result := ExecSQLString(string(fileContents), sourceId)
if result.Error != nil && len(result.Error.Error()) > 0 {
fmt.Printf("Errors: %s\n", result.Error.Error())
}
ExecSQLString(string(fileContents), sourceId)
}

func ExecAtlasSQLString(sqlString string) {
Expand Down

0 comments on commit 83c8143

Please sign in to comment.