Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(package): update addons-linter to version 0.26.1 #1082

Merged
merged 3 commits into from
Sep 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ before_script:

# Keep this in sync with appveyor.yml
script:
## run eslint, flow and the unit test suite.
- COVERAGE=y NODE_ENV=production npm test

## run functional test suite in a npm production environment
## (See #1082 for rationale).
- npm run copy-dist-files-to-artifacts-dir
- cd artifacts/production && npm install --production && cd -
- TEST_WEB_EXT_BIN=./artifacts/production/bin/web-ext npm run test:functional

## lint the github PR title.
- npm run travis-pr-title-lint

after_script: npm run publish-coverage
Expand Down
24 changes: 22 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ module.exports = function(grunt) {
'webpack:functional_tests',
]);

grunt.registerTask('test', 'run linting and test suites', function() {
grunt.registerTask('test', 'run linting and the unit test suite', function() {
var tasks = [
'lint',
'flowbin:check',
'build-tests',
'mochaTest:unit',
'mochaTest:functional',
];

// TODO: enable the flowbin:check task on AppVeyor (mozilla/web-ext#773)
Expand All @@ -48,6 +47,27 @@ module.exports = function(grunt) {
grunt.task.run(tasks);
});

grunt.registerTask('test:functional', 'run functional test suites', [
'build-tests',
'mochaTest:functional',
]);

grunt.registerTask('copy-dist-files-to-artifacts-dir', function() {
const distFile = grunt.file.expand('./dist/**').filter((filename) => {
return filename.endsWith('web-ext.js');
});

if (distFile.length === 0) {
// By default grunt will exit here, unless the `--force` grunt option has been
// specified on the command line.
grunt.fail.warn(
'Required dist/ file missing. Run the build command first.'
);
}

grunt.task.run('copy:dist-files-to-artifacts-dir');
});

grunt.registerTask('develop', [
'flowbin:start',
'watch:develop',
Expand Down
10 changes: 10 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@ test_script:
- set COVERAGE=y
- set NODE_ENV=production
- npm run test
## install the eslint version needed by eslint and run functional test suite
## (See #1082 for rationale).
## run functional test suite in a npm production environment
## (See #1082 for rationale).
- npm run copy-dist-files-to-artifacts-dir
- cd artifacts\production
- npm install --production
- cd ..\..
- set TEST_WEB_EXT_BIN=artifacts\production\bin\web-ext
- npm run test:functional
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
"flow-check": "grunt flowbin:check",
"lint": "grunt lint",
"test": "grunt test",
"test:functional": "grunt test:functional:run",
"copy-dist-files-to-artifacts-dir": "grunt copy-dist-files-to-artifacts-dir",
"publish-coverage": "grunt coveralls",
"nsp-check": "nsp check -o summary",
"changelog": "conventional-changelog -p angular -u",
Expand Down Expand Up @@ -46,7 +48,7 @@
"opera"
],
"dependencies": {
"addons-linter": "0.25.1",
"addons-linter": "0.26.1",
"babel-polyfill": "6.20.0",
"babel-runtime": "6.25.0",
"bunyan": "1.8.10",
Expand Down Expand Up @@ -96,6 +98,7 @@
"coveralls": "2.13.1",
"deepcopy": "0.6.3",
"doctoc": "1.3.0",
"eslint": "3.19.0",
"eslint-plugin-async-await": "0.0.0",
"eslint-plugin-flowtype": "2.35.0",
"eslint-plugin-import": "2.3.0",
Expand Down
11 changes: 11 additions & 0 deletions tasks/configs/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
'dist-files-to-artifacts-dir': {
files: [
{
expand: true,
src: ['package.json', 'dist/**', 'bin/**'],
dest: 'artifacts/production',
},
],
},
};
4 changes: 3 additions & 1 deletion tests/functional/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const withTempDir = tmpDirUtils.withTempDir;

export const functionalTestsDir = path.resolve(__dirname);
export const projectDir = path.join(functionalTestsDir, '..', '..');
export const webExt = path.join(projectDir, 'bin', 'web-ext');
export const webExt = process.env.TEST_WEB_EXT_BIN ?
path.resolve(process.env.TEST_WEB_EXT_BIN) :
path.join(projectDir, 'bin', 'web-ext');
export const fixturesDir = path.join(functionalTestsDir, '..', 'fixtures');
export const minimalAddonPath = path.join(fixturesDir, 'minimal-web-ext');
export const fakeFirefoxPath = path.join(
Expand Down