File tree Expand file tree Collapse file tree 6 files changed +59
-4
lines changed Expand file tree Collapse file tree 6 files changed +59
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,16 @@ before_script:
11
11
12
12
# Keep this in sync with appveyor.yml
13
13
script :
14
+ # # run eslint, flow and the unit test suite.
14
15
- COVERAGE=y NODE_ENV=production npm test
16
+
17
+ # # run functional test suite in a npm production environment
18
+ # # (See #1082 for rationale).
19
+ - npm run copy-dist-files-to-artifacts-dir
20
+ - cd artifacts/production && npm install --production && cd -
21
+ - TEST_WEB_EXT_BIN=./artifacts/production/bin/web-ext npm run test:functional
22
+
23
+ # # lint the github PR title.
15
24
- npm run travis-pr-title-lint
16
25
17
26
after_script : npm run publish-coverage
Original file line number Diff line number Diff line change @@ -30,13 +30,12 @@ module.exports = function(grunt) {
30
30
'webpack:functional_tests' ,
31
31
] ) ;
32
32
33
- grunt . registerTask ( 'test' , 'run linting and test suites ' , function ( ) {
33
+ grunt . registerTask ( 'test' , 'run linting and the unit test suite ' , function ( ) {
34
34
var tasks = [
35
35
'lint' ,
36
36
'flowbin:check' ,
37
37
'build-tests' ,
38
38
'mochaTest:unit' ,
39
- 'mochaTest:functional' ,
40
39
] ;
41
40
42
41
// TODO: enable the flowbin:check task on AppVeyor (mozilla/web-ext#773)
@@ -48,6 +47,27 @@ module.exports = function(grunt) {
48
47
grunt . task . run ( tasks ) ;
49
48
} ) ;
50
49
50
+ grunt . registerTask ( 'test:functional' , 'run functional test suites' , [
51
+ 'build-tests' ,
52
+ 'mochaTest:functional' ,
53
+ ] ) ;
54
+
55
+ grunt . registerTask ( 'copy-dist-files-to-artifacts-dir' , function ( ) {
56
+ const distFile = grunt . file . expand ( './dist/**' ) . filter ( ( filename ) => {
57
+ return filename . endsWith ( 'web-ext.js' ) ;
58
+ } ) ;
59
+
60
+ if ( distFile . length === 0 ) {
61
+ // By default grunt will exit here, unless the `--force` grunt option has been
62
+ // specified on the command line.
63
+ grunt . fail . warn (
64
+ 'Required dist/ file missing. Run the build command first.'
65
+ ) ;
66
+ }
67
+
68
+ grunt . task . run ( 'copy:dist-files-to-artifacts-dir' ) ;
69
+ } ) ;
70
+
51
71
grunt . registerTask ( 'develop' , [
52
72
'flowbin:start' ,
53
73
'watch:develop' ,
Original file line number Diff line number Diff line change @@ -21,3 +21,13 @@ test_script:
21
21
- set COVERAGE=y
22
22
- set NODE_ENV=production
23
23
- npm run test
24
+ # # install the eslint version needed by eslint and run functional test suite
25
+ # # (See #1082 for rationale).
26
+ # # run functional test suite in a npm production environment
27
+ # # (See #1082 for rationale).
28
+ - npm run copy-dist-files-to-artifacts-dir
29
+ - cd artifacts\production
30
+ - npm install --production
31
+ - cd ..\..
32
+ - set TEST_WEB_EXT_BIN=artifacts\production\bin\web-ext
33
+ - npm run test:functional
Original file line number Diff line number Diff line change 17
17
"flow-check" : " grunt flowbin:check" ,
18
18
"lint" : " grunt lint" ,
19
19
"test" : " grunt test" ,
20
+ "test:functional" : " grunt test:functional:run" ,
21
+ "copy-dist-files-to-artifacts-dir" : " grunt copy-dist-files-to-artifacts-dir" ,
20
22
"publish-coverage" : " grunt coveralls" ,
21
23
"nsp-check" : " nsp check -o summary" ,
22
24
"changelog" : " conventional-changelog -p angular -u" ,
46
48
" opera"
47
49
],
48
50
"dependencies" : {
49
- "addons-linter" : " 0.25 .1" ,
51
+ "addons-linter" : " 0.26 .1" ,
50
52
"babel-polyfill" : " 6.20.0" ,
51
53
"babel-runtime" : " 6.25.0" ,
52
54
"bunyan" : " 1.8.10" ,
96
98
"coveralls" : " 2.13.1" ,
97
99
"deepcopy" : " 0.6.3" ,
98
100
"doctoc" : " 1.3.0" ,
101
+ "eslint" : " 3.19.0" ,
99
102
"eslint-plugin-async-await" : " 0.0.0" ,
100
103
"eslint-plugin-flowtype" : " 2.35.0" ,
101
104
"eslint-plugin-import" : " 2.3.0" ,
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ 'dist-files-to-artifacts-dir' : {
3
+ files : [
4
+ {
5
+ expand : true ,
6
+ src : [ 'package.json' , 'dist/**' , 'bin/**' ] ,
7
+ dest : 'artifacts/production' ,
8
+ } ,
9
+ ] ,
10
+ } ,
11
+ } ;
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ export const withTempDir = tmpDirUtils.withTempDir;
13
13
14
14
export const functionalTestsDir = path . resolve ( __dirname ) ;
15
15
export const projectDir = path . join ( functionalTestsDir , '..' , '..' ) ;
16
- export const webExt = path . join ( projectDir , 'bin' , 'web-ext' ) ;
16
+ export const webExt = process . env . TEST_WEB_EXT_BIN ?
17
+ path . resolve ( process . env . TEST_WEB_EXT_BIN ) :
18
+ path . join ( projectDir , 'bin' , 'web-ext' ) ;
17
19
export const fixturesDir = path . join ( functionalTestsDir , '..' , 'fixtures' ) ;
18
20
export const minimalAddonPath = path . join ( fixturesDir , 'minimal-web-ext' ) ;
19
21
export const fakeFirefoxPath = path . join (
You can’t perform that action at this time.
0 commit comments