Skip to content

chg: [pubsub] Handle redis ConnectionError in stream function. #773

chg: [pubsub] Handle redis ConnectionError in stream function.

chg: [pubsub] Handle redis ConnectionError in stream function. #773

Workflow file for this run

name: API Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
name: Python ${{ matrix.python-version }} sample
steps:
- uses: actions/checkout@v4
- name: Checkout pysec submodule only
run: |
git submodule init vulnerabilitylookup/feeders/pysec
git submodule update vulnerabilitylookup/feeders/pysec
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
cache: 'poetry'
- name: Clone Redis
uses: actions/checkout@v4
with:
repository: redis/redis
path: redis-tmp
ref: '8.0'
- name: Install and setup redis
run: |
mv redis-tmp ../redis
pushd ..
pushd redis
make
popd
popd
- name: Setup PostgreSQL
uses: Harmon758/[email protected]
with:
postgresql db: 'vulnlookuptest'
postgresql user: 'postgres'
postgresql password: 'password'
- name: Install with poetry
run: |
python -m pip install --upgrade pip poetry
poetry install --with dev
echo VULNERABILITYLOOKUP_HOME=`pwd` > .env
- name: Clone PyVulnerabilityLookup
uses: actions/checkout@v4
with:
repository: cve-search/PyVulnerabilityLookup
path: PyVulnerabilityLookup
- name: Run API tests
run: |
poetry run pip install -e PyVulnerabilityLookup/
cp config/website.py.sample config/website.py
cp config/generic.json.sample config/generic.json
cp config/stream.json.sample config/stream.json
cp config/logging.json.sample config/logging.json
poetry run flask --app website.app db_init
poetry run flask --app website.app db stamp head
poetry run flask --app website.app create_admin --login admin --password admin --email [email protected]
export API_KEY=`poetry run flask --app website.app user_get_api_key --login admin`
poetry run run_backend --start
poetry run pysec_importer &
poetry run start_website &
sleep 60
export INSTANCE_URL="http://127.0.0.1:10001"
poetry run pytest PyVulnerabilityLookup/tests/test_web.py
poetry run stop
env:
TESTING: gh_action