Skip to content
This repository was archived by the owner on Nov 28, 2020. It is now read-only.

Update community-benchmark/run.sh to allow generic github repos/branches #195

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions experimental/benchmarks/community-benchmark/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ echo "This script has two use cases:"
echo "Use case 1: We want to test the impact of a PR on a branch."
echo "To run this, declare:"
echo "The script expects the following variables to be set:"
echo "GITHUB_ORG = The user/org of the GitHub repo"
echo "CATEGORY = a category of tests to run - folders in benchmark/"
echo "BRANCH = the branch the test should be based off. e.g. master"
echo "PULL_ID = the pull request that contains changes to test"
echo "-------------------------------------------------------------"
echo "Use case 2: We want to compare two branches, tags or commits."
echo "To run this, declare:"
echo "CATEGORY = a category of tests to run - folders in benchmark/"
echo "GITHUB_ORG_BASE = The user/org of the GitHub repo (base for comparison)"
echo "REPO_NAME_BASE = The name of the repo (base for comparison)"
echo "BASE = the branch/tag/commit the test should be based off. e.g. master"
echo "GITHUB_ORG_TARGET = The user/org of the GitHub repo (target for comparison)"
echo "REPO_NAME_TARGET = The name of the repo (target for comparison)"
echo "TARGET = the branch/tag/commit to compare against base"
echo "-------------------------------------------------------------"
echo "The following are optional across both use cases"
Expand All @@ -52,13 +57,17 @@ else
mandatory PULL_ID
fi
mandatory CATEGORY
optional RUNS
optional GITHUB_ORG_BASE nodejs
optional REPO_NAME_BASE node
optional GITHUB_ORG_TARGET nodejs
optional REPO_NAME_TARGET node
optional RUNS
optional FILTER
getMACHINE_THREADS=`cat /proc/cpuinfo |grep processor|tail -n1|awk {'print $3'}`
let getMACHINE_THREADS=getMACHINE_THREADS+1 #getting threads this way is 0 based. Add one
optional MACHINE_THREADS $getMACHINE_THREADS
rm -rf node
git clone http://github.com/nodejs/node.git
git clone --depth=10 https://github.com/$GITHUB_ORG_BASE/$REPO_NAME_BASE.git/ node
cd node
case $USE_CASE in
1)
Expand All @@ -80,7 +89,9 @@ case $USE_CASE in
curl https://patch-diff.githubusercontent.com/raw/nodejs/node/pull/${PULL_ID}.patch|git apply
;;
2)
git checkout $TARGET
git remote add target https://github.com/$GITHUB_ORG_TARGET/$REPO_NAME_TARGET.git/
git fetch --depth=10 target
git checkout target/$TARGET || git checkout $TARGET
;;
esac
./configure
Expand Down