From a1626424cae929e40a3adcc22da97a6e97c57685 Mon Sep 17 00:00:00 2001 From: Jeremi Piotrowski Date: Thu, 10 Mar 2022 08:25:42 +0100 Subject: [PATCH] ci-automation/tapfile_helper_lib: fix commiting last transaction Move the final db commit to inside the subshell. Since the while loop runs inside a subshell, the SQL variable outside of the subshell is not modified, and so the last contents of the SQL variable are dropped. This shows up when the last couple test cases don't have an error message, and simply append the transaction to 'SQL'. They are never written to the db. Signed-off-by: Jeremi Piotrowski --- ci-automation/tapfile_helper_lib.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci-automation/tapfile_helper_lib.sh b/ci-automation/tapfile_helper_lib.sh index 32215bbbec..f360cc9807 100644 --- a/ci-automation/tapfile_helper_lib.sh +++ b/ci-automation/tapfile_helper_lib.sh @@ -160,10 +160,9 @@ function tap_ingest_tapfile() { fi done < "$tapfile" + SQL="${SQL}COMMIT;" + __sqlite3_wrapper "${SQL}" ) - - SQL="${SQL}COMMIT;" - __sqlite3_wrapper "${SQL}" } # --