Skip to content

Instantly share code, notes, and snippets.

@msmith-techempower
Last active May 28, 2017 16:28
Show Gist options
  • Save msmith-techempower/0b105594d038afb7cd93 to your computer and use it in GitHub Desktop.
Save msmith-techempower/0b105594d038afb7cd93 to your computer and use it in GitHub Desktop.
Manually run a framework test
# We should definitely get this automated somehow.
# ASSUMPTIONS: 1) db/client/app are all localhost, 2) your user is "vagrant", 3) your testrunner user is "testrunner", 4) you don't care about performance, 5) you are using port 8080, 6) your json test URI is "/json".
# This is what you will need to do in order to manually test a given framework:
# 1 - Become the testrunner
sudo su testrunner
# 2 - Set some required environment variables
export FWROOT=$(pwd)
export IROOT=$FWROOT/installs
export DBHOST=127.0.0.1
export MAX_THREADS=1
# 3 - Get your bash functions sourced
source toolset/setup/linux/bash_functions.sh
# 4 - Change directories into your framework
cd frameworks/lua/lapis
# 5 - Set another environment variable
export TROOT=$(pwd)
# 6 - Source your bash profile
source bash_profile.sh
#IMPORTANT: path-y environment variables can be set in bash_profile.sh, but using the suite normally (read: not manually like this), the path-y envvars will be WIPED before getting into the next step. If you need to set PATH, LD_INCLUDE_PATH, etc, you MUST do that in your setup.sh file (and maybe also in bash_profile.sh if it is required for installation)
# 7 - Install your required software
cd $IROOT
source ${TROOT}/install.sh
# 8 - Run your test
cd $TROOT
source setup.sh
#IMPORTANT: if you are experiencing errors, this step might fail silently because most processes are set to run in the background as the last step. Alternatively, you could copy/paste everything in your setup.sh file and leave off the ampersand to run it in the foreground (might require screen sessions to do real testing).
# 9 - Test your test
curl localhost:8080/json
#IMPORANT: You need to use a tool like curl to get a response from your software. If you ran the last step by copy/pasting the contents of your setup.sh file, then you will need to use a different terminal as your current one is blocked while the server is running.
# The above steps SHOULD be all that is required on a properly configured environment to manually run and test any framework test in the suite.
# Once you are satisfied with your changes and want to test out the suite properly, you will need to do the following:
# 1 - Exit testrunner's shell
exit
# 2 - Kill anything started by testrunner
sudo killall -s 9 -u testrunner
# 3 - Remove the results and installs dir
sudo rm -rf installs results
# 4 - Run your test
toolset/run-tests.py --mode verify --test lapis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment