Skip to content

Add basic autotests setup #5

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

Open
wants to merge 1 commit into
base: main
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ config.json # Specify the name of the evaluation function in this file
- Edit the `app/evaluation_tests.py` and `app/preview_tests.py` files to add tests which get run:
- Every time you commit to this repo, before the image is built and deployed
- Whenever the `healthcheck` command is supplied to the deployed function
- Edit the `eval_tests.yaml` file to add tests that get run on the evaluation function as above,
but are also added to the documentation as examples.
- Edit the `app/docs.md` file to reflect your changes. This file is baked into the function's image, and is made available using the `docs` command. This feature is used to display this function's documentation on our [Documentation](https://lambda-feedback.github.io/Documentation/) website once it's been hooked up!

---
Expand Down
2 changes: 2 additions & 0 deletions app/evaluation_tests.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import unittest
from autotests import auto_test

try:
from .evaluation import Params, evaluation_function
except ImportError:
from evaluation import Params, evaluation_function


@auto_test("../eval_tests.yaml", evaluation_function)
class TestEvaluationFunction(unittest.TestCase):
"""
TestCase Class used to test the algorithm.
Expand Down
1 change: 1 addition & 0 deletions app/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
autotests @ git+https://github.com/lambda-feedback/evaluation-function-auto-tests@main
9 changes: 9 additions & 0 deletions eval_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# A placeholder test file.
# The tests described here are run on the evaluation function by Github Actions,
# and can be used to automatically generate examples for the documentation.
# You should populate this file with tests for your evaluation function.
# See https://github.com/lambda-feedback/evaluation-function-auto-tests for a
# detailed explanation of the test file format.
---
title: placeholder
tests: []