Skip to content

Commit

Permalink
Integration tests (#997)
Browse files Browse the repository at this point in the history
* improve test coverage by far

* add linting

* adding RN cli for CI

* skip git for CI

* disable android build
  • Loading branch information
GantMan authored and kevinvangelder committed Apr 26, 2017
1 parent 41eb63e commit a9873f2
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 additions & 13 deletions bin/testRelease
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ verify_code()
{
echo '~~~🌟 Checking Code'
npm install -g standard
npm install -g ava
npm i -g react-native-cli
test_command standard ./packages
test_command npm test

# run integration tests
cd ./packages/ignite-integration-tests && npm run integration && cd -
}
Expand All @@ -63,11 +65,11 @@ check_builds()
mkdir testgrounds
cd ./testgrounds
echo '~~~🌟 Generating Project'
test_command ignite new TestProj --min
test_command ignite new TestProj --min --skip-git

echo '~~~🌟 Checking Builds'
cd ./TestProj

if [ ! -d "android" ]; then
echo 'Android folder did not generate'
SOMETHING_FAILED=1
Expand All @@ -78,22 +80,43 @@ check_builds()
SOMETHING_FAILED=1
fi

echo 'Testing Blessed Plugins'
echo '~ Test adding vector-icons plugin from npm'
test_command ignite add vector-icons
echo '~ Test adding animatable plugin from npm'
test_command ignite add animatable
echo '~ Test adding i18n plugin from npm'
test_command ignite add i18n
echo '~ Test adding maps plugin from npm'
test_command ignite add maps

echo '~ LINT ALL THE THINGS!'
test_command npm run lint

echo '~ Build ios'
test_command react-native bundle --entry-file index.ios.js --bundle-output test.ios.js
test_command react-native bundle --entry-file index.ios.js --bundle-output test.ios.js --dev false --platform ios --assets-dest iosAssets
if [ ! -d "iosAssets" ]; then
echo 'iosAssets folder did not generate'
SOMETHING_FAILED=1
fi

echo '~ Build android'
# A failed android build will not exit with a non-zero return!
# This makes it a bit trickier to test for - look for the fail message instead
cd ./android
./gradlew assembleRelease | grep -q 'BUILD FAILED'
if [[ $? -eq 0 ]]; then
echo 'Android build failed'
test_command react-native bundle --entry-file index.android.js --bundle-output test.android.js --dev false --platform android --assets-dest androidAssets
if [ ! -d "androidAssets" ]; then
echo 'androidAssets folder did not generate'
SOMETHING_FAILED=1
fi
cd ..
# A failed android build will not exit with a non-zero return!
# This makes it a bit trickier to test for - look for the fail message instead
# Temporary disable this until we separate CI needs from here
# cd ./android
# ./gradlew assembleRelease | grep -q 'BUILD FAILED'
# if [[ $? -eq 0 ]]; then
# echo 'Android build failed'
# SOMETHING_FAILED=1
# fi
# cd ..

echo '~ Test adding vector-icons plugin from npm'
test_command ignite add vector-icons

# back to root
cd ../..
Expand Down

0 comments on commit a9873f2

Please sign in to comment.