Skip to content

Commit 1cd294d

Browse files
author
Oleksii Korshenko
authored
MAGETWO-66816: Added JS Jasmine tests to Travis CI #9013
2 parents b6a5ca2 + f4be610 commit 1cd294d

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

.travis.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,31 @@ env:
1515
global:
1616
- COMPOSER_BIN_DIR=~/bin
1717
- INTEGRATION_SETS=3
18+
- NODE_JS_VERSION=6
1819
matrix:
1920
- TEST_SUITE=unit
2021
- TEST_SUITE=integration INTEGRATION_INDEX=1
2122
- TEST_SUITE=integration INTEGRATION_INDEX=2
2223
- TEST_SUITE=integration INTEGRATION_INDEX=3
2324
- TEST_SUITE=static
25+
- TEST_SUITE=js
2426
cache:
2527
apt: true
26-
directories: $HOME/.composer/cache
28+
directories:
29+
- $HOME/.composer/cache
30+
- $HOME/.nvm
31+
- $HOME/node_modules
32+
- $HOME/yarn.lock
2733
matrix:
2834
exclude:
2935
- php: 5.6.29
3036
env: TEST_SUITE=static
37+
- php: 5.6.29
38+
env: TEST_SUITE=js
3139
before_install: ./dev/travis/before_install.sh
3240
install: composer install --no-interaction --prefer-dist
3341
before_script: ./dev/travis/before_script.sh
3442
script:
3543
- test $TEST_SUITE = "static" && TEST_FILTER='--filter "Magento\\Test\\Php\\LiveCodeTest"' || true
36-
- phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER
44+
- if [ $TEST_SUITE != "js" ]; then phpunit -c dev/tests/$TEST_SUITE $TEST_FILTER; fi
45+
- if [ $TEST_SUITE == "js" ]; then grunt spec; fi

dev/travis/before_script.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,25 @@ case $TEST_SUITE in
7676

7777
cd ../../..
7878
;;
79+
js)
80+
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
81+
export NVM_DIR="$HOME/.nvm"
82+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
83+
nvm install $NODE_JS_VERSION
84+
nvm use $NODE_JS_VERSION
85+
node --version
86+
87+
cp package.json.sample package.json
88+
cp Gruntfile.js.sample Gruntfile.js
89+
npm install -g yarn
90+
yarn global add grunt-cli
91+
yarn
92+
93+
echo "Installing Magento"
94+
mysql -uroot -e 'CREATE DATABASE magento2;'
95+
php bin/magento setup:install -q --admin-user="admin" --admin-password="123123q" --admin-email="admin@example.com" --admin-firstname="John" --admin-lastname="Doe"
96+
97+
echo "Deploying Static Content"
98+
php bin/magento setup:static-content:deploy -f -q -j=2 --no-css --no-less --no-images --no-fonts --no-misc --no-html-minify
99+
;;
79100
esac

package.json.sample

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"name": "Magento2",
2+
"name": "magento2",
33
"author": "Magento Commerce Inc.",
44
"description": "Magento2 node modules dependencies for local development",
5-
"version": "2.0.0",
65
"license": "(OSL-3.0 OR AFL-3.0)",
76
"repository": {
87
"type": "git",
@@ -38,8 +37,5 @@
3837
"time-grunt": "^1.0.0",
3938
"underscore": "^1.7.0",
4039
"squirejs": "0.2.1"
41-
},
42-
"engines": {
43-
"node": ">=0.10.0"
4440
}
4541
}

0 commit comments

Comments
 (0)