Git Product home page Git Product logo

perl6-flow's Introduction

flow

a pp6 implementation of prove with the ability to adapt to newer methods of testing

flow is intended to be an extensible prove replacement written entirely in perl6. it's written in a way that it can be configured to use any new testing methods (think: a harness designed for parallel testing, like mocha). can't prove do this? kind of, you can run your tests through whatever you'd like as long as they end up in a TAP output and it will work with prove.

with flow, there isn't any need to translate your test files into TAP as long as there is a ::Plugin available for how you write your tests.

current state

flow ships with only parsing TAP output, there are other testing harnesses out there but they're not widely used if at all.

flow is being released in the environment to try and help test the TAP output parsing and provide a speedier alternative to plain prove (prove -j9 is faster on my system for modules with very few tests/scripts but prove isn't commonly run this way by package installers)

flow vs prove

Here is the benchmark for Bailador module - chosen since it has a medium level of testing -

Script

# !/usr/bin/env perl6

use Bench;

my $b = Bench.new;

$b.cmpthese(500, {
  prove  => sub {
    qx<prove -j9 -e 'perl6 -Ilib' t/>;
  },
  flow   => sub {
    qx<perl6 -I../../p6-flow/lib ../../p6-flow/bin/flow test>;
  }
});

Benchmark

tonyo@mbp:~/projects/benchmark/Bailador$ ./prove-vs-flow.pl6
Benchmark:
Timing 500 iterations of flow, prove...
      flow: 1728.3408 wallclock secs @ 0.2893/s (n=500)
           prove: 3006.5033 wallclock secs @ 0.1663/s (n=500)
           O-------O--------O-------O------O
           |       | s/iter | prove | flow |
           O=======O========O=======O======O
           | prove | 6.01   | --    | -43% |
           | flow  | 3.46   | 74%   | --   |
           ---------------------------------

what is being worked on now

  • interface changes
  • having the tests stream live results instead of just the end result
  • more configuration options

usage

Current directory:

flow test

Some other directory or directories:

flow test [<dir>]

installation

zef install flow

or

panda install flow

license

WTFPL

perl6-flow's People

Contributors

tony-o avatar zoffixznet avatar codesections avatar jraspass avatar

Stargazers

 avatar Mikhail Khorkov avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

perl6-flow's Issues

flow not installing with zef

Just tried to install flow (I have a new testing idea). But install failed. I can't determine why it failed.
Terminal output:

uname -a
Linux merlin 4.13.0-21-generic #24-Ubuntu SMP Mon Dec 18 17:29:16 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
richard@merlin:~/development/ModuleCitation/git_main$ perl6 -v
This is Rakudo version 2017.10 built on MoarVM version 2017.10
implementing Perl 6.c.
richard@merlin:~/development/ModuleCitation/git_main$ zef install flow
===> Searching for: flow
===> Testing: flow:ver<0.0.2>:auth<github:tony-o>
===> Testing [FAIL]: flow:ver<0.0.2>:auth<github:tony-o>
Aborting due to test failure: flow:ver<0.0.2>:auth<github:tony-o> (use --force-test to override)
  in code  at /opt/rakudo-pkg/share/perl6/sources/C99D66B88914FE999500CE1FA4F1216BDBA53BE2 (Zef::Client) line 375
  in method test at /opt/rakudo-pkg/share/perl6/sources/C99D66B88914FE999500CE1FA4F1216BDBA53BE2 (Zef::Client) line 353
  in code  at /opt/rakudo-pkg/share/perl6/sources/C99D66B88914FE999500CE1FA4F1216BDBA53BE2 (Zef::Client) line 530
  in sub  at /opt/rakudo-pkg/share/perl6/sources/C99D66B88914FE999500CE1FA4F1216BDBA53BE2 (Zef::Client) line 527
  in method install at /opt/rakudo-pkg/share/perl6/sources/C99D66B88914FE999500CE1FA4F1216BDBA53BE2 (Zef::Client) line 633
  in sub MAIN at /opt/rakudo-pkg/share/perl6/sources/0396F9D56BBCF5F8CF25C8759D77D03AEF745931 (Zef::CLI) line 152
  in block <unit> at /opt/rakudo-pkg/share/perl6/resources/95699F546D28C01BF68BD7A836D7D12FFB0B2943 line 1
  in sub MAIN at /opt/rakudo-pkg/bin/zef line 2
  in block <unit> at /opt/rakudo-pkg/bin/zef line 2

Tests are flapping

When running the tests in a loop like this:

while PERL6LIB=lib/ prove --exec=perl6 t/*.t; do :; done

I got this result:

t/00-Test.t .. ok   
t/01-TAP.t ... ok   
t/02-test.t .. No such method 'passed' for invocant of type 'Any'
  in block <unit> at t/02-test.t line 17

t/02-test.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 3/3 subtests 

Test Summary Report
-------------------
t/02-test.t (Wstat: 65280 Tests: 0 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 3 tests but ran 0.

flow not working well

I tried flow without any parameters, and it gave warnings.
I tried flow on an existing test suite of mine. It blew up. So I have shown the output of prove -e perl6 for the same test suite, then the output for flow.
I am not sure what the purpose of 'test' is in the command flow test
Regards,
Richard

flow
Use of Nil in numeric context
  in block  at /home/richard/.perl6/sources/53AAB0E3280796951E984CBC0C723300289AABAC (Flow::Utils::Cursor) line 6
Use of Nil in numeric context
  in block  at /home/richard/.perl6/sources/53AAB0E3280796951E984CBC0C723300289AABAC (Flow::Utils::Cursor) line 7
Usage:
  flow [--depth=<Any>] test 
  flow [--depth=<Any>] test '[<dirs> ...]' 
richard@merlin:~/development/ModuleCitation/git_main$ uname -a
Linux merlin 4.13.0-21-generic #24-Ubuntu SMP Mon Dec 18 17:29:16 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
richard@merlin:~/development/ModuleCitation/git_main$ prove -e perl6
t/01_Initial.t .... 13/? # create project files with depends errors to be trapped
t/01_Initial.t .... ok    
t/02_formating.t .. 1/? # testing the depends structure
t/02_formating.t .. 17/? # Downloading from internet
t/02_formating.t .. ok    
All tests successful.
Files=2, Tests=45, 33 wallclock secs ( 0.02 usr  0.00 sys +  9.97 cusr  0.75 csys = 10.74 CPU)
Result: PASS
richard@merlin:~/development/ModuleCitation/git_main$ flow test
Use of Nil in numeric context
  in block  at /home/richard/.perl6/sources/53AAB0E3280796951E984CBC0C723300289AABAC (Flow::Utils::Cursor) line 6
Use of Nil in numeric context
  in block  at /home/richard/.perl6/sources/53AAB0E3280796951E984CBC0C723300289AABAC (Flow::Utils::Cursor) line 7
    # | Plan // Pass | File Name
[-] 1 | 0    //    0 | t/02_formating.t

Test #1 - output
   The spawned command '/opt/rakudo-pkg/bin/perl6' exited unsuccessfully (exit code: 1)
   No configuration file in current directory (/home/richard/development/ModuleCitation/git_main/tmp)
     in submethod TWEAK at /home/richard/development/ModuleCitation/git_main/lib/ModuleCitation.pm6 (ModuleCitation) line 38
     in submethod BUILDALL at /home/richard/development/ModuleCitation/git_main/lib/.precomp/272B80FC0A239CB25AC22453FE7B3B3434A80F34.1509489407.46443/B4/B4C9032ED8AAEE777A956559AC42B2521C703CFC line 1
     in block <unit> at /home/richard/development/ModuleCitation/git_main/t/02_formating.t line 20

[+] 2 | -26  //   26 | t/01_Initial.t

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.