Skip to content

weko#45758 add test case #9976

weko#45758 add test case

weko#45758 add test case #9976

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
module:
- invenio-communities
- invenio-db
- invenio-deposit
- invenio-files-rest
- invenio-iiif
- invenio-mail
- invenio-oaiharvester
- invenio-oaiserver
- invenio-oauth2server
- invenio-previewer
- invenio-queues
- invenio-records-rest
- invenio-records
- invenio-resourcesyncclient
- invenio-resourcesyncserver
- invenio-s3
- invenio-stats
- weko-accounts
- weko-admin
- weko-authors
- weko-bulkupdate
- weko-deposit
- weko-gridlayout
- weko-groups
- weko-handle
- weko-index-tree
- weko-indextree-journal
- weko-items-autofill
- weko-items-ui
- weko-itemtypes-ui
- weko-logging
- weko-plugins
- weko-records
- weko-records-ui
- weko-schema-ui
- weko-search-ui
- weko-sitemap
- weko-theme
- weko-user-profiles
- weko-workflow
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cache/pip
venv
key: unit-test
- name: Install system packages
run: |
sudo apt-get update
sudo apt-get install python3-setuptools libpq-dev libedit-dev libsqlite3-dev
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.5.9
- name: Create venv
run: python -m venv venv
- name: Install python dependencies
run: |
source venv/bin/activate
python -m pip install -U setuptools wheel 'pip==20.2.4' coveralls PyYAML
pip install -r packages.txt
pip install --no-deps -r packages-invenio.txt
sed -E 's/\/code\///g' requirements-weko-modules.txt | xargs pip install --no-deps
python -m pip uninstall -y 'coverage' 'pytest' 'pytest-cov' 'pytest-invenio' 'mock' 'urllib3' 'responses' 'moto'
python -m pip install 'coverage==4.5.4' 'pytest==5.4.3' 'pytest-cov==2.10.1' 'pytest-invenio==1.3.4' 'mock==3.0.5' 'urllib3==1.21.1' 'responses==0.10.3' 'moto==1.3.5'
- name: Run tests
run: |
source venv/bin/activate
cd modules/${{ matrix.module }}
python -m pip install .
python setup.py test
- name: Coveralls
if: ${{ success() || failure() }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
source venv/bin/activate
cp modules/${{ matrix.module }}/.coverage ./
coveralls
coveralls:
name: Coveralls webhook
needs: test
if: ${{ success() || failure() }}
runs-on: ubuntu-18.04
steps:
- name: Send webhook
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: curl -k https://coveralls.io/webhook?repo_token=${COVERALLS_REPO_TOKEN} -d "payload[build_num]=${GITHUB_SHA}$([[ $(echo ${GITHUB_REF} | cut -d / -f 2) == 'pull' ]] && echo -PR-$(echo ${GITHUB_REF} | cut -d / -f 3))&payload[status]=done"