Skip to content

Commit

Permalink
[ci] Enforce dataset tests on scraper runs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo committed Aug 10, 2021
1 parent ea5aaae commit 3a259a1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/scraper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,24 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: release-artifact
path: scraper/scripts/data/*
path: |
scraper/scripts/data/*
! scraper/scripts/data/by-bank.tar
php:
name: Post-scraper tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: shivammathur/setup-php@v2
with:
php-version: 8.0
tools: phpunit, composer
- run: composer install --no-interaction
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: release-artifact
path: scraper/scripts/data
- run: phpunit -d memory_limit=-1
env:
RUN_DATASET_TESTS: true
4 changes: 2 additions & 2 deletions tests/php/DatasetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class DatasetTest extends TestCase

public function testIFSCDotCsv() {
$fileName = __DIR__ . "/../../scraper/scripts/data/IFSC.csv";
if(file_exists($fileName)) {
if(file_exists($fileName) or getenv('RUN_DATASET_TESTS')) {
$file = fopen($fileName, 'r');
$line = fgets($file);
$row = str_getcsv($line);
Expand Down Expand Up @@ -66,7 +66,7 @@ public function testIFSCDotCsv() {
public function testBankFiles() {
$tarFile = __DIR__ . "/../../scraper/scripts/data/by-bank.tar";

if (file_exists($tarFile)) {
if (file_exists($tarFile) or getenv('RUN_DATASET_TESTS')) {
$dir = tempnam(sys_get_temp_dir(), '') . '.dir';

mkdir($dir);
Expand Down

0 comments on commit 3a259a1

Please sign in to comment.