simon-andrews / umass-toolkit

Tools for accessing and using data from the University of Massachusetts Amherst. Unofficial.
https://umass-toolkit.readthedocs.io/en/latest/
MIT License
11 stars 6 forks source link

Set up some sort of unit testing/CI thing #18

Open simon-andrews opened 6 years ago

simon-andrews commented 6 years ago

This project is getting bigger, and more code means more possibilities for bugs to surface.

I guess the goal here is to set up something with Travis and Python's built-in unit testing framework. In particular, some of the dining stuff is sketchy and I want to make sure we're handling edge cases.

I think this would be a good beginner task. You'll learn about unit testing, best practices, Python, and devops in general. There's lots of documentation for Travis, and plenty of examples all over the web to take ideas from. Setting up unit tests could be trickier, but still pretty simple.

mattrossman commented 6 years ago

@simon-andrews Since you're the owner can you set up the account on Travis CI and select this repo to be used?

simon-andrews commented 6 years ago

Done: https://travis-ci.org/simon-andrews/umass-toolkit

Nothing happens till we add a config though.

TsarFox commented 6 years ago

Might make sense to look into mocking for the tests so that we're not slamming a bunch of API endpoints on every commit. (And so tests don't fail if a server goes down, etc)

simon-andrews commented 6 years ago

Some of the value of unit testing would be checking that all the APIs/websites we're using are still up and working the way we expect them to. I currently have Travis configured to run tests every week whether there's new commits or not, just to check this. We should look in to using mocking for checking our own code though.

We could have two test sets: our stuff, and just checking that external stuff still works. In Travis an environment variable that picks which one we run, and allow failures for the external one.