Skip to content

Scheduled Tests

Scheduled Tests #1772

name: Scheduled Tests
on:
workflow_dispatch: # Manual trigger
schedule: # Scheduled trigger
- cron: "15,45 14-23,0-1 * * 1-5" # At minutes 15 and 45 past every hour from 14:00 through 01:00 on every day-of-week from Monday through Friday.
- cron: "15 7,13 * * 1-5" # At minute 15 past hour 7 and 13 on every day-of-week from Monday through Friday.
- cron: "0 14 * * 1" # At 14:00 on Monday (once a week). Any changes made here should also be reflected in the step titled "Force weekly run to bypass the version check".
jobs:
run_app_tests:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} # AWS Access Key ID.
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # AWS Secret Access Key.
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }} # AWS Default Region.
AWS_S3_BUCKET: "biothings-codebuild" # The S3 bucket name for storing application metadata.
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # The Slack webhook URL for sending notifications.
SLACK_CHANNEL: "#logger---web" # The Slack channel where notifications will be posted.
APPLICATION_NAME: "mychem.info" # The name of the application being tested. It will be displayed in the Slack message.
APPLICATION_METADATA_URL: "https://mychem.info/metadata" # Path to the application metadata, typically a URL.
APPLICATION_METADATA_FIELD: "build_date" # Notation to the build version field. Ex.: "metadata.build_version"
strategy:
fail-fast: false
matrix:
python-version: [ "3.12" ]
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Prepare virtual environment and dependences
run: |
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements_web.txt
git clone https://github.com/biothings/biothings_client.py.git
cd biothings_client.py
pip install .
cd ..
pip install .venv/lib/python${{ matrix.python-version }}/site-packages/biothings/tests/slack_test_notification
- name: Force weekly run to bypass the version check
if: github.event.schedule == '0 14 * * 1'
run: echo "BYPASS_VERSION_CHECK=True" >> $GITHUB_ENV
- name: Run pytest
run: |
source .venv/bin/activate
python -m pytest src/tests/test_remote.py biothings_client.py/tests/test_chem.py -s -vv
# ### For debugging purposes in case of github action failure
# ### Reference:https://github.com/mxschmitt/action-tmate
# - name: Setup tmate debug session on failure
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3