This commit is contained in:
Fredrik Wollsén 2018-06-19 10:39:55 +03:00
Родитель d722f37bcc
Коммит ab95d7406b
4 изменённых файлов: 36 добавлений и 20 удалений

Просмотреть файл

@ -3,6 +3,11 @@ jobs:
build: build:
docker: docker:
- image: circleci/node:latest-browsers - image: circleci/node:latest-browsers
environment:
FIREFOX_BIN: /home/circleci/checkout/firefox-release/firefox-bin
FIREFOX_AURORA_BIN: /home/circleci/checkout/firefox-beta/firefox-bin
FIREFOX_DEVELOPER_BIN: /home/circleci/checkout/firefox-devedition/firefox-bin
FIREFOX_NIGHTLY_BIN: /home/circleci/checkout/firefox-nightly/firefox-bin
working_directory: ~/checkout working_directory: ~/checkout
@ -12,7 +17,7 @@ jobs:
# Download and cache dependencies (update the cache keys to force a newer version) # Download and cache dependencies (update the cache keys to force a newer version)
- restore_cache: - restore_cache:
keys: keys:
- v1-dependencies-{{ checksum "package.json" }}-20180618 - dependencies-and-browsers-{{ checksum "package.json" }}-20180619
- run: - run:
name: Install dependencies name: Install dependencies
@ -21,14 +26,12 @@ jobs:
- run: - run:
name: Install different versions of Firefox name: Install different versions of Firefox
command: | command: |
./node_modules/.bin/get-firefox -b release -p linux -e [ ! -d "./firefox-release" ] && npx get-firefox -b release -p linux -e && mv ./firefox ./firefox-release || true
mv ./firefox ./firefox-release [ ! -d "./firefox-beta" ] && npx get-firefox -b beta -p linux -e && mv ./firefox ./firefox-beta || true
./node_modules/.bin/get-firefox -b beta -p linux -e [ ! -d "./firefox-devedition" ] && npx get-firefox -b devedition -p linux -e && mv ./firefox ./firefox-devedition || true
mv ./firefox ./firefox-beta [ ! -d "./firefox-nightly" ] && npx get-firefox -b nightly -p linux -e && mv ./firefox ./firefox-nightly || true
./node_modules/.bin/get-firefox -b devedition -p linux -e # Prevent any tests from using the default installed version of Firefox
mv ./firefox ./firefox-devedition sudo rm /usr/bin/firefox || true
./node_modules/.bin/get-firefox -b nightly -p linux -e
mv ./firefox ./firefox-nightly
- save_cache: - save_cache:
paths: paths:
@ -38,7 +41,7 @@ jobs:
- firefox-beta - firefox-beta
- firefox-release - firefox-release
- firefox-unbranded-release - firefox-unbranded-release
key: v1-dependencies-{{ checksum "package.json" }}-20180618 key: dependencies-and-browsers-{{ checksum "package.json" }}-20180619
- run: - run:
name: Reveal which Firefox versions are installed name: Reveal which Firefox versions are installed
@ -60,23 +63,27 @@ jobs:
- store_artifacts: - store_artifacts:
path: "dist" path: "dist"
- run:
name: Unit tests
command: npm run test:unit
# Firefox Release not yet at 61.0a1 which is required by the template # Firefox Release not yet at 61.0a1 which is required by the template
#- run: #- run:
# name: Test with Firefox Release # name: Functional tests with Firefox Release
# command: FIREFOX_BINARY=/home/circleci/checkout/firefox-release/firefox-bin npm run test # command: FIREFOX_BINARY=/home/circleci/checkout/firefox-release/firefox-bin npm run test:func
# Utils v5 does not work with Firefox Beta #200 # Utils v5 does not work with Firefox Beta #200
#- run: #- run:
# name: Test with Firefox Beta # name: Functional tests with Firefox Beta
# command: FIREFOX_BINARY=/home/circleci/checkout/firefox-beta/firefox-bin npm run test # command: FIREFOX_BINARY=/home/circleci/checkout/firefox-beta/firefox-bin npm run test:func
- run: - run:
name: Test with Firefox Developer Edition name: Functional tests with Firefox Developer Edition
command: FIREFOX_BINARY=/home/circleci/checkout/firefox-devedition/firefox-bin FIREFOX_DEVELOPER_BIN=/home/circleci/checkout/firefox-devedition/firefox-bin npm run test command: FIREFOX_BINARY=/home/circleci/checkout/firefox-devedition/firefox-bin npm run test:func
- run: - run:
name: Test with Firefox Nightly name: Functional tests with Firefox Nightly
command: FIREFOX_BINARY=/home/circleci/checkout/firefox-nightly/firefox-bin npm run test command: FIREFOX_BINARY=/home/circleci/checkout/firefox-nightly/firefox-bin npm run test:func
- store_test_results: - store_test_results:
path: "test/coverage" path: "test/coverage"

1
.gitignore поставляемый
Просмотреть файл

@ -2,3 +2,4 @@ dist/*
node_modules/ node_modules/
.env .env
test/coverage test/coverage
/firefox-*

Просмотреть файл

@ -117,6 +117,14 @@ Runs unit tests using Karma.
Code at [/test/unit/](/test/unit/). Code at [/test/unit/](/test/unit/).
Note: [The karma firefox launcher](https://github.com/karma-runner/karma-firefox-launcher) expects that the firefox binaries are located in slightly different places than `web-ext`. Example on how to workaround this on OSX:
```shell
cd /Applications/
ln -s FirefoxBeta.app FirefoxAurora.app
ln -s Firefox\ Nightly.app FirefoxNightly.app
```
### Functional tests ### Functional tests
```shell ```shell

Просмотреть файл

@ -10,9 +10,9 @@ module.exports = function(config) {
singleRun: true, singleRun: true,
browsers: [ browsers: [
// "Firefox", // "Firefox",
// "FirefoxAurora", // Firefox Beta
"FirefoxDeveloper", "FirefoxDeveloper",
// "FirefoxAurora", "FirefoxNightly",
// "FirefoxNightly",
], ],
frameworks: ["mocha", "chai"], frameworks: ["mocha", "chai"],
reporters, reporters,