Skip to content

Commit

Permalink
Merge pull request #513 from ckeditor/t/ckeditor5/1662
Browse files Browse the repository at this point in the history
Fix: Fixed issues related to a new dependency checker on Travis. Closes ckeditor/ckeditor5#1662.
  • Loading branch information
Reinmar authored Apr 12, 2019
2 parents 4ac75cc + b949f1c commit dfc9477
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/ckeditor5-dev-tests/bin/check-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const tableData = [

const depCheckOptions = {
ignoreDirs: [ 'docs', 'build' ],
ignoreMatches: [ 'eslint', 'husky', 'lint-staged', 'webpack-cli' ]
ignoreMatches: [ 'eslint', 'eslint-plugin-ckeditor5-rules', 'husky', 'lint-staged', 'webpack-cli' ]
};

if ( Array.isArray( packageJson.depcheckIgnore ) ) {
Expand Down
8 changes: 5 additions & 3 deletions packages/ckeditor5-dev-tests/bin/test-travis.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# Breaks the entire script if any command returned exit code other than 0.
set -e

# Current work directory.
PACKAGE_ROOT=$(pwd)

Expand All @@ -11,10 +14,9 @@ PACKAGE_NAME=$(node -e "console.log( require( process.cwd() + '/package.json' ).
# The `.ckeditor5_test_environment` file is created by the "install-dependencies" script.
CKEDITOR5_TEST_ENVIRONMENT=$(cat ${PACKAGE_ROOT}/.ckeditor5_test_environment)

# Those tasks must be executed from the original package.
# Linter and dependency checker tasks must be executed from the original package.
yarn run lint && \
${ROOT_BIN}/ckeditor5-dev-tests-check-dependencies

${ROOT_BIN}/ckeditor5-dev-tests-check-dependencies && \
cd ${CKEDITOR5_TEST_ENVIRONMENT} && \
node --max_old_space_size=4096 $ROOT_BIN/ckeditor5-dev-tests --files=$PACKAGE_NAME --coverage --reporter=dots --browsers=Chrome && \
node --max_old_space_size=4096 $ROOT_BIN/ckeditor5-dev-tests --files=$PACKAGE_NAME --reporter=dots --browsers=Firefox,BrowserStack_Edge,BrowserStack_Safari
8 changes: 5 additions & 3 deletions packages/ckeditor5-dev-tests/bin/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ if ( options.files.length === 0 ) {
options.themePath = path.resolve( cwd, 'packages', 'ckeditor5-theme-lark', 'theme', 'theme.css' );

tests.runAutomatedTests( options )
.then( () => {
process.exit( 0 );
} )
.catch( error => {
// Mark result of this task as invalid.
process.exitCode = 1;

console.log( chalk.red( error ) );

process.exit( 1 );
} );
4 changes: 1 addition & 3 deletions packages/ckeditor5-dev-tests/lib/tasks/runautomatedtests.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ function runKarma( options ) {
if ( exitCode === 0 ) {
resolve();
} else {
reject();

process.exit( exitCode );
reject( new Error( `Karma finished with "${ exitCode }" code.` ) );
}
} );

Expand Down

0 comments on commit dfc9477

Please sign in to comment.