Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
UBUNTURELEASE="ubuntu-trusty"
GITUSERNAME="David Monllao"
GITUSEREMAIL="[email protected]"
DBPASSWORD="moodle"
@dmonllao
dmonllao / resolve_rebase_conflicts_test.sh
Last active May 5, 2016 07:46
rebase_security.sh automatically resolving conflicts
#!/bin/bash
##
# This file exposes the behaviour of the conflicts resolution function.
# * You need to clone https://github.com/dmonllao/moodle-local_ci somewhere and checkout 'autoresolver' branch
# and ln -s /LOCAL_CI/PATH/resolve_rebase_conflicts_test.sh /MOODLECLONE/PATH/
# * Comment out $gitcmd clean -dfx from rebase_security/rebase_security.sh
# * I'm using a couple of repos in [email protected]:davidm to test this resetting HEAD to a hardcoded
# old weekly commits after each execution, something like this below:
#
@dmonllao
dmonllao / gist:9181186
Created February 24, 2014 02:54
PhantomJS crash when running behat (seems that when creating an screenshot)
Operating system: Linux
0.0.0 Linux 3.2.0-56-generic #86-Ubuntu SMP Wed Oct 23 09:20:45 UTC 2013 x86_64
CPU: amd64
family 6 model 44 stepping 2
4 CPUs
Crash reason: SIGSEGV
Crash address: 0xf64034
Thread 0 (crashed)
@dmonllao
dmonllao / gist:9044460
Created February 17, 2014 03:53
Patch for Moodle 2.5 to output the DOM status in the CLI when a scenario fails
From 328f9f77ed72186419f1abc56c1baccf268153fb Mon Sep 17 00:00:00 2001
From: David Monllao <[email protected]>
Date: Mon, 17 Feb 2014 11:52:20 +0800
Subject: [PATCH] For Moodle 2.5 - Output the DOM in the CLI window
---
lib/tests/behat/behat_hooks.php | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/lib/tests/behat/behat_hooks.php b/lib/tests/behat/behat_hooks.php
replace_take_care_with_me "I fill in\(.*\)with" "I set the field\1to" "" 1
@dmonllao
dmonllao / gist:8016244
Created December 18, 2013 02:11
Configuration to run Zombie JS It does not work using zombie 1.4.1 as required by mink-zombie, will work when zombie 2 is released and mink-zombie requires it
// config.php
$CFG->behat_config = array(
'default' => array(
'extensions' => array(
'Behat\MinkExtension\Extension' => array(
'zombie' => '',
'javascript_session' => 'zombie'
)
)
)
@dmonllao
dmonllao / gist:7984660
Created December 16, 2013 09:56
accept_alert excpetion
[ERROR - 2013-12-16T09:55:35.588Z] RouterReqHand - _handle - Thrown => {
"message": "Request => {\"headers\":{\"Accept\":\"application/json;charset=UTF-8\",\"Content-Length\":\"0\",\"Content-Type\":\"application/json;charset=UTF-8\",\"Expect\":\"100-continue\",\"Host\":\"127.0.0.1:4444\"},\"httpVersion\":\"1.1\",\"method\":\"POST\",\"post\":\"\",\"url\":\"/accept_alert\",\"urlParsed\":{\"anchor\":\"\",\"query\":\"\",\"file\":\"accept_alert\",\"directory\":\"/\",\"path\":\"/accept_alert\",\"relative\":\"/accept_alert\",\"port\":\"\",\"host\":\"\",\"password\":\"\",\"user\":\"\",\"userInfo\":\"\",\"authority\":\"\",\"protocol\":\"\",\"source\":\"/accept_alert\",\"queryKey\":{},\"chunks\":[\"accept_alert\"]},\"urlOriginal\":\"/session/317fd5f0-6638-11e3-9cab-c560a1347f3d/accept_alert\"}",
"name": "Invalid Command Method",
"line": 183,
"sourceId": 139853707986368,
"sourceURL": ":/ghostdriver/request_handlers/session_request_handler.js",
"stack": "Invalid Command Method: Request => {\"headers\":{\"Acce
@dmonllao
dmonllao / gist:7983020
Created December 16, 2013 06:18
Moodle-Behat-ZombieJS (behat test site, master, JS errors)
Zombie: GET http://localhost/INTEGRATION/master/index.php => 200
Zombie: GET http://localhost/INTEGRATION/master/lib/javascript.php/1386731529/lib/javascript-static.js => 200
Zombie: GET http://localhost/INTEGRATION/master/theme/yui_combo.php?rollup/3.13.0/yui-moodlesimple.js&rollup/1386731529/mcore-debug.js => 200
Zombie: Cannot read property 'className' of null TypeError: Cannot read property 'className' of null
at http://localhost/INTEGRATION/master/index.php:3:14
in http://localhost/INTEGRATION/master/index.php
moodle-core-dock-loader: Dock loader initialising
Zombie: Cannot call method 'delegate' of null TypeError: Cannot call method 'delegate' of null
at Object.initLoader (/INTEGRATION/master/theme/yui_combo.php:54714:55)
at http://localhost/INTEGRATION/master/index.php:6:104
@dmonllao
dmonllao / gist:7983009
Created December 16, 2013 06:16
Moodle-Behat-ZombieJS (moodle.org JS errors)
Zombie: 301 => https://moodle.org/
Zombie: GET https://moodle.org/ => 200
Zombie: GET https://moodle.org/theme/javascript.php/moodleofficial/1385121489/footer => 200
Zombie: GET https://moodle.org/lib/javascript.php/1385121489/lib/javascript-static.js => 200
Zombie: GET https://moodle.org/theme/yui_combo.php?rollup/1385121489/mcore-min.js => 200
Zombie: GET https://moodle.org/theme/yui_combo.php?rollup/3.13.0/yui-moodlesimple-min.js => 200
Zombie: Cannot read property 'parentNode' of undefined TypeError: Cannot read property 'parentNode' of undefined
at https://moodle.org/:10:58
at https://moodle.org/:11:5
in https://moodle.org/
@dmonllao
dmonllao / gist:7982994
Created December 16, 2013 06:14
Moodle-Behat-ZombieJS (ZombieJS script)
var zombie = require("zombie");
zombie.visit("http://moodle.org", {debug: true}, function(err, browser) {
if (err) {
console.log(err.message);
} else {
console.log(browser.html());
}
});