Skip to content

Commit

Permalink
Added #! line for export script so webservices-infra can call it usin…
Browse files Browse the repository at this point in the history
…g ./extensions/BMO/bin/export_bmo_etl.pl
  • Loading branch information
dklawren committed Dec 12, 2024
1 parent 7d944ee commit ff4ec36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions extensions/BMO/bin/export_bmo_etl.pl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env perl
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Expand Down
6 changes: 3 additions & 3 deletions extensions/BMO/t/bmo/bmo_etl.t
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ my ($attach_id) = keys %{$t->tx->res->json->{attachments}};
### Section 4: Export data to test files

my @cmd
= ('perl', 'extensions/BMO/bin/export_bmo_etl.pl', '--verbose', '--test', '--snapshot-date', '2000-01-01');
= ('./extensions/BMO/bin/export_bmo_etl.pl', '--verbose', '--test', '--snapshot-date', '2000-01-01');

my ($output, $error, $rv) = capture { system @cmd; };
ok(!$rv, 'Data exported to test files without error');
ok(glob(bz_locations()->{'datadir'} . '/2000-01-01-bugs-*.json'), 'Export test files exist');

### Section 5: Export data to BigQuery test instance

@cmd = ('perl', 'extensions/BMO/bin/export_bmo_etl.pl', '--verbose', '--snapshot-date', '2000-01-01');
@cmd = ('./extensions/BMO/bin/export_bmo_etl.pl', '--verbose', '--snapshot-date', '2000-01-01');

($output, $error, $rv) = capture { system @cmd; };
ok(!$rv, 'Data exported to BigQuery test instance without error');
Expand All @@ -128,7 +128,7 @@ $t->post_ok(

### Section 7: Exporting again on the same day (with the same snapshot date) will cause the script to exit

@cmd = ('perl', 'extensions/BMO/bin/export_bmo_etl.pl', '--verbose', '--snapshot-date', '2000-01-01');
@cmd = ('./extensions/BMO/bin/export_bmo_etl.pl', '--verbose', '--snapshot-date', '2000-01-01');

($output, $error, $rv) = capture { system @cmd; };
ok($rv, 'Duplicate data exported to BigQuery test instance should fail');
Expand Down

0 comments on commit ff4ec36

Please sign in to comment.