Run tests on Firefox in Travis

This commit is contained in:
Tim Schaub
2017-07-03 16:34:28 -06:00
parent 3bdddeac1d
commit fb820f4b81
4 changed files with 12 additions and 102 deletions

View File

@@ -3,7 +3,7 @@ sudo: false
language: node_js
node_js:
- "6.1"
- "8"
addons:
firefox: "52.0"
@@ -14,9 +14,6 @@ cache:
env:
- DISPLAY=:99.0
before_install:
- "npm prune"
before_script:
- "rm src/ol/renderer/webgl/*shader.js"
- "sh -e /etc/init.d/xvfb start"
@@ -24,10 +21,6 @@ before_script:
script: "make ci"
after_success:
- "make test-coverage"
- "cat coverage/lcov.info | ./node_modules/.bin/coveralls"
branches:
only:
- master

View File

@@ -6,9 +6,6 @@ SRC_SHADER_JS := $(patsubst %shader.glsl,%shader.js,$(SRC_GLSL))
SRC_JS := $(filter-out $(SRC_SHADER_JS),$(shell find src -name '*.js'))
SRC_JSDOC = $(shell find src -type f -name '*.jsdoc')
SPEC_JS := $(shell find test/spec -type f -name '*.js')
SPEC_RENDERING_JS := $(shell find test_rendering/spec -name '*.js')
EXAMPLES := $(shell find examples -type f)
EXAMPLES_HTML := $(filter-out examples/index.html,$(shell find examples -maxdepth 1 -type f -name '*.html'))
EXAMPLES_JS := $(patsubst %.html,%.js,$(EXAMPLES_HTML))
@@ -56,7 +53,6 @@ help:
@echo "Other less frequently used targets are:"
@echo
@echo "- build Build ol.js, ol-debug.js, ol.js.map and ol.css"
@echo "- lint Check the code with the linter"
@echo "- ci Run the full continuous integration process"
@echo "- apidoc Build the API documentation using JSDoc"
@echo "- cleanall Remove all the build artefacts"
@@ -70,7 +66,7 @@ apidoc: build/timestamps/jsdoc-$(BRANCH)-timestamp
build: build/ol.css build/ol.js build/ol-debug.js build/ol.js.map
.PHONY: check
check: lint build/ol.js test
check: build/ol.js test
.PHONY: check-examples
check-examples: $(CHECK_EXAMPLE_TIMESTAMPS)
@@ -86,21 +82,18 @@ check-deps:
done ;\
.PHONY: ci
ci: lint build test test-rendering package compile-examples check-examples apidoc
ci: build test package compile-examples check-examples apidoc
.PHONY: compile-examples
compile-examples: build/compiled-examples/all.combined.js
.PHONY: clean
clean:
rm -f build/timestamps/eslint-timestamp
rm -f build/timestamps/check-*-timestamp
rm -f build/ol.css
rm -f build/ol.js
rm -f build/ol.js.map
rm -f build/ol-debug.js
rm -f build/test_requires.js
rm -f build/test_rendering_requires.js
rm -rf build/examples
rm -rf build/compiled-examples
rm -rf build/package
@@ -119,9 +112,6 @@ examples: $(BUILD_EXAMPLES)
.PHONY: install
install: build/timestamps/node-modules-timestamp
.PHONY: lint
lint: build/timestamps/eslint-timestamp
.PHONY: npm-install
npm-install: build/timestamps/node-modules-timestamp
@@ -129,24 +119,12 @@ npm-install: build/timestamps/node-modules-timestamp
shaders: $(SRC_SHADER_JS)
.PHONY: serve
serve: build/test_requires.js build/test_rendering_requires.js
serve:
node tasks/serve.js
.PHONY: test
test: build/timestamps/node-modules-timestamp build/test_requires.js
node tasks/test.js
.PHONY: test-coverage
test-coverage: build/timestamps/node-modules-timestamp
node tasks/test-coverage.js
.PHONY: test-rendering
test-rendering: build/timestamps/node-modules-timestamp \
build/test_rendering_requires.js
@rm -rf build/slimerjs-profile
@mkdir -p build/slimerjs-profile
@cp -r test_rendering/slimerjs-profile/* build/slimerjs-profile/
node tasks/test-rendering.js
test: build/timestamps/node-modules-timestamp
npm test
.PHONY: host-examples
host-examples: $(BUILD_HOSTED_EXAMPLES) \
@@ -248,14 +226,6 @@ $(BUILD_HOSTED)/build/ol-deps.js: host-libraries
--root_with_prefix "$(BUILD_HOSTED)/closure-library/third_party ../../third_party" \
--output_file $@
build/timestamps/eslint-timestamp: $(SRC_JS) $(SPEC_JS) $(SPEC_RENDERING_JS) \
$(TASKS_JS) $(EXAMPLES_JS) \
build/timestamps/node-modules-timestamp
@mkdir -p $(@D)
@echo "Running eslint..."
@./node_modules/.bin/eslint tasks test test_rendering src examples
@touch $@
build/timestamps/node-modules-timestamp: package.json
@mkdir -p $(@D)
npm install
@@ -291,14 +261,6 @@ build/ol-debug.js: config/ol-debug.json $(SRC_JS) $(SRC_SHADER_JS) \
@$(STAT_COMPRESSED) /tmp/ol-debug.js.gz
@rm /tmp/ol-debug.js.gz
build/test_requires.js: $(SPEC_JS) $(SRC_JS)
@mkdir -p $(@D)
@node tasks/generate-requires.js $^ > $@
build/test_rendering_requires.js: $(SPEC_RENDERING_JS)
@mkdir -p $(@D)
@node tasks/generate-requires.js $^ > $@
%shader.js: %shader.glsl src/ol/webgl/shader.mustache bin/pyglslunit.py build/timestamps/node-modules-timestamp
@python bin/pyglslunit.py --input $< | ./node_modules/.bin/mustache - src/ol/webgl/shader.mustache > $@

View File

@@ -12,9 +12,10 @@
"install": "node tasks/install.js",
"postinstall": "closure-util update",
"start": "node tasks/serve.js",
"pretest": "eslint tasks test src examples",
"lint": "eslint tasks test src examples",
"lint-package": "eslint --fix build/package",
"test": "node tasks/test.js",
"pretest": "npm run lint",
"test": "npm run karma -- --single-run",
"debug-server": "node tasks/serve-lib.js",
"karma": "node tasks/test-all.js start test/karma.config.js"
},
@@ -64,6 +65,7 @@
"jscodeshift": "^0.3.30",
"karma": "^1.7.0",
"karma-chrome-launcher": "^2.1.1",
"karma-firefox-launcher": "^1.0.1",
"karma-mocha": "^1.3.0",
"karma-sauce-launcher": "^1.1.0",
"marked": "0.3.6",

View File

@@ -1,4 +1,3 @@
var pkg = require('../package.json');
var path = require('path');
/**
@@ -48,55 +47,9 @@ module.exports = function(karma) {
});
if (process.env.TRAVIS) {
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
process.stderr.write('SAUCE_USERNAME or SAUCE_ACCESS_KEY not set\n');
process.exit(1);
}
// see https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
// for platform and browserName options (Selenium API, node.js code)
var customLaunchers = {
SL_Chrome: {
base: 'SauceLabs',
browserName: 'chrome'
},
SL_Firefox: {
base: 'SauceLabs',
browserName: 'firefox'
},
SL_IE: {
base: 'SauceLabs',
platform: 'Windows 10',
browserName: 'internet explorer'
},
SL_Edge: {
base: 'SauceLabs',
platform: 'Windows 10',
browserName: 'MicrosoftEdge'
},
SL_Safari: {
base: 'SauceLabs',
platform: 'macos 10.12',
browserName: 'safari'
}
};
karma.set({
sauceLabs: {
testName: pkg.name + ' ' + pkg.version,
recordScreenshots: false,
connectOptions: {
port: 5757
},
startConnect: false,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
username: process.env.SAUCE_USERNAME,
accessKey: process.env.SAUCE_ACCESS_KEY
},
reporters: ['dots', 'saucelabs'],
captureTimeout: 240000,
browserNoActivityTimeout: 240000,
customLaunchers: customLaunchers,
browsers: Object.keys(customLaunchers)
reporters: ['dots'],
browsers: ['Firefox']
});
} else {
karma.set({