diff --git a/runner/main/jobtypes/performance/normalise_site.php b/runner/main/jobtypes/performance/normalise_site.php new file mode 100644 index 0000000..380c8e0 --- /dev/null +++ b/runner/main/jobtypes/performance/normalise_site.php @@ -0,0 +1,41 @@ +get_record('user', array('username' => 'admin')); +$user->email = 'moodle@moodlemoodle.com'; +$user->firstname = 'Admin'; +$user->lastname = 'User'; +$user->city = 'Perth'; +$user->country = 'AU'; +$DB->update_record('user', $user); + +// Disable email message processor. +$DB->set_field('message_processors', 'enabled', '0', array('name' => 'email')); + +// Course list when not logged in and enrolled courses when logged as a usual configuration. +$frontpage = new admin_setting_courselist_frontpage(false); +$frontpage->write_setting(array(FRONTPAGEALLCOURSELIST)); +$frontpagelogged = new admin_setting_courselist_frontpage(true); +$frontpagelogged->write_setting(array(FRONTPAGEENROLLEDCOURSELIST)); + +echo "Moodle site configuration finished successfully.\n"; diff --git a/runner/main/jobtypes/performance/performance.sh b/runner/main/jobtypes/performance/performance.sh index d9896e3..a57b9c0 100644 --- a/runner/main/jobtypes/performance/performance.sh +++ b/runner/main/jobtypes/performance/performance.sh @@ -116,6 +116,11 @@ function performance_setup_normal() { echo "Running: ${initcmd[*]}" docker exec -t -u www-data "${WEBSERVER}" "${initcmd[@]}" + # Copy the site normalisation script and execute it. + echo "Copying and executing the site normalisation script" + docker cp "${BASEDIR}/jobtypes/performance/normalise_site.php" "${WEBSERVER}:/var/www/html/normalise_site.php" + docker exec -t -u www-data "${WEBSERVER}" php /var/www/html/normalise_site.php + echo "Creating test data" performance_generate_test_data @@ -196,11 +201,11 @@ function performance_run() { testplanfile=`ls "${SHAREDDIR}"/planfiles/*.jmx | head -1 | sed "s@${SHAREDDIR}@/shared@"` testusersfile=`ls "${SHAREDDIR}"/planfiles/*.csv | head -1 | sed "s@${SHAREDDIR}@/shared@"` group="${MOODLE_BRANCH}" - description="${MOODLE_BRANCH}" + description="${GIT_COMMIT}" siteversion="" sitebranch="${MOODLE_BRANCH}" - sitecommit="${MOODLE_BRANCH}" - runoutput="${SHAREDDIR}/output/results/$datestring.output" + sitecommit="${GIT_COMMIT}" + runoutput="${SHAREDDIR}/output/logs/run.log" # Calculate the command to run. The function will return the command in the passed array. local jmeterruncmd= diff --git a/runner/main/modules/docker-jmeter/libraries/recorder.bsf b/runner/main/modules/docker-jmeter/libraries/recorder.bsf index b61197a..11f9b19 100644 --- a/runner/main/modules/docker-jmeter/libraries/recorder.bsf +++ b/runner/main/modules/docker-jmeter/libraries/recorder.bsf @@ -193,54 +193,10 @@ WritePhpLine(String line) { Runnable mr = MoodleResult(ctx); // We add the run info when starting the first thread -DebugValue("Checking if header printed"); if (JMeterUtils.getProperty("headerprinted") == null) { - DebugValue("Header not printed - adding it now"); // Output headers. JMeterUtils.setProperty("headerprinted", "1"); print(mr.headerToString()); - DebugValue(mr.headerToString()); - - DebugValue("Host:"); - DebugValue(vars.get("host")); - - DebugValue("Site path:"); - DebugValue(vars.get("sitepath")); - - DebugValue("Group:"); - DebugValue(props.get("group")); - - DebugValue("Run Desec:"); - DebugValue(props.get("desc")); - - DebugValue("Users:"); - DebugValue(vars.get("users")); - - DebugValue("Loops:"); - DebugValue(vars.get("loops")); - - DebugValue("Rampup:"); - DebugValue(vars.get("rampup")); - - DebugValue("Throughput:"); - DebugValue(vars.get("throughput")); - - DebugValue("Size:"); - DebugValue(vars.get("size")); - - DebugValue("Base:"); - DebugValue(vars.get("moodleversion")); - - DebugValue("Site version:"); - DebugValue(props.get("siteversion")); - - DebugValue("Site branch:"); - DebugValue(props.get("sitebranch")); - - DebugValue("Site Commit:"); - DebugValue(props.get("sitecommit")); - - DebugValue("All done"); WritePhpValue("host", vars.get("host")); WritePhpValue("sitepath", vars.get("sitepath")); @@ -258,12 +214,8 @@ if (JMeterUtils.getProperty("headerprinted") == null) { // Send the run timestamp to set it as run filename. props.put("filepath", "runs/" + vars.get("runtimestamp") + ".php"); - DebugValue("Header now printed"); -} else { - DebugValue("Header printed"); } WritePhpLine(mr.toPHP()); print(mr.toString()); -DebugValue(mr.toString());