diff --git a/scripts/testing/ReadMe.md b/scripts/testing/ReadMe.md new file mode 100644 index 0000000..420925f --- /dev/null +++ b/scripts/testing/ReadMe.md @@ -0,0 +1,11 @@ +# Prepare VM + +```bash +./scripts/testing/prepare-vm-for-testing.sh +``` + +# Run Testing + +```bash +./scripts/testing/run-test.sh +``` diff --git a/scripts/testing/install-dependencies-for-tests.sh b/scripts/testing/install-dependencies-for-tests.sh new file mode 100644 index 0000000..637aed8 --- /dev/null +++ b/scripts/testing/install-dependencies-for-tests.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +yes '' | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +echo "export PATH=/usr/local/bin:$PATH" >> ~/.profile + +brew update +brew install node@8 +brew link --force node@8 \ No newline at end of file diff --git a/scripts/testing/prepare-vm-for-testing.sh b/scripts/testing/prepare-vm-for-testing.sh new file mode 100755 index 0000000..e4089cb --- /dev/null +++ b/scripts/testing/prepare-vm-for-testing.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -e + +ANKA_VERSION=$(anka version | egrep -o '([0-9].)+[0-9]') + +echo "Creating high-sierra-perf-$ANKA_VERSION VM for testing..." +#anka create --ram-size 4G --cpu-count 2 --disk-size 60G --app /Applications/Install\ macOS\ High\ Sierra.app high-sierra-perf-$ANKA_VERSION +anka run --volume $PWD/scripts/testing high-sierra-perf-$ANKA_VERSION bash install-dependencies-for-tests.sh \ No newline at end of file diff --git a/scripts/testing/run-performance-test.sh b/scripts/testing/run-performance-test.sh new file mode 100755 index 0000000..16af43f --- /dev/null +++ b/scripts/testing/run-performance-test.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +ANKA_VERSION=$(anka version | egrep -o '([0-9].)+[0-9]') + +time anka run --volume $PWD/scripts/testing/volume high-sierra-perf-$ANKA_VERSION ./performance-test.sh \ No newline at end of file diff --git a/scripts/testing/volume/performance-test.sh b/scripts/testing/volume/performance-test.sh new file mode 100755 index 0000000..32fcdb8 --- /dev/null +++ b/scripts/testing/volume/performance-test.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -e + +mkdir -p puppeteer +rm -rf puppeteer +git clone https://github.com/GoogleChrome/puppeteer.git + +cd puppeteer +npm install --unsafe-perm +npm run lint +npm run coverage +npm run test-doclint + +cd .. +rm -rf puppeteer \ No newline at end of file