Travis CI + GitHub classroom private unit testing


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

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.

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.

I found a solution that almost works: You can put encrypted files into the student repositories that are unencrypted during the build process. The problem is that it is easy to defeat. Here is all a student needs to do:

(1) Launch a build in debug mode.
(2) log into the build server
(3) Use the decyrpt command to get a readable version of the file.

Any ideas how to prevent this? Is it possible to deny collaborators access to debug sessions?