Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting feed repo working, shameless green, for mwarin #110

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- uses: actions/checkout@v2

- name: Build docker image
run: docker-compose --file docker-compose.test.yml build
run: docker compose --file docker-compose.test.yml build

- name: Run tests
run: docker-compose --file docker-compose.test.yml run sut
run: docker compose --file docker-compose.test.yml run sut
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ HathiTrust Ingest Toolkit
```bash
git clone https://github.com/hathitrust/feed
cd ingest
docker-compose build
docker compose build
```

# Development

Running tests:
```
docker-compose run test
docker compose run test
```

Running specific tests and/or getting prettier output:
```
# Runs all tests
docker-compose run test prove
docker compose run test prove
# Run a specific set of tests
docker-compose run test prove t/storage.t
docker compose run test prove t/storage.t
# Get more verbose output from a specific test
docker-compose run test perl t/storage.t
docker compose run test perl t/storage.t
```

## Validating volumes

* Put volumes in `volumes_to_test/`

```bash
docker-compose run validate
docker compose run validate
```

## Validating a single image
Expand Down Expand Up @@ -63,7 +63,7 @@ zip test_volume.zip 00000001.* checksum.md5 meta.yml

* Put the file in `volumes_to_test/`

* Run `docker-compose run validate`
* Run `docker compose run validate`

## Testing with RClone

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
- ./ingest_stage:/tmp/stage
- ~/.config/rclone/rclone.conf:/usr/local/feed/etc/rclone.conf
- ./clamav:/var/lib/clamav
# FIXME -- before these will work, run: docker-compose run --rm ingest chown ingest.ingest /sdr1 /sdr2 /htdataden
# FIXME -- before these will work, run: docker compose run --rm ingest chown ingest.ingest /sdr1 /sdr2 /htdataden
- repository_link:/sdr1
- repository_obj:/sdr2
- backups:/htdataden
Expand Down
2 changes: 1 addition & 1 deletion t/emma.t
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ context "with volume & temporary ingest/preingest/zipfile dirs" => sub {
};

# To run these tests, first run
# `docker-compose run test freshclam -l -`
# `docker compose run test freshclam -l -`
# (You may need to adjust permissions on ./clamav)
if ( -e "/var/lib/clamav/main.cvd") {
use HTFeed::ClamScan;
Expand Down
3 changes: 2 additions & 1 deletion t/lib/HTFeed/Test/SpecSupport.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use Exporter 'import';
our @EXPORT_OK = qw(mock_zephir mock_clamav stage_volume);

sub mock_zephir {

no warnings 'redefine';
*HTFeed::Volume::get_sources = sub {
return ( 'ht_test','ht_test','ht_test' );
};
Expand All @@ -42,6 +42,7 @@ EOT

};

use warnings 'redefine';
}

sub mock_clamav {
Expand Down
4 changes: 4 additions & 0 deletions t/storage_audit.t
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ describe "HTFeed::StorageAudit" => sub {
}
}

no warnings 'redefine';
# These next subs may redefine existing subs,
# suppressing warnings.
sub HTFeed::Storage::S3::restore_object {
return 1;
}
Expand All @@ -120,6 +123,7 @@ describe "HTFeed::StorageAudit" => sub {

return HTFeed::StorageAudit->for_storage_name($self->{name});
}
use warnings 'redefine';

share my %vars;
shared_examples_for "all storages" => sub {
Expand Down
Loading