Skip to content

Commit

Permalink
Merge pull request #4737 from ckeditor/t/ckeditor4-benderjs-runner/2
Browse files Browse the repository at this point in the history
  • Loading branch information
Comandeer authored Jun 2, 2021
2 parents 11ad1c0 + fd92d02 commit 2e93c54
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 27 deletions.
94 changes: 67 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
sudo: required
os: linux
dist: xenial
services:
- xvfb

branches:
only:
Expand All @@ -13,32 +11,74 @@ branches:
- /^release\/\d+\.\d+\.x$/

language: node_js
node_js: 10

node_js:
- 10
git:
depth: false

env:
- BUILD=0 BROWSER=Chrome
- BUILD=1 BROWSER=Chrome
- BUILD=0 BROWSER=Firefox MOZ_HEADLESS=1
- BUILD=1 BROWSER=Firefox MOZ_HEADLESS=1
- FULL_RUN=$(if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then echo "fullRun"; else echo ""; fi)

addons:
firefox: "latest"
chrome: stable
jobs:
include:
- name: Chrome (Linux)
services:
- xvfb
addons:
chrome: stable
before_script:
- echo $TRAVIS_EVENT_TYPE
# Setup xvfb
- 'export DISPLAY=:99.0'
- 'sleep 3'
# Define target branches
- TARGET_BRANCH="origin/$TRAVIS_BRANCH"
- CURRENT_BRANCH="origin/$TRAVIS_PULL_REQUEST_BRANCH"
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
sh -e TARGET_BRANCH="origin/HEAD^" && CURRENT_BRANCH="origin/HEAD";
fi'
# Setup CKEditor 4 testing environment
- pwd
- npm install benderjs-cli -g
- npm i
# Setup bender test runner
- cd ..
- pwd
- git clone https://github.com/ckeditor/ckeditor4-benderjs-runner.git
- cd ckeditor4-benderjs-runner
- npm i
script:
- pwd
- echo "Running tests based on diff between $TARGET_BRANCH and $CURRENT_BRANCH"
- npm run start "../../ckeditor4/bender-runner.config.json" "$TARGET_BRANCH" "$CURRENT_BRANCH" "chrome" $FULL_RUN

before_script:
# Prepare environment.
- 'npm install benderjs-cli -g'
- 'export DISPLAY=:99.0'
- 'sleep 3'

# The $TRAVIS_BRANCH points to target branch for PRs and for other branches it is the current branch name.
- 'BUILD_PATH=0'
- 'if [ "$BUILD" = "1" ] && ( [ "$TRAVIS_BRANCH" = "master" ] || [ "$TRAVIS_BRANCH" = "major" ] ); then
sh -e ./dev/travis/build.sh $TRAVIS_BRANCH && BUILD_PATH="$(sh -e ./dev/travis/buildpath.sh)";
fi'

script:
- 'if [ "$BUILD" = "0" ]; then bender run -c bender.ci.js; fi'
- 'if [ "$BUILD" = "1" ] && [ "$BUILD_PATH" != "0" ]; then cd $BUILD_PATH && bender run -c bender.ci.js; fi'
- name: Firefox (Linux)
services:
- xvfb
addons:
firefox: latest
before_script:
- echo $TRAVIS_EVENT_TYPE
# Setup xvfb
- 'export DISPLAY=:99.0'
- 'sleep 3'
# Define target branches
- TARGET_BRANCH="origin/$TRAVIS_BRANCH"
- CURRENT_BRANCH="origin/$TRAVIS_PULL_REQUEST_BRANCH"
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
sh -e TARGET_BRANCH="origin/HEAD^" && CURRENT_BRANCH="origin/HEAD";
fi'
# Setup CKEditor 4 testing environment
- pwd
- npm install benderjs-cli -g
- npm i
# Setup bender test runner
- cd ..
- pwd
- git clone https://github.com/ckeditor/ckeditor4-benderjs-runner.git
- cd ckeditor4-benderjs-runner
- npm i
script:
- pwd
- echo "Running tests based on diff between $TARGET_BRANCH and $CURRENT_BRANCH"
- npm run start "../../ckeditor4/bender-runner.config.json" "$TARGET_BRANCH" "$CURRENT_BRANCH" "firefox" $FULL_RUN
15 changes: 15 additions & 0 deletions bender-runner.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"bender": {
"port": 9001
},
"server": {
"port": 9002
},
"paths": {
"ckeditor4": "../ckeditor4/",
"runner": "./src/runner.html"
},
"browsers": {
"linux": [ "chrome", "firefox" ]
}
}

0 comments on commit 2e93c54

Please sign in to comment.