Travis CI

Travis CI

by Tim Hunt -
Number of replies: 3

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 https://moodle.org/mod/forum/discuss.php?d=323384.

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 https://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP

My latest attempt is https://github.com/timhunt/moodle-qtype_coderunner/blob/travis/.travis.yml (lots of the real stuff is commented out so speed up seeing if I have got JOBE working yet) and the result is https://travis-ci.org/timhunt/moodle-qtype_coderunner. (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 testsubmit.py 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  https://github.com/timhunt/jobe/commit/20c0855fb97b255f8bdb86522773711f65c04e62 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)

In reply to Tim Hunt

Re: Travis CI

by Tim Hunt -

Well, some progress: https://travis-ci.org/timhunt/moodle-qtype_coderunner/builds/173897260#L753

8 of the 13 python3 testscases in testsubmit.py 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.)

In reply to Tim Hunt

Re: Travis CI

by Richard Lobb -

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.
Richard