Bug #10213

Add colorless debug formatter

Added by anonym 2015-09-17 06:49:42 . Updated 2016-11-04 13:14:34 .

Status:
In Progress
Priority:
Normal
Assignee:
anonym
Category:
Test suite
Target version:
Start date:
2015-09-17
Due date:
% Done:

50%

Feature Branch:
test/10213-plain_debug-formatter
Type of work:
Contributors documentation
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description

Some of us want such flexibility since cucumber’s --no-color disables color in all active formatters.


Subtasks


History

#1 Updated by anonym 2015-09-17 06:52:54

  • Status changed from Confirmed to In Progress

Applied in changeset commit:90c25e5c0dff15ba94f7491923f761f61af05784.

#2 Updated by anonym 2015-09-17 06:54:03

  • Assignee changed from anonym to intrigeri
  • % Done changed from 0 to 50
  • QA Check set to Ready for QA
  • Feature Branch set to test/10213-plain_debug-formatter

#3 Updated by intrigeri 2015-09-17 08:11:27

  • Assignee changed from intrigeri to kytv

#4 Updated by anonym 2015-09-17 08:27:27

intrigeri did:
> * Assignee changed from intrigeri to kytv

I assigned it to you since it’s essentially a feature for you only. AFAIK, KillYourTV is loving the colors. :)

#5 Updated by kytv 2015-09-17 08:44:40

  • Assignee changed from kytv to anonym
  • QA Check changed from Ready for QA to Dev Needed

Code looks sane.

To test I ran features/encryption.feature which failed in the following way:

# ./run_test_suite --view --iso ../isos/tails-i386-feature_i2p-0.9.22-1.6-20150914.iso -- features/encryption.feature --format pretty --format plain_debug --out /tmp/debug.log               
Virtual X framebuffer started on display :1
VNC server running on: localhost:5900
[info] Sikuli vision engine loaded.
Testing ISO image: tails-i386-feature_i2p-0.9.22-1.6-20150914.iso
Using old ISO image: tails-i386-feature_i2p-0.9.22-1.6-20150914.iso
@product
Feature: Encryption and verification using GnuPG
  As a Tails user
  I want to be able to easily encrypt and sign messages using GnuPG
  And decrypt and verify GnuPG blocks

  Background:                                                            # features/encryption.feature:7
    Given a computer                                                     # features/step_definitions/common_steps.rb:77
    And I start Tails from DVD with network unplugged and I login        # features/step_definitions/common_steps.rb:161
    And I generate an OpenPGP key named "test" with password "asdf"      # features/step_definitions/encryption.rb:11
    And I save the state so the background can be restored next scenario # features/step_definitions/common_steps.rb:414

  Scenario: Encryption and decryption using Tails OpenPGP Applet         # features/encryption.feature:13
    When I type a message into gedit                                     # features/step_definitions/encryption.rb:34
    And I encrypt the message using my OpenPGP key                       # features/step_definitions/encryption.rb:82
    Then I can decrypt the encrypted message                             # features/step_definitions/encryption.rb:89

  Scenario: Signing and verification using Tails OpenPGP Applet          # features/encryption.feature:18
    When I type a message into gedit                                     # features/step_definitions/encryption.rb:34
    And I sign the message using my OpenPGP key                          # features/step_definitions/encryption.rb:95
    Then I can verify the message's signature                            # features/step_definitions/encryption.rb:102

  Scenario: Encryption/signing and decryption/verification using Tails OpenPGP Applet # features/encryption.feature:23
    When I type a message into gedit                                                  # features/step_definitions/encryption.rb:34
    And I both encrypt and sign the message using my OpenPGP key                      # features/step_definitions/encryption.rb:108
    Then I can decrypt and verify the encrypted message                               # features/step_definitions/encryption.rb:116

  Scenario: Symmetric encryption and decryption using Tails OpenPGP Applet # features/encryption.feature:28
    When I type a message into gedit                                       # features/step_definitions/encryption.rb:34
    And I symmetrically encrypt the message with password "asdf"           # features/step_definitions/encryption.rb:123
    Then I can decrypt the encrypted message                               # features/step_definitions/encryption.rb:89

