Skip to content

--reporter compact is broken when terminal width is smal #346

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

Closed
kasperpeulen opened this issue Oct 7, 2015 · 12 comments
Closed

--reporter compact is broken when terminal width is smal #346

kasperpeulen opened this issue Oct 7, 2015 · 12 comments
Labels
closed-duplicate Closed in favor of an existing report

Comments

@kasperpeulen
Copy link

Okay, I don't understand this, because 1 hour ago, this still seemed to work for me.
But pub run test -r compact which I think is standard, doesn't work for me anymore. It is actally less compact, then pub run test - r expanded. See the bottom of the log below.

I've here an easy to reproduce terminal log:

~ $ mkdir test_the_test_package
~ $ cd test_the_test_package/
~/test_the_test_package $ stagehand console-full
Creating console-full application 'test_the_test_package':
  /Users/kasper/test_the_test_package/.gitignore
  /Users/kasper/test_the_test_package/CHANGELOG.md
  /Users/kasper/test_the_test_package/LICENSE
  /Users/kasper/test_the_test_package/README.md
  /Users/kasper/test_the_test_package/bin/main.dart
  /Users/kasper/test_the_test_package/lib/test_the_test_package.dart
  /Users/kasper/test_the_test_package/pubspec.yaml
  /Users/kasper/test_the_test_package/test/test_the_test_package_test.dart
8 files written.

--> to provision required packages, run 'pub get'
--> run your app using 'dart bin/main.dart'
~/test_the_test_package $ pub get
Resolving dependencies... (6.8s) 
+ analyzer 0.26.1+7
+ args 0.13.2
+ async 1.3.0
+ barback 0.15.2+7
+ charcode 1.1.0
+ collection 1.1.3
+ crypto 0.9.1
+ csslib 0.12.1
+ glob 1.0.5
+ html 0.12.2
+ http_multi_server 1.3.2
+ http_parser 1.0.0
+ logging 0.11.2
+ matcher 0.12.0+1
+ mime 0.9.3
+ package_config 0.1.3
+ path 1.3.6
+ plugin 0.1.0
+ pool 1.1.0
+ pub_semver 1.2.2
+ shelf 0.6.3
+ shelf_static 0.2.3+1
+ shelf_web_socket 0.0.1+4
+ source_map_stack_trace 1.0.4
+ source_maps 0.10.1
+ source_span 1.2.1
+ stack_trace 1.4.2
+ string_scanner 0.1.4
+ test 0.12.4+9
+ utf 0.9.0+2
+ watcher 0.9.7
+ yaml 2.1.7
Changed 32 dependencies!
Precompiling executables... 
Loading source assets... 
Precompiled test:test.
~/test_the_test_package $ pub run test 
00:00 +0: loading test/test_the_test_package_test.dart                          
00:00 +0: test/test_the_test_package_test.dart: calculate                       
00:00 +1: test/test_the_test_package_test.dart: calculate                       
00:00 +1: All tests passed!                                                                        
~/test_the_test_package $ pub run test -r expanded
00:00 +0: test/test_the_test_package_test.dart: calculate
00:00 +1: All tests passed!
~/test_the_test_package $ pub run test -r compact
00:00 +0: loading test/test_the_test_package_test.dart                          
00:00 +0: test/test_the_test_package_test.dart: calculate                       
00:00 +1: test/test_the_test_package_test.dart: calculate                       
00:00 +1: All tests passed!                                                                        
@kasperpeulen kasperpeulen changed the title --reporter comapct seems broken --reporter comact seems broken Oct 7, 2015
@kasperpeulen kasperpeulen changed the title --reporter comact seems broken --reporter compact seems broken Oct 7, 2015
@nex3
Copy link
Member

nex3 commented Oct 7, 2015

What terminal are you using? Is this through SSH or something like that? It looks like it may be interpreting CRs as newlines rather than sending the cursor to the beginning of the line as usual.

@nex3 nex3 added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) needs-info Additional information needed from the issue author labels Oct 7, 2015
@kulakowski
Copy link

I see this behavior as well, regardless of whether I use --reporter compact or not.

