Developers' Forum

Travis CI

Tim at Lone Pine Koala Sanctuary
Travis CI
by Tim Hunt - Friday, 9 December 2016, 11:24 PM

I mainly just wanted to say hello. We recently started a project at the Open University (UK) to add CodeRunner to our Moodle site, and I have to say, so far I am really impressed with how well almost everything works out of the box.

I spent some of today trying to get Travis CI to run the tests for this plugin, along the lines of

Of course, CodeRunner is more complicated, because you need the JOBE sandbox, and I have not yet got that working.

Well, to be honest, I have not even got Apache + PHP working, despite following

My latest attempt is (lots of the real stuff is commented out so speed up seeing if I have got JOBE working yet) and the result is (Basically, I cannot get it to run a hello-world PHP script :-()

I'll probably keep banging my head against this, but if anyone else wants to try, please feel free to grab a copy of my code.

I have tried to hack the script in JOBE so that you can specify the languages you want to run on the command-line, and also to make it return a meaningful exit code (so it can cause a Travis build to fail). However, please bear in mind that I don't know any python. (Well, I have learned how to write a square function ;-)). This commit shows what happens if you write code by Googling stackoverflow answers. I have not been able to test it since I have not got past my hello world line in the travis script, and I am too lazy to try to install Python 3 on my Mac tonight.

(Edited by Richard Lobb - original submission Saturday, 5 November 2016, 12:32 PM)

Tim at Lone Pine Koala Sanctuary
Re: Travis CI
by Tim Hunt - Saturday, 5 November 2016, 12:34 PM

Oh, please could we consider turning on Moodle's URL-autolinking filter on this site, or at least in the forums? (

Tim at Lone Pine Koala Sanctuary
Re: Travis CI
by Tim Hunt - Tuesday, 8 November 2016, 3:07 AM

Well, some progress:

8 of the 13 python3 testscases in are passsing

(It turns out the docs for getting Apache + PHP to work were for Apache 2.2, and travis is now using Apache 2.4.)

Picture of Richard Lobb
Re: Travis CI
by Richard Lobb - Saturday, 10 December 2016, 9:47 AM

That's odd. I did actually play a bit with this a bit a month ago and (I thought) posted a reply. But I see it never made it this far - I must have failed to submit :-(

AFAIR all I said was:

  • Man, Tavis is a frustrating brute to work with!
  • You should probably ignore the pylint errors, or at least move them to the very bottom of the priority list.
  • The C error "gcc: error trying to exec 'cc1': execvp: No such file or directory" is a show stopper. cc1 is, I think, just one of the phases of the C compiler, so must be present. This presumably is a PATH environment variable problem. My best guess is that the problem occurs because the runguard sandbox within Jobe cleans the environment variable for improved security (see lines 530 - 534 in runguard.c). So I'd suggest you might want disable that cleaning and see if the problem goes away.