From 232b9fbd9a594d0ca497840ead8a8ab684c0cf86 Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Tue, 19 Sep 2023 12:32:48 +0200 Subject: [PATCH 1/7] Add CircleCI config. --- .circleci/config.yml | 70 +++++++++++++++++++++++++++++ .gitignore | 2 + .travis.yml | 105 ------------------------------------------- 3 files changed, 72 insertions(+), 105 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 .travis.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000000..4621fdb5280 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,70 @@ +version: 2.1 +orbs: + browser-tools: circleci/browser-tools@1.4.6 + +workflows: + test: + jobs: + - test_chrome + - test_firefox + +jobs: + test_chrome: + docker: + - image: cimg/node:10.24.0-browsers + steps: + - browser-tools/install-browser-tools + - checkout + - run: + name: Install npm + command: npm install --prefix=$HOME/.local install npm@7 -g + - run: + name: Install dependencies + command: npm install + - run: + name: Install Bender.js CLI + command: npm install --prefix=$HOME/.local benderjs-cli -g + - run: + name: Setup Bender.js test runner + command: | + cd .. + git clone https://github.com/ckeditor/ckeditor4-benderjs-runner.git --branch v1.2.0 --single-branch + cd ckeditor4-benderjs-runner + npm i + pwd + - run: + name: Run tests on Chrome + command: | + cd ../ckeditor4-benderjs-runner + pwd + npm run start -- --configFile "../../project/bender-runner.config.json" --browser "chrome" --fullRun "fullRun" --repoPath "../project/" + test_firefox: + docker: + - image: cimg/node:10.24.0-browsers + steps: + - browser-tools/install-browser-tools + - checkout + - run: + name: Install npm + command: npm install --prefix=$HOME/.local install npm@7 -g + - run: + name: Install dependencies + command: npm install + - run: + name: Install Bender.js CLI + command: npm install --prefix=$HOME/.local benderjs-cli -g + - run: + name: Setup Bender.js test runner + command: | + cd .. + git clone https://github.com/ckeditor/ckeditor4-benderjs-runner.git --branch v1.2.0 --single-branch + cd ckeditor4-benderjs-runner + npm i + pwd + - run: + name: Run tests on Chrome + command: | + cd ../ckeditor4-benderjs-runner + pwd + npm run start -- --configFile "../../project/bender-runner.config.json" --browser "firefox" --fullRun "fullRun" --repoPath "../project/" + diff --git a/.gitignore b/.gitignore index 6e8f84b44dc..0dae859143e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ # All "dot directories". .*/** +# Ok, almost all – we need CircleCI config. +!.circleci/** node_modules/** build/** diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d27fa30c45b..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,105 +0,0 @@ -branches: - only: - - next - - master - - major - - stable - - latest - - /^\d+\.\d+(\.\d+)?(-\S*)?$/ - - /^release\/\d+\.\d+\.x$/ - - /^[\d]{4,5}security$/ - -git: - depth: false - -env: - global: - - FULL_RUN=$(if [ "$FULL_RUN_TRAVIS_CFG" != "" ]; then echo "$FULL_RUN_TRAVIS_CFG"; elif [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then echo "fullRun"; else echo ""; fi) - - REPO_NAME=$(IFS='/' read -r -a array <<< "$TRAVIS_REPO_SLUG"; echo ${array[1]};) - - TARGET_BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo "$TRAVIS_BRANCH^"; else echo "$TRAVIS_BRANCH"; fi) - - CURRENT_BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo "$TRAVIS_BRANCH"; else echo "$TRAVIS_PULL_REQUEST_BRANCH"; fi) - - secure: "QkTA5VVRwAi1/uAh1LFZUkMrBKn/z/li4qEFZZuLHmV1QWoPTnWZBPVld04aC2rv13CbAjz4MLrbL5HVAloUjDuMFxn/2XogSlfLVMl7SdkZNFgTgnb1FKQ6M52ChANNa7Oyft7Fo5H8EywpYev8me0FPOVKdR/Ep5LLdhXgkEM=" - -jobs: - exclude: - - language: ruby - include: - - name: Chrome (Linux) - os: linux - dist: xenial - language: node_js - node_js: 10 - services: - - xvfb - addons: - chrome: stable - install: - - npm install npm@7 -g - - npm --version - before_script: - - echo $TRAVIS_EVENT_TYPE - # Setup xvfb - - 'export DISPLAY=:99.0' - - 'sleep 3' - # Setup CKEditor 4 testing environment - - pwd - - npm install benderjs-cli -g - - npm i - # Setup additional dependency - - | - if [[ "$EXTRA_DEPS_TRAVIS" == "true" ]]; then - git clone $DEPS_TRAVIS $DEPS_LOCATION_TRAVIS --quiet - cd $DEPS_LOCATION_TRAVIS - git checkout $TRAVIS_PULL_REQUEST_BRANCH || true - cd ../.. - fi - # Setup bender test runner - - cd .. - - pwd - - git clone https://github.com/ckeditor/ckeditor4-benderjs-runner.git --branch v1.2.0 --single-branch - - cd ckeditor4-benderjs-runner - - npm i - script: - - pwd - - echo "Running tests based on diff between $TARGET_BRANCH and $CURRENT_BRANCH" - - npm run start -- --configFile "../../$REPO_NAME/bender-runner.config.json" --targetBranch "$TARGET_BRANCH" --currentBranch "$CURRENT_BRANCH" --browser "chrome" --fullRun "$FULL_RUN" --repoPath "../$REPO_NAME/" --prRepoSlug "$TRAVIS_PULL_REQUEST_SLUG" - - - name: Firefox (Linux) - os: linux - dist: xenial - language: node_js - node_js: 10 - services: - - xvfb - addons: - firefox: latest - install: - - npm install npm@7 -g - - npm --version - before_script: - - echo $TRAVIS_EVENT_TYPE - # Setup xvfb - - 'export DISPLAY=:99.0' - - 'sleep 3' - # Setup CKEditor 4 testing environment - - pwd - - npm install benderjs-cli -g - - npm i - # Setup additional dependency - - | - if [[ "$EXTRA_DEPS_TRAVIS" == "true" ]]; then - git clone $DEPS_TRAVIS $DEPS_LOCATION_TRAVIS --quiet - cd $DEPS_LOCATION_TRAVIS - git checkout $TRAVIS_PULL_REQUEST_BRANCH || true - cd ../.. - fi - # Setup bender test runner - - cd .. - - pwd - - git clone https://github.com/ckeditor/ckeditor4-benderjs-runner.git --branch v1.2.0 --single-branch - - cd ckeditor4-benderjs-runner - - npm i - script: - - pwd - - echo "Running tests based on diff between $TARGET_BRANCH and $CURRENT_BRANCH" - - npm run start -- --configFile "../../$REPO_NAME/bender-runner.config.json" --targetBranch "$TARGET_BRANCH" --currentBranch "$CURRENT_BRANCH" --browser "firefox" --fullRun "$FULL_RUN" --repoPath "../$REPO_NAME/" --prRepoSlug "$TRAVIS_PULL_REQUEST_SLUG" From 613a58990f357aa19fe81f7fa317d6bff9a827e6 Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 15:25:18 +0200 Subject: [PATCH 2/7] Update CI Docker image. Co-authored-by: Kratek --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4621fdb5280..c4066a91663 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ workflows: jobs: test_chrome: docker: - - image: cimg/node:10.24.0-browsers + - image: cimg/node:10.24.1-browsers steps: - browser-tools/install-browser-tools - checkout From 083e0a7b02c55db6e124b4f39d3e6a12bb785f91 Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 15:30:43 +0200 Subject: [PATCH 3/7] Replace Travis badge with CircleCI one. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05c01ef44a5..4383b9c0d86 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![npm version](https://badge.fury.io/js/ckeditor4.svg)](https://www.npmjs.com/package/ckeditor4) [![GitHub tag](https://img.shields.io/github/tag/ckeditor/ckeditor4.svg)](https://github.com/ckeditor/ckeditor4) -[![Build Status](https://app.travis-ci.com/ckeditor/ckeditor4.svg?branch=master)](https://app.travis-ci.com/ckeditor/ckeditor4) +[![CircleCI](https://dl.circleci.com/status-badge/img/gh/ckeditor/ckeditor4/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/ckeditor/ckeditor4/tree/master) [![Join newsletter](https://img.shields.io/badge/join-newsletter-00cc99.svg)](http://eepurl.com/c3zRPr) From bd922266c1d8dabe2618b726669966f2b89e0d1d Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 15:35:40 +0200 Subject: [PATCH 4/7] Update CKE4 build config. --- dev/builder/build-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/builder/build-config.js b/dev/builder/build-config.js index 88056cb68ad..228fd911b4f 100644 --- a/dev/builder/build-config.js +++ b/dev/builder/build-config.js @@ -14,7 +14,7 @@ var CKBUILDER_CONFIG = { '.bender', 'bender-err.log', 'bender-out.log', - '.travis.yml', + '.circleci', 'dev', 'docs', '.DS_Store', From 0dd11276020cdd4b79d88252f8b0e12d94d4c033 Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 15:36:05 +0200 Subject: [PATCH 5/7] Remove Travis-oriented scripts. --- dev/travis/build.sh | 37 ------------------------------------- dev/travis/buildpath.sh | 7 ------- 2 files changed, 44 deletions(-) delete mode 100644 dev/travis/build.sh delete mode 100755 dev/travis/buildpath.sh diff --git a/dev/travis/build.sh b/dev/travis/build.sh deleted file mode 100644 index 8bb9053cdf5..00000000000 --- a/dev/travis/build.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. -# CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model. - -# Build CKEditor on Travis CI for testing. - -BRANCH=$1 - -# Clone and setup ckeditor4-presets repository. -cd .. -git clone https://github.com/ckeditor/ckeditor4-presets.git -cd ckeditor4-presets -git fetch --all -git checkout $BRANCH -git reset --hard origin/$BRANCH - -# Remove ckeditor4 submodule as the local one will be used. -git submodule deinit ckeditor -git rm ckeditor - -# Update submodule paths to use HTTPS instead of SSH. -sed -i "s/git\@/https:\/\//g" .gitmodules -sed -i "s/com:/com\//g" .gitmodules - -# Init submodules. -git submodule update --init - -# Link to ckeditor4 repository which triggered the build. -rm -rf ckeditor -ln -s ../ckeditor4/ ckeditor - -# Build full preset. -./build.sh full all -t -cd "./build/$(ls -1t ./build/ | head -n 1)/full-all/ckeditor/" - -# Copy bender.ci.js file as it is removed during build. -cp ../../../../../ckeditor4/bender.ci.js bender.ci.js diff --git a/dev/travis/buildpath.sh b/dev/travis/buildpath.sh deleted file mode 100755 index fbc8ce1a358..00000000000 --- a/dev/travis/buildpath.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -# Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved. -# CKEditor 4 LTS ("Long Term Support") is available under the terms of the Extended Support Model. - -# Return CKEditor build path. - -echo "../ckeditor4-presets/build/$(ls -1t ../ckeditor4-presets/build/ | head -n 1)/full-all/ckeditor/" From 12010a7f9701eff201e735a54183cd3eb9e249fd Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 15:36:45 +0200 Subject: [PATCH 6/7] Remove `config.isTravis` from Bender CI config. --- bender.ci.js | 1 - 1 file changed, 1 deletion(-) diff --git a/bender.ci.js b/bender.ci.js index 1f19a31d05f..f4533c68165 100644 --- a/bender.ci.js +++ b/bender.ci.js @@ -4,7 +4,6 @@ var config = require( './bender' ); config.startBrowser = process.env.BROWSER || 'Chrome'; -config.isTravis = true; config.startBrowserOptions = { Chrome: '--headless --disable-gpu', Firefox: '-headless' From 139df60830cd5b957a6bac3f6548189323ba7ff1 Mon Sep 17 00:00:00 2001 From: Tomasz Jakut Date: Sun, 24 Sep 2023 15:38:27 +0200 Subject: [PATCH 7/7] Reenable tests disabled on Travis. --- tests/core/dom/range/getclientrects.js | 11 ----------- tests/core/tools.js | 5 ----- tests/plugins/balloonpanel/cssloading.js | 2 +- tests/plugins/balloontoolbar/cssloading.js | 2 +- tests/plugins/balloontoolbar/positioning.js | 3 +-- tests/plugins/easyimage/balloontoolbar.js | 4 ---- tests/plugins/easyimage/uploadintegrations.js | 3 --- tests/plugins/imagebase/features/upload.js | 4 ---- 8 files changed, 3 insertions(+), 31 deletions(-) diff --git a/tests/core/dom/range/getclientrects.js b/tests/core/dom/range/getclientrects.js index 7a55457bd87..cad0d096187 100644 --- a/tests/core/dom/range/getclientrects.js +++ b/tests/core/dom/range/getclientrects.js @@ -6,23 +6,12 @@ 'use strict'; var doc = CKEDITOR.document, - isTravisAndFirefox = bender.config.isTravis && CKEDITOR.env.gecko, tests = { setUp: function() { this.playground = doc.getById( 'playground' ); }, - _should: { - ignore: { - // Tests randomly fails on FF in Travis - 'test only element selection': isTravisAndFirefox, - 'test last element selection': isTravisAndFirefox, - 'test two line selection': isTravisAndFirefox, - 'test three line selection': isTravisAndFirefox - } - }, - 'test only element selection': function() { this._assertRectList( 'only-element-selection', { defaultExpected: { diff --git a/tests/core/tools.js b/tests/core/tools.js index 37b0a6deadd..62857a342bd 100644 --- a/tests/core/tools.js +++ b/tests/core/tools.js @@ -633,11 +633,6 @@ }, 'test buffers.throttle': function() { - if ( bender.config.isTravis && CKEDITOR.env.gecko ) { - // test randomly fails on FF on Travis. - assert.ignore(); - } - var foo = 'foo', baz = 'baz', inputSpy = sinon.spy(), diff --git a/tests/plugins/balloonpanel/cssloading.js b/tests/plugins/balloonpanel/cssloading.js index 447b0a1e4c9..a852be4ffd5 100644 --- a/tests/plugins/balloonpanel/cssloading.js +++ b/tests/plugins/balloonpanel/cssloading.js @@ -27,7 +27,7 @@ // 'removeDots' is necessary to properly compare URL. We cannot use absolute url, as test might have additional folders in URL. // Tests run in bender: // * from dashboard have address like: http://tests.ckeditor.test/tests/plugins/balloonpanel/cssloading - // * from jobs on Travis have address like: http://tests.ckeditor.test/jobs/VY5lgovj70g1AOkv/tests/tests/plugins/balloonpanel/cssloading + // * from jobs on CI have address like: http://tests.ckeditor.test/jobs/VY5lgovj70g1AOkv/tests/tests/plugins/balloonpanel/cssloading // This is why there have to be relative URL. However 'appendStyleSheet' receive final URL which does not contain dots in address. // It's necessary to adapt URL address to be properly compared in assertion. sinon.assert.calledWith( spy, balloonTestsTools.getDocumentOrigin() + diff --git a/tests/plugins/balloontoolbar/cssloading.js b/tests/plugins/balloontoolbar/cssloading.js index 735be581333..f64584a45eb 100644 --- a/tests/plugins/balloontoolbar/cssloading.js +++ b/tests/plugins/balloontoolbar/cssloading.js @@ -29,7 +29,7 @@ // 'removeDots' is necessary to properly compare URL. We cannot use absolute url, as test might have additional folders in URL. // Tests run in bender: // * from dashboard have address like: http://tests.ckeditor.test/tests/plugins/balloonpanel/cssloading - // * from jobs on Travis have address like: http://tests.ckeditor.test/jobs/VY5lgovj70g1AOkv/tests/tests/plugins/balloonpanel/cssloading + // * from jobs on CI have address like: http://tests.ckeditor.test/jobs/VY5lgovj70g1AOkv/tests/tests/plugins/balloonpanel/cssloading // This is why there have to be relative URL. However 'appendStyleSheet' receive final URL which does not contain dots in address. // It's necessary to adapt URL address to be properly compared in assertion. sinon.assert.calledWith( spy, balloonTestsTools.getDocumentOrigin() + diff --git a/tests/plugins/balloontoolbar/positioning.js b/tests/plugins/balloontoolbar/positioning.js index 47c26c998a1..be431d644a8 100644 --- a/tests/plugins/balloontoolbar/positioning.js +++ b/tests/plugins/balloontoolbar/positioning.js @@ -100,9 +100,8 @@ }, 'test panel - out of view - hcenter top': function( editor ) { - if ( editor.name == 'divarea' || ( bender.config.isTravis && bender.tools.env.isBuild ) ) { + if ( editor.name == 'divarea' ) { // divarea tests are failing, it's an upstream issue from balloonpanel (#1064). - // Ignore test with builded editor in travis. assert.ignore(); } diff --git a/tests/plugins/easyimage/balloontoolbar.js b/tests/plugins/easyimage/balloontoolbar.js index 85d74c27528..109ccec087a 100644 --- a/tests/plugins/easyimage/balloontoolbar.js +++ b/tests/plugins/easyimage/balloontoolbar.js @@ -93,10 +93,6 @@ }, 'test balloontoolbar positioning': function( editor, bot ) { - // Ignore test with builded editor in travis. - if ( bender.config.isTravis && bender.tools.env.isBuild ) { - assert.ignore(); - } // Force toolbar to always appear under the widget. editor.container.getWindow().$.scroll( 0, editor.container.getDocumentPosition().y ); diff --git a/tests/plugins/easyimage/uploadintegrations.js b/tests/plugins/easyimage/uploadintegrations.js index c1b42712e7c..07e00b5297e 100644 --- a/tests/plugins/easyimage/uploadintegrations.js +++ b/tests/plugins/easyimage/uploadintegrations.js @@ -132,9 +132,6 @@ assert.ignore(); } - if ( bender.config.isTravis && CKEDITOR.env.gecko ) { - assert.ignore(); - } this.sandbox.stub( window, 'alert' ); this.editorBot.setHtmlWithSelection( '

^

' ); diff --git a/tests/plugins/imagebase/features/upload.js b/tests/plugins/imagebase/features/upload.js index 18ea5afb7b8..b30ba321554 100644 --- a/tests/plugins/imagebase/features/upload.js +++ b/tests/plugins/imagebase/features/upload.js @@ -130,10 +130,6 @@ }, setUp: function() { - if ( bender.config.isTravis && CKEDITOR.env.gecko ) { - assert.ignore(); - } - bender.tools.ignoreUnsupportedEnvironment( 'easyimage' ); this.editorBot.setHtmlWithSelection( '

^

' );