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

container integration test #502

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
steps:
- uses: yogevbd/[email protected]
with:
#REQUIRED_LABELS_ANY: "bug,enhancement,skip-changelog"
# REQUIRED_LABELS_ANY: "bug,enhancement,skip-changelog"
# REQUIRED_LABELS_ANY: "test-plugins"
#REQUIRED_LABELS_ANY_DESCRIPTION: "Select at least one label ['bug','enhancement','skip-changelog']"
BANNED_LABELS: "test-only-fast"

82 changes: 82 additions & 0 deletions .github/workflows/python-container-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Test container, integrating plugins

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "*" ]
types:
- labeled
- opened
- synchronize
- reopened


jobs:
build:
if: contains( github.event.pull_request.labels.*.name, 'test-container')

runs-on: ubuntu-latest

# - integral
# - integral-all-sky
# - antares
# - gw
# - legacysurvey
# - nb2workflow
# - polar

services:
antares-backend:
image: densavchenko/antares:gittest
ports:
- 5002:8000

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}


# https://raw.githubusercontent.com/oda-hub/dispatcher-container/master/requirements.txt


# TODO: build the container instead
- name: Install dependencies
run: |
python -m pip install --upgrade pip flake8 pytest mypy pylint pytest-cov wheel

pip install -r https://raw.githubusercontent.com/oda-hub/dispatcher-container/master/requirements.txt
pip install oda-api

if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

pip install -e .[test]

for plugin in integral integral-all-sky antares gw legacysurvey nb2workflow; do
git clone https://github.com/oda-hub/dispatcher-plugin-$plugin plugin-$plugin
if [ -f plugin-$plugin/requirements.txt ]; then
< plugin-$plugin/requirements.txt grep -v oda-hub/dispatcher-app | grep -v cdci-data-analysis | grep -v oda_api > plugin-req-$plugin.txt
pip install -r plugin-req-$plugin.txt;
fi
pip install -e ./plugin-$plugin[test]
done


- name: Test ${{ matrix.plugin-name }} plugin with pytest
run: |
set -x
export DISPATCHER_MOCK_KB=yes
for plugin in integral integral-all-sky antares gw legacysurvey nb2workflow; do
(
cd plugin-$plugin
python -m pytest tests -sv --full-trace --log-cli-level=DEBUG -k 'not test_no_debug_mode_empty_request and not test_empty_request'
)
done