Skip to content

Never let a class-connectivity backend failure read as count 0 #992

Never let a class-connectivity backend failure read as count 0

Never let a class-connectivity backend failure read as count 0 #992

Workflow file for this run

name: Test VFBquery Examples
on:
push:
branches: [ main, dev ] # avoid a duplicate run on PR-branch pushes (the pull_request event already covers those)
pull_request:
branches: [ main, dev ]
workflow_dispatch: # Enables manual triggering
schedule:
- cron: '0 0 1 * *' # Runs at 00:00 UTC on the 1st day of every month
# One live run per branch — the example queries run against the
# production VFB backend, so superseded runs are cancelled rather than left to
# pile up alongside the other live-backend workflows.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-examples:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Runtime set + test tooling. deepdiff and colorama, previously
# installed ad hoc here, are now declared in tests/requirements.txt
# alongside the rest of the test-only dependencies.
pip install -r requirements.txt -r tests/requirements.txt
pip install .
- name: Check SOLR availability
run: |
python -c "
import os
try:
import vfbquery as vfb
result = vfb.get_term_info('FBbt_00003748')
with open(os.environ['GITHUB_ENV'], 'a') as f:
f.write('SOLR_AVAILABLE=true\n')
print('SOLR is available')
except Exception as e:
print('SOLR not available:', e)
with open(os.environ['GITHUB_ENV'], 'a') as f:
f.write('SOLR_AVAILABLE=false\n')
exit(1)
"
- name: Run the example queries against the live backend
run: |
export VFBQUERY_CACHE_ENABLED=false
python -m pytest -v src/test/test_example_queries.py
env:
PYTHONPATH: ${{ github.workspace }}
if: env.SOLR_AVAILABLE == 'true'