diff --git a/.circleci/config.yml b/.circleci/config.yml index a0ae3194..287ea02a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -209,6 +209,7 @@ jobs: name: Run system tests. command: npm run system-test environment: + GCLOUD_PROJECT: long-door-651 GOOGLE_APPLICATION_CREDENTIALS: .circleci/key.json - run: name: Remove unencrypted key. diff --git a/samples/deid.js b/samples/deid.js index 10797e1f..34084855 100644 --- a/samples/deid.js +++ b/samples/deid.js @@ -155,7 +155,8 @@ function deidentifyWithDateShift( const csvLines = fs .readFileSync(inputCsvFile) .toString() - .split('\n'); + .split('\n') + .filter(line => line.includes(',')); const csvHeaders = csvLines[0].split(','); const csvRows = csvLines.slice(1); @@ -224,6 +225,7 @@ function deidentifyWithDateShift( ); csvLines[rowIndex + 1] = rowValues.join(','); }); + csvLines.push(''); fs.writeFileSync(outputCsvFile, csvLines.join('\n')); // Print status diff --git a/samples/resources/dates.csv b/samples/resources/dates.csv index 056fccb3..6a80d40a 100644 --- a/samples/resources/dates.csv +++ b/samples/resources/dates.csv @@ -1,5 +1,5 @@ name,birth_date,register_date,credit_card -Ann,01/01/1970,07/21/1996,4532908762519852 +Ann,01/01/1980,07/21/1996,4532908762519852 James,03/06/1988,04/09/2001,4301261899725540 Dan,08/14/1945,11/15/2011,4620761856015295 -Laura,11/03/1992,01/04/2017,4564981067258901 \ No newline at end of file +Laura,11/03/1992,01/04/2017,4564981067258901 diff --git a/samples/system-test/resources/date-shift-context.correct.csv b/samples/system-test/resources/date-shift-context.correct.csv index f8bf3234..2329cb63 100644 --- a/samples/system-test/resources/date-shift-context.correct.csv +++ b/samples/system-test/resources/date-shift-context.correct.csv @@ -1,5 +1,5 @@ name,birth_date,register_date,credit_card -Ann,1/31/1970,8/20/1996,4532908762519852 +Ann,1/31/1980,8/20/1996,4532908762519852 James,4/5/1988,5/9/2001,4301261899725540 Dan,9/13/1945,12/15/2011,4620761856015295 -Laura,12/3/1992,2/3/2017,4564981067258901 \ No newline at end of file +Laura,12/3/1992,2/3/2017,4564981067258901