X Tutup
Skip to content
Closed
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
101 changes: 53 additions & 48 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ gulp.task('test.js', function(done) {

gulp.task('test.dart', function(done) {
runSequence('versions.dart', 'test.transpiler.unittest', 'test.unit.dart/ci',
'test.dart.angular2_testing/ci', sequenceComplete(done));
sequenceComplete(done));
});

gulp.task('versions.dart', function() { dartSdk.logVersion(DART_SDK); });
Expand Down Expand Up @@ -635,8 +635,7 @@ gulp.task('buildRouter.dev', function() {
gulp.task('test.unit.dart', function(done) {
printModulesWarning();
runSequence('build/tree.dart', 'build/pure-packages.dart', '!build/pubget.angular2.dart',
'!build/change_detect.dart', '!build/remove-pub-symlinks', 'build.dart.material.css',
'!test.unit.dart/karma-server', '!test.unit.dart/karma-run', function(error) {
'!build/change_detect.dart', '!build/remove-pub-symlinks', function(error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this expected to remove build.dart.material.css ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - @jelbourn said that we don't care about the material tests anymore, so to speed things up it should be OK to remove this.

var watch = require('./tools/build/watch');

// if initial build failed (likely due to build or formatting step) then exit
Expand All @@ -645,9 +644,10 @@ gulp.task('test.unit.dart', function(done) {
done(error);
return;
}
// treatTestErrorsAsFatal = false;

watch(['modules/angular2/**'], {ignoreInitial: true},
['!build/tree.dart', '!test.unit.dart/karma-run']);
watch(['modules/angular2/**'],
['!build/tree.dart', '!test.unit.dart/run/angular2']);
});
});

Expand Down Expand Up @@ -789,20 +789,6 @@ gulp.task('watch.dart.dev', function(done) {
});
});

gulp.task('!test.unit.dart/karma-run', function(done) {
// run the run command in a new process to avoid duplicate logging by both server and runner from
// a single process
runKarma('karma-dart.conf.js', done);
});


gulp.task('!test.unit.dart/karma-server', function() {
var karma = require('karma');

new karma.Server({configFile: __dirname + '/karma-dart.conf.js', reporters: 'dots'}).start();
});


gulp.task('test.unit.router/ci', function(done) {
var karma = require('karma');

Expand Down Expand Up @@ -850,20 +836,56 @@ gulp.task('test.unit.js.browserstack/ci', function(done) {
});

gulp.task('test.unit.dart/ci', function(done) {
var karma = require('karma');
runSequence('test.dart.dartium_symlink', '!test.unit.dart/run/angular2',
'!test.unit.dart/run/angular2_testing', '!test.unit.dart/run/benchpress',
sequenceComplete(done));
});

var browserConf = getBrowsersFromCLI(null, true);
new karma.Server(
{
configFile: __dirname + '/karma-dart.conf.js',
singleRun: true,
reporters: ['dots'],
browsers: browserConf.browsersToRun
},
done)
.start();
// At the moment, dart test requires dartium to be an executable on the path.
// Make a temporary directory and symlink dartium from there (just for this command)
// so that it can run.
// TODO(juliemr): this won't work with windows - remove the hack and make this platform agnostic.
var dartiumTmpdir = path.join(os.tmpdir(), 'dartium' + new Date().getTime().toString());
var dartiumPathPrefix = 'PATH=$PATH:' + dartiumTmpdir + ' ';
gulp.task(
'test.dart.dartium_symlink',
shell.task(['mkdir ' + dartiumTmpdir, 'ln -s $DARTIUM_BIN ' + dartiumTmpdir + '/dartium']));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add a todo to make this code platform agnostic (i.e. windows friendly?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.


gulp.task('!test.unit.dart/run/angular2', function() {
var pubtest = require('./tools/build/pubtest');
return pubtest({
dir: path.join(CONFIG.dest.dart, 'angular2'),
dartiumTmpdir: dartiumTmpdir,
command: DART_SDK.PUB,
files: '**/*_spec.dart',
bunchFiles: true,
useExclusiveTests: true
});
});

gulp.task('!test.unit.dart/run/angular2_testing', function() {
var pubtest = require('./tools/build/pubtest');

return pubtest({
dir: path.join(CONFIG.dest.dart, 'angular2_testing'),
dartiumTmpdir: dartiumTmpdir,
command: DART_SDK.PUB,
files: '**/*_test.dart',
useExclusiveTests: true
});
});

gulp.task('!test.unit.dart/run/benchpress', function() {
var pubtest = require('./tools/build/pubtest');

return pubtest({
dir: path.join(CONFIG.dest.dart, 'benchpress'),
dartiumTmpdir: dartiumTmpdir,
command: DART_SDK.PUB,
files: '**/*_spec.dart',
useExclusiveTests: true
});
});

gulp.task('test.unit.cjs/ci', function(done) {
runJasmineTests(['dist/js/cjs/{angular2,benchpress}/test/**/*_spec.js'], done);
Expand Down Expand Up @@ -930,24 +952,6 @@ gulp.task('test.server.dart', runServerDartTests(gulp, gulpPlugins, {dest: 'dist
gulp.task('test.transpiler.unittest',
function(done) { runJasmineTests(['tools/transpiler/unittest/**/*.js'], done); });

// At the moment, dart test requires dartium to be an executable on the path.
// Make a temporary directory and symlink dartium from there (just for this command)
// so that it can run.
var dartiumTmpdir = path.join(os.tmpdir(), 'dartium' + new Date().getTime().toString());
gulp.task('test.dart.angular2_testing/ci', ['build/pubspec.dart'], function(done) {
runSequence('test.dart.angular2_testing_symlink', 'test.dart.angular2_testing',
sequenceComplete(done));
});

gulp.task(
'test.dart.angular2_testing_symlink',
shell.task(['mkdir ' + dartiumTmpdir, 'ln -s $DARTIUM_BIN ' + dartiumTmpdir + '/dartium']));

gulp.task('test.dart.angular2_testing',
shell.task(['PATH=$PATH:' + dartiumTmpdir + ' pub run test -p dartium'],
{'cwd': 'dist/dart/angular2_testing'}));


// -----------------
// Pre-test checks

Expand Down Expand Up @@ -1017,6 +1021,7 @@ gulp.task('build/pure-packages.dart/standalone', function() {
'modules_dart/**/*',
'!modules_dart/**/*.proto',
'!modules_dart/**/packages{,/**}',
'!modules_dart/**/.packages',
'!modules_dart/payload{,/**}',
'!modules_dart/transform{,/**}',
])
Expand Down
86 changes: 0 additions & 86 deletions karma-dart-evalcache.js

This file was deleted.

82 changes: 0 additions & 82 deletions karma-dart.conf.js

This file was deleted.

1 change: 1 addition & 0 deletions modules/angular2/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies:
dev_dependencies:
transformer_test: '^0.2.0'
guinness: '^0.1.18'
guinness2: '0.0.5'
quiver: '^0.21.4'
test: '^0.12.6'
transformers:
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/testing/matchers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ library testing.matchers;

import 'dart:async';

import 'package:guinness/guinness.dart' as gns;
import 'package:guinness2/guinness2.dart' as gns;

import 'package:angular2/src/platform/dom/dom_adapter.dart' show DOM;

Expand Down
Loading
X Tutup