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

Branch for functional testing design #1280

Closed
wants to merge 1 commit into from
Closed
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
13 changes: 13 additions & 0 deletions functional-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Functional testing

This directory contains the functional tests.

Unlike the unit tests, these tests are _not_ part of the `pints` module, and
they won't be installed via pypi/pip.

I even imagine this directory (or the results subdirectory?) might be a
submodule, so that test results etc. live in their own repository.




32 changes: 32 additions & 0 deletions functional-tests/ft_haario_bardenet_mcmc_banana.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python3
#
# Functional test for Haario-Bardenet MCMC on the Banana problem
#
# unittest style
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import functional_testing
import pints


class HaarioBardenetMCMCBananaTest(functional_testing.Test):
# This test is discovered because it is in a file called ft_...
# It implements a shared interface, so that it can maybe call some methods
# to customise things, or to do a set-up and tear-down

def run(self):

problem = ...

controller = ...

run

return 1,2,3


def run_2(self):
# Maybe multiple tests can go in one file?
32 changes: 32 additions & 0 deletions functional-tests/ft_haario_bardenet_mcmc_banana_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python3
#
# Functional test for Haario-Bardenet MCMC on the Banana problem
#
# PyTest style
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import functional_testing
import pints


def test_haario_bardenet_mcmc_banana(self):
# This test is discovered because it's in a directory ft_...
# And because its name starts with test_
# Arguments can be passed to functional testing by using a decorator, e.g.
# @specialthing(1, 2, 3)
# def test_haario_bardenet...

problem = ...

controller = ...

run

return 1,2,3


def test_haario_norma(self):
# Again, we could have a method's tests grouped in a single file
8 changes: 8 additions & 0 deletions functional-tests/results/some_result.cscv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Hello!
I am a CSV file

Not sure about this bit yet.

One per test? One per test group? One massive json file?

How do we update this after running in actions? With git? With some sort of artefact thing?