Skip to content

Commit

Permalink
More changes to prevent use of default jobeserver (jobe2.cosc.canterb…
Browse files Browse the repository at this point in the history
…ury.ac.nz) during behat testing.
  • Loading branch information
trampgeek committed Mar 5, 2024
1 parent 956eb8c commit 7629ae0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions classes/jobesandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public function __construct() {
global $CFG;
qtype_coderunner_sandbox::__construct();
$this->jobeserver = get_config('qtype_coderunner', 'jobe_host');
if ($this->jobeserver === 'jobe2.cosc.canterbury.ac.nz') {
throw new Exception("PLease don't use the Canterbury jobe server for test runs");
}
$this->apikey = get_config('qtype_coderunner', 'jobe_apikey');
$this->languages = null;
}
Expand Down
4 changes: 4 additions & 0 deletions classes/sandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@

global $CFG;

if ($CFG->prefix == $CFG->behat_prefix) {
require_once($CFG->dirroot .'/question/type/coderunner/tests/fixtures/test-sandbox-config.php');
}

abstract class qtype_coderunner_sandbox {
protected $user; // Username supplied when constructing.
protected $password; // Password supplied when constructing.
Expand Down

0 comments on commit 7629ae0

Please sign in to comment.