I can see it running on OS X in iTerm2, in tmux, as well as in an ssh session in a chrome tab. $TERM is screen-256color. Interestingly, the first few times I run it, I see the normal behavior (successive passing tests overwriting the same line) at first. When I make a new tmux pane (so that I have multiple terminals running in the same window) it breaks. When this happens in one tmux pane, it effects all other panes. reseting doesn't help. I can't reproduce this without tmux.

@kasperpeulen
Copy link
Author

@nex3 I use the webstorm integrated terminal with a fish shell. But if I use the standard terminal app from OS X with bash, I have the same problem.

I'm sure that that earlier today it worked fine, suddenly out of nothing, I got this behavior. Also if I do stdout.write("\r ..."); it seem to work as expected:

@nex3
Copy link
Member

nex3 commented Oct 7, 2015

I've got no idea what would produce the behavior you're describing. If you capture the output, do you see anything wrong in the bytes it's emitting? If not, I'm not sure there's much we can do about this.

@kasperpeulen
Copy link
Author

@nex3 I understand, it seems like a really strange issue. Especially because it used to work as expected. I have reset the mac terminal settings, I have created a fresh new account (don't know if that matters), I did pub cache repair.

It could be, that more people have this, but just don't know that the test output should be one line rewriting itself normally.

About the output, not sure how to find if something is wrong in the bytes. But there is definitely something very strange going on, this is how the code looks to me in the terminal:
image

but if copy paste that to webstorm, it looks like this:
image
if I copy paste to atom, it looks like this:
image

if I copy paste it to github, it looks like this:

~/test_the_test_package $ pub run test
00:00 +0: loading test/test_the_test_package_test.dart                          00:00 +0: test/test_the_test_package_test.dart: calculate                       00:00 +1: test/test_the_test_package_test.dart: calculate                       00:00 +1: All tests passed!                                                                        
~/test_the_test_package $ 

in the post above I did the enters myself for readability

@nex3
Copy link
Member

nex3 commented Oct 7, 2015

As far as I can tell, then, it's an aspect of your terminal and there's no way to fix it in the test runner itself. Not a great answer, I know, but I don't think there's much we can do.

@nex3 nex3 closed this as completed Oct 7, 2015
@kasperpeulen
Copy link
Author

@nex3 I'm not an expert with terminals/shells etc. But I do get this problem on the default OS X Terminal app with a standard bash shell.

So do you think I have a wrong setting here or something? (not that I know that I changed any settings, but maybe by accident).

@nex3
Copy link
Member

nex3 commented Oct 7, 2015

As far as I've heard people in the office using OS X don't see this issue; I can't explain why it suddenly appeared for you, but the evidence indicates the test runner is emitting reasonable bytes, and that's the only thing I can control.

@kasperpeulen
Copy link
Author

@nex3 Okay, I understand your point of view, but the more I investigate, the more I feel like this must be a bug somewhere, if it is not in this package, may be a bug in OS X:

Look at this:
image

In some other terminal I installed a fork of the test package, I didn't change anything, only renamed it to _test. But as you see, magically, suddenly it works again as expected. Even more magically, if I do pub run test again, it also suddenly works.

As suddenly, as it stopped working, it suddenly works again. But only in this terminal. And not in other terminal windows. Even if try to replicate this trick........

Okay, just trying to find out a solution. Will investigate some more.

@kasperpeulen kasperpeulen changed the title --reporter compact seems broken --reporter compact is broken when terminal width is small Oct 8, 2015
@kasperpeulen
Copy link
Author

@nex3 I thought I was going insane! But it is actually a lot more predictable luckily. It seems to be that this is happens if and only if the terminal width is smaller than 99 (chars?):

@kasperpeulen kasperpeulen changed the title --reporter compact is broken when terminal width is small --reporter compact is broken when terminal width is smaller than 99 pixels Oct 8, 2015
@kasperpeulen kasperpeulen changed the title --reporter compact is broken when terminal width is smaller than 99 pixels --reporter compact is broken when terminal width is smal Oct 8, 2015
@nex3
Copy link
Member

nex3 commented Oct 8, 2015

In that case, this is a duplicate of #288.

@nex3 nex3 added closed-duplicate Closed in favor of an existing report and removed type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) needs-info Additional information needed from the issue author labels Oct 8, 2015
@kasperpeulen
Copy link
Author

okay, thanks, I see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report
Projects
None yet
Development

No branches or pull requests

3 participants