build: use connect web server instead of SimpleHTTPServer
Several flakes on CI have been tied to long running SimpleHTTPServer that was put in place temporarily after the package splitup.
This commit is contained in:
parent
16dfe3c63f
commit
2bcdec5aaf
1584
gulpfile.js
1584
gulpfile.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -24,7 +24,7 @@ exports.config = {
|
|||
],
|
||||
capabilities: process.env.TRAVIS ? BROWSER_OPTIONS.ChromeOnTravis : BROWSER_OPTIONS.LocalChrome,
|
||||
directConnect: true,
|
||||
baseUrl: 'http://localhost:7777/',
|
||||
baseUrl: 'http://localhost:8000/',
|
||||
framework: 'jasmine2',
|
||||
jasmineNodeOpts: {
|
||||
showColors: true,
|
||||
|
|
|
@ -24,7 +24,7 @@ echo 'travis_fold:end:test.buildPackages'
|
|||
|
||||
echo 'travis_fold:start:test.e2e.localChrome'
|
||||
cd dist/
|
||||
python -m SimpleHTTPServer 7777 &
|
||||
$(npm bin)/gulp serve &
|
||||
cd ..
|
||||
if [[ ${TRAVIS} ]]; then
|
||||
sh -e /etc/init.d/xvfb start
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
var onHeaders = require('on-headers');
|
||||
var proxy = require('proxy-middleware');
|
||||
var cors = require('cors');
|
||||
var url = require('url');
|
||||
|
||||
module.exports = function(gulp, plugins, config) {
|
||||
return function() {
|
||||
plugins.connect.server({
|
||||
root: [__dirname + '/../../' + config.path],
|
||||
port: config.port,
|
||||
livereload: false,
|
||||
open: false,
|
||||
middleware: function(connect, opt) {
|
||||
config.proxies = config.proxies || [];
|
||||
var middlewares =
|
||||
config.proxies.map(function(entry) { return makeProxy(entry.route, entry.url); });
|
||||
middlewares.push(connect.favicon());
|
||||
middlewares.push(cors());
|
||||
// pub serve can't give the right content-type header for jsonp requests
|
||||
// so we must turn off Chromium strict MIME type checking
|
||||
// see https://github.com/angular/angular/issues/3030#issuecomment-123453168
|
||||
middlewares.unshift(stripHeader('x-content-type-options'));
|
||||
return middlewares;
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
function makeProxy(route, urlParam) {
|
||||
var options = url.parse(urlParam);
|
||||
options.route = route;
|
||||
return proxy(options);
|
||||
}
|
||||
|
||||
function stripHeader(toStrip) {
|
||||
return function(req, res, next) {
|
||||
onHeaders(res, function onHeaders() {
|
||||
res.removeHeader(toStrip);
|
||||
});
|
||||
next();
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue