Is there any way to automatically enable TravisCI for assignments?

(D Makarenko) #1


I am at my first attempt in using Classroom for some assignments and grading automation, and I am kind of confused here.

My initial thoughts was to use TravisCI to run some tests on students assignments. It is working great except one thing. When the student accepts assignment and Classroom creates new repo this repo is not enabled in TravisCI. Until I manually “flick the switch” in the TravisCI interface it does not run any tests for this student. If the student will be quick enough he can complete assignment before I enable tests, and all of his work will remain untested.

I guess there are many teachers who use travis for testing and grading, how do you cope with this problem?

(Dan Wallach) #2

I’m working on a Python script to do exactly this (i.e., flick the switch and launch builds). I hope to have it done soon, then I’ll post something here.

(D Makarenko) #3

That’s great! I know some python maybe I could help you with that.

(Dan Wallach) #4

Okay, here we go:

This script does all the work of activating everything on Travis-CI and it also requests rebuilds at the same time. Enjoy!

(D Makarenko) #5

Amazing! It does exactly what I need!

Thank you very much!

(Dan Wallach) #6

The only issue seems to be that when students are making their clones of your master repository, Travis-CI doesn’t automatically rescan GitHub and add them. You need to visit your profile page (e.g., and hit the “sync account” button.

So far as I can tell, there’s no API call that’s equivalent to visiting the web page and pressing that button. Until I figure out the proper solution, the workaround is that you have to first visit your profile page, hit “sync”, and then you can run the script.

(Vanessa) #7

@danwallach this is :100:

@d-makarenko you may also want to look at these other threads:

(Dan Wallach) #8

Minor but significant update: I corresponded with the Travis people, who pointed me to the API call that I missed which requests that they synchronize their data with GitHub. So far as I can tell, it’s an asynchronous API, meaning that even if you call it, you may end up missing something. Regardless, I’ve added this to my script. Anybody out there using it may wish to update to the latest.

(Apanangadan) #9

Works great and does something that we were doing manually until now. Thanks very much!