Git Product home page Git Product logo

grinder.dart's Issues

grinder_files:: copyFile cannot copy permission.

-rwxr-xr-x 1 root root 229 Nov 10 16:38 ex.sh

run `copyFile(new File('./ex.sh'), new Directory('./foo'));

result is

-rw-r--r-- 1 root root 229 Nov 10 16:48 ex.sh

which doesn't have execute permission.

grinder does not have a --version

sethladd@sethladd-macbookair ~/Code/stagehand (super-simple-webapp)$ grinder --version
Unhandled exception:
FormatException: Could not find an option named "version".

Would love a --version :)

Consider using a wider version constraint for the args package

Currently, the latest version of Grinder (0.6.0) is incompatible with Angular.dart (and its modules, such as di). The cause is that angular is using a version of the analyzer which depends on an older version of the args package.

Apparently, Grinder is not affected by the changes made on newer versions of the args package, so it would be safe to use a wider version constraint, like the one used by the Polymer package:

args: '>=0.10.0 <0.13.0'

code coverage?

Figure out if grinder should have a code coverage task directly, or use a test runner (TBD), that provides a way to generate code coverage.

Considering refactor PubTools

Seems like all the functions in PubTools are really like static assets. Did we consider either a library for PubTools and top-level functions or actual static methods on the PubTools.

I went looking for how to invoke pub build and instantiating an instance of PubTools just to run build seems overkill. But maybe I'm missing something.

release 0.6

Tracking issue for releasing 0.6. Let's bunch up API breaking changes (we already have a few committed).

@sethladd

Failing tasks should not print/log exception stacktraces

When a task fails and calls context.fail("Tests Failed!"); exceptions get printed to the stdout/log. We are constantly scrolling up past a stack trace to see the actual failure message. This is unnecessary output, if a task is failing for a known quantity that task should log necessary remarks and call fail. The exception masks the real problem.

Example output we are seeing:

dart tool\grinder.dart test

...

6 PASSED, 1 FAILED, 0 ERRORS
Unhandled exception:
Exception: Some tests failed.
#0 SimpleConfiguration.onDone (package:unittest/src/simple_configuration.dart:189:9)
#1 _completeTests (package:unittest/unittest.dart:487:17)
#2 _runTest (package:unittest/unittest.dart:436:19)
#3 _nextTestCase (package:unittest/unittest.dart:376:11)
#4 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)
#5 _asyncRunCallback (dart:async/schedule_microtask.dart:32)
#6 _asyncRunCallback (dart:async/schedule_microtask.dart:36)
#7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:128)

Uncaught Error: GrinderException: Tests Failed!
Stack Trace:
#0 GrinderContext.fail (package:grinder/grinder.dart:169:32)
#1 GrinderAutomatedTestTask._runTestProcess (package:grinder_automated_test_task/grinder_automated_test_task.dart:98:19)
#2 runTests (package:grinder_automated_test_task/grinder_automated_test_task.dart:40:20)
#3 GrinderTask.execute (package:grinder/grinder.dart:202:26)
#4 Grinder._executeTask (package:grinder/grinder.dart:337:30)
#5 Grinder.start. (package:grinder/grinder.dart:312:28)
#6 Future.forEach.nextElement. (dart:async/future.dart:300)
#7 Future.Future.sync (dart:async/future.dart:168)
#8 Future.forEach.nextElement (dart:async/future.dart:300)
#9 _rootRunUnary (dart:async/zone.dart:730)
#10 _RootZone.runUnary (dart:async/zone.dart:864)
#11 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:488)
#12 _Future._propagateToListeners (dart:async/future_impl.dart:571)
#13 _Future._completeWithValue (dart:async/future_impl.dart:331)
#14 _Future._asyncComplete. (dart:async/future_impl.dart:393)
#15 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)
#16 _asyncRunCallback (dart:async/schedule_microtask.dart:32)
#17 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:128)

Unhandled exception:
GrinderException: Tests Failed!
#0 _rootHandleUncaughtError.. (dart:async/zone.dart:713)
#1 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:23)
#2 _asyncRunCallback (dart:async/schedule_microtask.dart:32)
#3 _asyncRunCallback (dart:async/schedule_microtask.dart:36)
#4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:128)

Don't require DART_SDK to be set to use grinder

Could we get away with not requiring DART_SDK to use grinder? I just tried to run it on stagehand, and I got this:

~/Code/stagehand[website*]$ ./grind build-site
grinder running [init] [build-site]

[init]

[build-site]
  Building the site
GrinderException: Unable to locate the Dart SDK; try setting the DART_SDK environment variable.
#0      runSdkBinary (package:grinder/grinder_utils.dart:139:5)
#1      PubTools.build (package:grinder/grinder_utils.dart:226:17)
#2      buildSite (file:///Users/sethladd/Code/stagehand/tool/grind.dart:74:12)
#3      GrinderTask.execute (package:grinder/grinder.dart:213:49)
#4      Grinder._executeTask (package:grinder/grinder.dart:351:30)
#5      Grinder.start.<anonymous closure> (package:grinder/grinder.dart:322:28)
#6      Future.forEach.<anonymous closure>.<anonymous closure> (dart:async/future.dart:302)
#7      Future.Future.sync (dart:async/future.dart:168)
#8      Future.forEach.<anonymous closure> (dart:async/future.dart:302)
#9      Future.Future.sync (dart:async/future.dart:168)
#10     Future.doWhile.<anonymous closure> (dart:async/future.dart:327)
#11     _RootZone.runUnaryGuarded (dart:async/zone.dart:1020)
#12     _RootZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:1049)
#13     _RootZone.runUnary (dart:async/zone.dart:1082)
#14     _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:488)
#15     _Future._propagateToListeners (dart:async/future_impl.dart:571)
#16     _Future._completeWithValue (dart:async/future_impl.dart:331)
#17     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:393)
#18     _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#19     _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#20     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:126)

Dart and the SDK is on my path. Is that enough to find pub?

Pub.global should be static

Currently global is the only instance field on Pub, so you have to do new Pub().global.run(..). I think it was inteneded to be static so you can do Pub.global.run(..).

List tasks as defined order

I'm using grinder from office as substitute of bash script. I'm happy that I don't need to know bash grammer.

OK, the only unhappy thing is ...

Currently, grider sort tasks as alpabetical order. https://github.com/google/grinder.dart/blob/master/lib/grinder.dart#L128

How about listing tasks as they defined? From the example1.
If we define tasks as below.

  task('init', init);
  task('compile', compile, ['init']);
  task('deploy', deploy, ['compile']);
  task('all', null, ['deploy']);

then we get

valid targest:
  [init]
  [compile]
  [deploy]
  [all]

command to initialize tool/grinder.dart

It would be cool to do:

stagehand ...
den install grinder
pub run grinder:init

To initialize a grinder project. init would probably not need to be in executables, it would initialize a default tool/grind(er).dart script.

Stream output from jobs

From customer: "when running something like PubTools.build() doesn’t output anything until the entire job is done. So when a build takes 60 seconds, and there isn’t any sort of output it’s not clear that something is going on. It’s even worse with something like pub serve that doesn’t ever finish so there is never any output."

Request: work with `pub run` for a package

I think we want to promote a convention like:

cd my_package
pub run grind

or

pub run grind test

We can assume pub will eventually let us install a script into the PATH, so we'll eventually get:

grind test

This implies there is some sort of grinder_config.dart file in a package, that the grinder util looks for.

Enable Travis

Switching from drone to travis means PRs will be tested

Support a default target when none provided on command line

Most build tools allow setting a default target/goal/task:

https://github.com/gulpjs/gulp/
http://gruntjs.com/creating-tasks
http://www.gnu.org/software/make/manual/make.html#Goals

which would allow new devs on the project to just run grind, without needing to know what targets the project supports.

Also, it would be cool if the default drone.io or travis script were just:

pub get
pub run grinder

so then you wouldn't need to configure it at all.

API refactor for terseness

Right now we have defineTask('compile', taskFunction: compile, depends: ['init']);

Let's see if we can shorten that up:

var init = task(init);
var compile = task(compile, [init]);

Benefits:

We reduce the amounts of strings in the system... this enables better code completion and warnings/errors.

Less typing.

Dependencies are checked by the analyzer now.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.