You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2018/03/14 04:23:32 UTC
ignite git commit: IGNITE-7895 Web Console: Replaced PhantomJS with
headless Chrome. Cleanup dev dependencies. Added docker image to run tests on
TeamCity.
Repository: ignite
Updated Branches:
refs/heads/master 05d58bb6e -> 536e82548
IGNITE-7895 Web Console: Replaced PhantomJS with headless Chrome. Cleanup dev dependencies. Added docker image to run tests on TeamCity.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/536e8254
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/536e8254
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/536e8254
Branch: refs/heads/master
Commit: 536e825483deec864ee665d53cc8a695771c4aa0
Parents: 05d58bb
Author: Alexander Kalinin <ve...@yandex.ru>
Authored: Wed Mar 14 11:23:29 2018 +0700
Committer: Alexey Kuznetsov <ak...@apache.org>
Committed: Wed Mar 14 11:23:29 2018 +0700
----------------------------------------------------------------------
modules/web-console/frontend/package.json | 19 ++------
.../web-console/frontend/test/ci/.dockerignore | 4 ++
modules/web-console/frontend/test/ci/Dockerfile | 36 ++++++++++++++
.../frontend/test/ci/docker-compose.yml | 25 ++++++++++
.../frontend/test/karma.conf.babel.js | 12 +++--
.../frontend/test/protractor.conf.js | 50 --------------------
6 files changed, 77 insertions(+), 69 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/536e8254/modules/web-console/frontend/package.json
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/package.json b/modules/web-console/frontend/package.json
index 100e644..fd301b2 100644
--- a/modules/web-console/frontend/package.json
+++ b/modules/web-console/frontend/package.json
@@ -8,8 +8,6 @@
"dev": "npm start",
"build": "webpack --config ./webpack/webpack.prod.babel.js",
"test": "karma start ./test/karma.conf.js",
- "enve2e": "node ./test/e2e/envtools.js start",
- "teste2e": "node ./test/e2e/testcafe.js --env=true",
"eslint": "eslint --format node_modules/eslint-friendly-formatter app/ controllers/ ignite_modules/ -- --eff-by-issue"
},
"author": "",
@@ -106,29 +104,18 @@
},
"devDependencies": {
"chai": "4.1.0",
- "copy-dir": "^0.3.0",
- "fs-extra": "^4.0.2",
- "glob": "^7.1.2",
+ "glob": "7.1.2",
"jasmine-core": "2.6.4",
"karma": "1.7.0",
"karma-babel-preprocessor": "6.0.1",
+ "karma-chrome-launcher": "2.2.0",
"karma-jasmine": "1.1.0",
"karma-mocha": "1.3.0",
"karma-mocha-reporter": "2.2.3",
- "karma-phantomjs-launcher": "1.0.4",
"karma-teamcity-reporter": "1.0.0",
"karma-webpack": "2.0.4",
- "minimist": "^1.2.0",
"mocha": "3.4.2",
- "mocha-teamcity-reporter": "1.1.1",
- "mongodb": "2.2.33",
- "node-cmd": "3.0.0",
- "objectid": "3.2.1",
- "phantomjs-prebuilt": "2.1.14",
"sinon": "2.3.8",
- "testcafe": "0.18.5",
- "testcafe-angular-selectors": "0.3.0",
- "type-detect": "4.0.3",
- "util": "0.10.3"
+ "type-detect": "4.0.3"
}
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/536e8254/modules/web-console/frontend/test/ci/.dockerignore
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/test/ci/.dockerignore b/modules/web-console/frontend/test/ci/.dockerignore
new file mode 100644
index 0000000..bcac98f
--- /dev/null
+++ b/modules/web-console/frontend/test/ci/.dockerignore
@@ -0,0 +1,4 @@
+.git
+*Dockerfile*
+*docker-compose*
+*/node_modules*
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/536e8254/modules/web-console/frontend/test/ci/Dockerfile
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/test/ci/Dockerfile b/modules/web-console/frontend/test/ci/Dockerfile
new file mode 100644
index 0000000..a1b7c67
--- /dev/null
+++ b/modules/web-console/frontend/test/ci/Dockerfile
@@ -0,0 +1,36 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM alpine:edge
+
+RUN apk --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ add \
+ nodejs nodejs-npm chromium xwininfo xvfb dbus eudev ttf-freefont fluxbox
+
+ENV CHROME_BIN /usr/bin/chromium-browser
+
+# Install frontend & backend apps.
+RUN mkdir -p /opt/web-console
+
+# Copy source.
+WORKDIR /opt/web-console
+COPY . ./frontend
+
+# Install node modules.
+WORKDIR /opt/web-console/frontend
+RUN npm install
+
+ENTRYPOINT ["npm", "test"]
http://git-wip-us.apache.org/repos/asf/ignite/blob/536e8254/modules/web-console/frontend/test/ci/docker-compose.yml
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/test/ci/docker-compose.yml b/modules/web-console/frontend/test/ci/docker-compose.yml
new file mode 100644
index 0000000..69667e6
--- /dev/null
+++ b/modules/web-console/frontend/test/ci/docker-compose.yml
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+version: '2'
+services:
+ unit_tests:
+ build:
+ context: '../../'
+ dockerfile: './test/ci/Dockerfile'
+ environment:
+ - TEST_REPORTER=teamcity
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/536e8254/modules/web-console/frontend/test/karma.conf.babel.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/test/karma.conf.babel.js b/modules/web-console/frontend/test/karma.conf.babel.js
index 30e168c..48104c8 100644
--- a/modules/web-console/frontend/test/karma.conf.babel.js
+++ b/modules/web-console/frontend/test/karma.conf.babel.js
@@ -35,7 +35,7 @@ export default (config) => {
],
plugins: [
- require('karma-phantomjs-launcher'),
+ require('karma-chrome-launcher'),
require('karma-teamcity-reporter'),
require('karma-mocha-reporter'),
require('karma-webpack'),
@@ -57,7 +57,7 @@ export default (config) => {
// Test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter.
- reporters: ['mocha'],
+ reporters: [process.env.TEST_REPORTER || 'mocha'],
mochaReporter: {
showDiff: true
@@ -78,7 +78,13 @@ export default (config) => {
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
- browsers: ['PhantomJS'],
+ browsers: ['ChromeHeadlessNoSandbox'],
+ customLaunchers: {
+ ChromeHeadlessNoSandbox: {
+ base: 'ChromeHeadless',
+ flags: ['--no-sandbox']
+ }
+ },
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
http://git-wip-us.apache.org/repos/asf/ignite/blob/536e8254/modules/web-console/frontend/test/protractor.conf.js
----------------------------------------------------------------------
diff --git a/modules/web-console/frontend/test/protractor.conf.js b/modules/web-console/frontend/test/protractor.conf.js
deleted file mode 100644
index 4ee1c69..0000000
--- a/modules/web-console/frontend/test/protractor.conf.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// exports.config = {
-// specs: ['test/e2e/*.js'],
-// capabilities: {
-
-// }
-// };
-
-exports.config = {
- seleniumAddress: 'http://localhost:4444/wd/hub',
-
- capabilities: {
- browserName: 'chrome'
- // 'browserName': 'phantomjs',
-
- // /*
- // * Can be used to specify the phantomjs binary path.
- // * This can generally be ommitted if you installed phantomjs globally.
- // */
- // 'phantomjs.binary.path': require('phantomjs').path,
-
- // /*
- // * Command line args to pass to ghostdriver, phantomjs's browser driver.
- // * See https://github.com/detro/ghostdriver#faq
- // */
- // 'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG']
- },
-
- specs: ['test/e2e/*.js'],
-
- jasmineNodeOpts: {
- showColors: true
- }
-};