Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Fix sample tests and system tests (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored and stephenplusplus committed Mar 16, 2018
1 parent df21aec commit 1cc5425
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion samples/deid.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -224,6 +225,7 @@ function deidentifyWithDateShift(
);
csvLines[rowIndex + 1] = rowValues.join(',');
});
csvLines.push('');
fs.writeFileSync(outputCsvFile, csvLines.join('\n'));

// Print status
Expand Down
4 changes: 2 additions & 2 deletions samples/resources/dates.csv
Original file line number Diff line number Diff line change
@@ -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
Laura,11/03/1992,01/04/2017,4564981067258901
4 changes: 2 additions & 2 deletions samples/system-test/resources/date-shift-context.correct.csv
Original file line number Diff line number Diff line change
@@ -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
Laura,12/3/1992,2/3/2017,4564981067258901

0 comments on commit 1cc5425

Please sign in to comment.