Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include api test in workflow #1475

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions .github/workflows/api_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,26 @@
name: Test schematic API

on:
workflow_dispatch:
inputs:
perform_benchmarking:
required: true
type: boolean
description: perform benchmarking test (True) or skip (False)
push:
branches: ['main']
pull_request:
branches: ['*']
workflow_dispatch: # Allow manually triggering the workflow
concurrency:
# cancel the current running workflow from the same branch, PR when a new workflow is triggered
# when the trigger is not a PR but a push, it will use the commit sha to generate the concurrency group
# {{ github.workflow }}: the workflow name is used to generate the concurrency group. This allows you to have more than one workflows
# {{ github.ref_type }}: the type of Git ref object created in the repository. Can be either branch or tag
# {{ github.event.pull_request.number}}: get PR number
# {{ github.sha }}: full commit sha
# credit: https://github.com/Sage-Bionetworks-Workflows/sagetasks/blob/main/.github/workflows/ci.yml
group: >-
${{ github.workflow }}-${{ github.ref_type }}-
${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
test:
api-test:
runs-on: ubuntu-latest
env:
POETRY_VERSION: 1.3.0
Expand Down Expand Up @@ -63,20 +74,18 @@ jobs:
#----------------------------------------------
# run API test suite
#----------------------------------------------
- name: Run all API tests
- name: Run all API tests, excluding submission and benchmarks
env:
SYNAPSE_ACCESS_TOKEN: ${{ secrets.SYNAPSE_ACCESS_TOKEN }}
SERVICE_ACCOUNT_CREDS: ${{ secrets.SERVICE_ACCOUNT_CREDS }}
if: ${{ inputs.perform_benchmarking }}
run: >
source .venv/bin/activate;
pytest -m "schematic_api and not submission"
pytest --durations=0 -m "schematic_api and not submission and not rule_benchmark"

- name: Run API tests + Exclude Benchmarks
- name: Run all submission tests
env:
SYNAPSE_ACCESS_TOKEN: ${{ secrets.SYNAPSE_ACCESS_TOKEN }}
SERVICE_ACCOUNT_CREDS: ${{ secrets.SERVICE_ACCOUNT_CREDS }}
if: ${{ false == inputs.perform_benchmarking }}
run: >
source .venv/bin/activate;
pytest -m "schematic_api and not submission and not rule_benchmark"
pytest -m "submission"
Loading