Skip to content

Commit

Permalink
updates to script
Browse files Browse the repository at this point in the history
  • Loading branch information
btylerburton committed Feb 1, 2024
1 parent 6d6da9f commit 685f585
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ S3FILESTORE__AWS_ACCESS_KEY_ID=_placeholder
S3FILESTORE__AWS_SECRET_ACCESS_KEY=_placeholder
S3FILESTORE__SIGNATURE_VERSION=s3v4

MDTRANSLATOR_URL=http://127.0.0.1:3000/translates
MDTRANSLATOR_URL=http://127.0.0.1:3000/translates
23 changes: 18 additions & 5 deletions .github/workflows/load_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Harvester 2.0 Load Test
name: Load Test
on:
workflow_dispatch:

Expand All @@ -7,6 +7,8 @@ jobs:
name: H2.0 Load Test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
Expand All @@ -15,10 +17,20 @@ jobs:
run: python -c "import sys; print(sys.version)"
- name: Install Poetry
uses: snok/install-poetry@v1
- name:
run:
poetry install
- name: Run Test
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Run Load Test
env:
SRC_TITLE: 'EPA ScienceHub'
SRC_URL: 'https://pasteur.epa.gov/metadata.json'
Expand All @@ -27,4 +39,5 @@ jobs:
CKAN_URL: ${{secrets.CKAN_URL}}
CKAN_API_TOKEN: ${{secrets.CKAN_API_TOKEN}}
run: |
source .venv/bin/activate
poetry run python scripts/load_test.py
13 changes: 7 additions & 6 deletions scripts/load_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
owner_org = os.environ['SRC_OWNER_ORG']
source_type = os.environ['SRC_SOURCE_TYPE']

print(title)
print(url)
print(owner_org)
print(source_type)
print('Running load test for the following harvest config')
print(f'title: {title}')
print(f'url: {url}')
print(f'owner_org: {owner_org}')
print(f'source_type: {source_type}')

harvest_source = HarvestSource(
title,
url,
owner_org,
source_type
)
)

harvest_source.get_record_changes()
harvest_source.get_record_changes()
harvest_source.synchronize_records()
harvest_source.report()

1 comment on commit 685f585

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
harvester
   __init__.py00100% 
   harvest.py3936565 83%
   utils.py3522 94%
TOTAL4286784% 

Tests Skipped Failures Errors Time
9 0 💤 0 ❌ 0 🔥 3.436s ⏱️

Please sign in to comment.