Skip to content

Commit

Permalink
Issue moodlehq#40 - Checking that the site was properly installed
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Feb 13, 2014
1 parent f298985 commit 941764b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ There are scripts for both the web server and the JMeter server sides.
* Git
* cURL
* PHP 5.3
* JMeter - https://jmeter.apache.org/download_jmeter.cgi (probably you will face problems using apt-get or other package management systems to download it)
* Java 6 or later
* JMeter - https://jmeter.apache.org/download_jmeter.cgi binaries (probably you will face problems using apt-get or other package management systems to download it)

## Installation

Expand Down Expand Up @@ -77,6 +78,8 @@ The groupname and description arguments of test_runner.sh are useful to identify

Note that you can run the tests as many times as you want, you just need to run after_run_setup.sh and restart_services.sh before running test_runner.sh every time to clean up the site.

It is recommendable that you run all the scripts using the same user (there is no need to use a root user at all) you can use different users to run them (there are no restrictions about it) but be sure that the permissions are correct, it seems to be one of the more common issues when running this tool.

### Web and JMeter servers in the same computer, to find performance differences between different branches (usually a development computer)
* Run compare.sh, the browser will be automatically opened after both runs are finished
+ ./compare.sh
Expand Down Expand Up @@ -193,6 +196,7 @@ This tool in only intended to be used in development/testing environments inside


## Troubleshooting
* You can find an extensive troubleshooting guide [here](https://github.com/moodlehq/moodle-performance-comparison/blob/master/TROUBLESHOOTING.md)
* You might be interested in raising the PHP memory_limit to 512MB (apache) or something like that to 'M' or bigger when comparing results.
* You can find JMeter logs in logs/
* You can find runs outputs in runs_outputs/ the results in runs_samples/ and the php arrays generated from them in runs/
Expand Down
11 changes: 10 additions & 1 deletion before_run_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ ${phpcmd} admin/cli/install_database.php \
> /dev/null || \
throw_error "Moodle can not be installed, check that the database data is correctly set"

# Check that the installed site is properly installed and can be accessed
# using the provided wwwroot.
siteindex="${wwwroot%/}/index.php"
${curlcmd} --silent "$siteindex" | \
grep --quiet "$SITE_FULL_NAME" || \
throw_error "There is a problem with your wwwroot config var or with \
the test site. Browse to $wwwroot and ensure you see a moodle site."


# Generate courses.
${phpcmd} admin/tool/generator/cli/maketestsite.php \
--size=$1 \
Expand Down Expand Up @@ -227,7 +236,7 @@ if [[ "$testplanfiles" == *"testplan"* ]]; then
-o $FILE_NAME_TEST_PLAN ${files[0]} \
-o $FILE_NAME_USERS ${files[1]} \
--silent || \
throw_error "There was a problem getting the test plan files. Check your $wwwroot setting."
throw_error "There was a problem getting the test plan files. Check your wwwroot setting."
else
echo "Error: There was a problem generating the test plan." >&2
exit 1
Expand Down
2 changes: 1 addition & 1 deletion test_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jmetererrormsg="Jmeter can not run, ensure that:
* The test plan and the users files are ok
* You provide correct arguments to the script"

jmeterbin=$jmeter_path/bin/jmeter
jmeterbin=${jmeter_path%/}/bin/jmeter
$jmeterbin \
-n \
-j "$logfile" \
Expand Down

0 comments on commit 941764b

Please sign in to comment.