4 scenarios (4 passed)
28 steps (28 passed)
3m50.378s
no block given (yield) (LocalJumpError)
/usr/lib/ruby/vendor_ruby/cucumber/formatter/summary.rb:20:in `block in dump_status_counts'
/usr/lib/ruby/vendor_ruby/cucumber/formatter/summary.rb:18:in `map'
/usr/lib/ruby/vendor_ruby/cucumber/formatter/summary.rb:18:in `dump_status_counts'
/usr/lib/ruby/vendor_ruby/cucumber/formatter/summary.rb:7:in `scenario_summary'
/home/kytv/tails/features/support/extra_hooks.rb:102:in `block (3 levels) in <class:PlainDebug>'
/usr/lib/ruby/vendor_ruby/cucumber/formatter/console.rb:93:in `print_stats'
/home/kytv/tails/features/support/extra_hooks.rb:102:in `block (3 levels) in <class:PlainDebug>'
/usr/lib/ruby/vendor_ruby/cucumber/formatter/pretty.rb:235:in `print_summary'
/usr/lib/ruby/vendor_ruby/cucumber/formatter/pretty.rb:36:in `after_features'
/home/kytv/tails/features/support/extra_hooks.rb:102:in `block (3 levels) in <class:PlainDebug>'
/home/kytv/tails/features/support/extra_hooks.rb:102:in `block (3 levels) in <class:PlainDebug>'
/usr/lib/ruby/vendor_ruby/cucumber/ast/tree_walker.rb:181:in `block in send_to_all'
/usr/lib/ruby/vendor_ruby/cucumber/ast/tree_walker.rb:179:in `each'
/usr/lib/ruby/vendor_ruby/cucumber/ast/tree_walker.rb:179:in `send_to_all'
/usr/lib/ruby/vendor_ruby/cucumber/ast/tree_walker.rb:171:in `broadcast'
/usr/lib/ruby/vendor_ruby/cucumber/ast/tree_walker.rb:20:in `visit_features'
/usr/lib/ruby/vendor_ruby/cucumber/runtime.rb:49:in `run!'
/usr/lib/ruby/vendor_ruby/cucumber/cli/main.rb:42:in `execute!'
/usr/bin/cucumber:13:in `<main>'

The debug log:

# tail -n 20 /tmp/debug.log 
[log] CLICK on (654,26)
[log] CLICK on (365,377)
[log] TYPE "asdf
"
[log] CLICK on (365,377)
[log] TYPE "asdf
"
[log] CLICK on (207,169)
[log] CLICK on (673,169)
    And I symmetrically encrypt the message with password "asdf"           # features/step_definitions/encryption.rb:123
[log] CLICK on (247,134)
[log] CLICK on (277,351)
[log] CLICK on (638,170)
[log] CLICK on (824,12)
[log] CLICK on (716,27)
[log] CLICK on (365,377)
[log] TYPE "asdf
"
    Then I can decrypt the encrypted message                               # features/step_definitions/encryption.rb:89

#6 Updated by kytv 2015-09-17 08:45:29

anonym wrote:
> intrigeri did:
> > * Assignee changed from intrigeri to kytv
>
> I assigned it to you since it’s essentially a feature for you only. AFAIK, KillYourTV is loving the colors. :)

I am indeed digging the color action. :)

#7 Updated by anonym 2015-10-14 08:36:33

  • Assignee changed from anonym to intrigeri
  • QA Check changed from Dev Needed to Info Needed

Given the existence of --no-color (and that this isn’t an issue on Jenkins) do you still want this feature?

#8 Updated by intrigeri 2015-10-23 06:55:28

  • Assignee changed from intrigeri to anonym

> Given the existence of --no-color

Note that it’s mentioned in the original description of this ticket, so nothing new on this front that would solve my problem.

> (and that this isn’t an issue on Jenkins)

It is good news that this doesn’t cause problems there.

> do you still want this feature?

Perhaps I’m just missing a clever way to solve a problem I have, which caused us to create this ticket in the first place, so let me ask here:

  1. I want nice colors on the real-time test suite output on my terminal.
  2. I also want a debug log file.
  3. Sometimes I want to share said log file with other Tails contributors. In that case, I want them to be trivially able to read that file a) without ugly control chars adding noise that harms readability; and b) without having to tell their pager/editor to trust a bunch of “raw” control chars since they may cause security problems.

Currently, I pass --format pretty --format debug --out debug.log to run_test_suite. This gives we (1) and (2), and I can share the file but I don’t get both 2.a and 2.b.

How are you folks doing?

#9 Updated by anonym 2015-10-30 07:39:34

  • Assignee changed from anonym to intrigeri

intrigeri wrote:
> How are you folks doing?

I admit my solution is quite funny (but I’ve rarely been in that situation): I use ansi2txt from the kbtin package (yes, that’s a MUD client :S). E.g. ansi2txt < debug.log > debug-no-colors.log

Is that good enough for you? Otherwise I guess you could just revive the remove_control_chars_from() code we had in run_test_suite for this, and have it in a script of your own? Instead of putting more crazy monkey patches into our test suite, that. is :)

#10 Updated by intrigeri 2015-10-30 08:19:22

  • Assignee changed from intrigeri to anonym
  • QA Check changed from Info Needed to Dev Needed
  • Type of work changed from Code to Contributors documentation

> I admit my solution is quite funny (but I’ve rarely been in that situation): I use ansi2txt from the kbtin package (yes, that’s a MUD client :S). E.g. ansi2txt < debug.log > debug-no-colors.log

Wow :)

> Is that good enough for you?

Totally => can you please quickly document this? This way, not everybody has to rediscover this independently, and indeed let’s avoid reintroducing my code we’ve removed, or more crazy monkey patching.

#11 Updated by sajolida 2016-11-04 13:14:34

  • Subject changed from Add colorless debug formatter. to Add colorless debug formatter