Travis CI + GitHub classroom private unit testing

(Ka Tai) #1

Hello,

I was wondering if anyone knew how to set up Travis CI to run private unit tests that are not in the student’s version of the repo.

Use case:
A student uses CI and it only runs 50% of the test cases that will be used for their final score.

1 Like
(Brian Crites) #2

Hello @KaTaiHo,

You could perhaps create a scheme where the .travis.yml downloads some other testing files and then use those to actually perform the testing (ideally in such a way that the students can’t download the tests directly themselves by finding the download location from the .travis.yml).

However, I believe that all the students will have access to view the runs associated with their repository which means they can likely recreate the tests themselves.

(Dan Wallach) #3

If you’re using a build system like Gradle, you could do something where the Gradle build pulls in tests that students don’t get, and you’d play firewall games to makes sure that requests from Travis succeed and others fail.

The way I solve this particular problem is that I have two deadlines for students. Assignments go out on Monday. Unit tests are due on Thursday night. On Friday morning, I push “private” unit tests into their repos, and the finished assignments are due Sunday night.

The idea is to make students think about their tests first, since they’re due first, but to ensure they have the benefit of our provided tests, to ensure more final submissions pass all the tests.