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

added automatic testing with dummy test #6

Merged
merged 1 commit into from
Nov 4, 2021
Merged
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
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# adapted from https://raw.githubusercontent.com/clEsperanto/pyclesperanto_prototype/master/.github/workflows/test_and_deploy.yml
# see /license_thirdpary/license_pyclesperanto_prototype
name: test

on: [push, pull_request]

jobs:
test:
name: ${{ matrix.platform }} ( ${{ matrix.python-version }})
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
platform: [ubuntu-latest] #, macos-latest] # windows-latest broken for now
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up conda ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2.0.0
with:
auto-update-conda: true
activate-environment: test
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Install pocl
if: runner.os == 'Linux'
shell: bash -l {0}
run: conda install -y pocl
- name: Install dependencies
shell: bash -l {0}
run: |
python --version
conda install -y pyopencl
python -m pip install --upgrade pip
pip install setuptools wheel pytest pytest-cov pytest-benchmark dask
pip install -e .
- name: Test
shell: bash -l {0}
run: pytest -v --cov=./ --cov-report=xml
- name: Coverage
uses: codecov/codecov-action@v1
28 changes: 28 additions & 0 deletions license_thirdparty/license_pyclesperanto_prototype
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Copyright 2020 Robert Haase, Pradeep Rajasekhar, Juan Nunez-Iglesias, Talley Lambert, Martin Weigert,
Max Planck Institute for Molecular Cell Biology and Genetics Dresden, Monash University, Harvard Medical School

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
11 changes: 11 additions & 0 deletions tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import numpy as np
def test_sum():
a = np.asarray([1, 2])
b = np.asarray([2, 3])

reference = np.asarray([3,5])

c = a + b

assert(np.array_equal(c, reference))