Git Product home page Git Product logo

text-runner's People

Contributors

alexdavid avatar chrismm avatar dependabot[bot] avatar greenkeeper[bot] avatar kevgo avatar snyk-bot avatar vinckr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

borisu0815 cjs18

text-runner's Issues

run in a temp directory

As a tutorial writer
I want the tests for my tutorial to run in a separate directory from my tutorial
So that I don't clutter up my tutorial source code with temporary files creating by running it.

running a single file

Feature: running a single MarkDown file

  As a tutorial writer
  I want to be able to test a single MarkDown file
  So that I can check my current changes quickly without having to run the entire test suite.

  - run `tut-run run [<file path>]` or `tut-run [<file path>]` to test only the given file


  Background:
    Given I am working on the "multiple-files" example

  Scenario: testing a single file via "tut-run run"
    When running "tut-run run 2.md"
    Then it runs only the tests in "2.md"

  Scenario: testing a single file via "tut-run"
    When running "tut-run 2.md"
    Then it runs only the tests in "2.md"

  Scenario: testing a non-existing file
    When trying to run "tut-run zonk.md"
    Then it aborts with the error "File not found: zonk.md"

executables

As a non-technical user
I want to be able to download a binary file for Tutorial Runner
So that I can simply use it without having to install and configure Node.JS first.

  • each release contains binary files for Windows, Mac, and Linux

YARN

use YARN on CI

Self-hosting

Use Tertestrial to check the Tertestrial readme

multi-level Cucumber

As a Node.JS library writer
I want to be able to use Tutorial Runner programmatically via its JS API
So that I can fully embed it into my own test suites and control it easily.

  • extract helpers into a CliWorld
  • add an ApiWorld

polyglot actions

As a developer writing a tutorial for a software tool or library I have built
I want to be able to implement actions in the language my tool is written in
So that my actions can call my library programmatically similar to how a developer would
And I can code custom actions in the programming language I am familiar with.

Notes:

  • extract the part that runs actions from the main runtime into its own process called "action runner"
  • the main runtime and the action runner coordinate via an RPC mechanism like (web)socket, Thrift, or whatever
  • the user is responsible for creating the action runner
  • we provide helper libraries for common languages that make creating an action runner as simple as defining the actions is today, by spinning up the action runner process and IPC listener, finding the actions the user has defined, and calling them on demand

Communication Protocol:

  • the main runtime parses the documentation and sends a "runAction" command via IPC to the action runtime
  • the action runtime replies with formatter messages and test outcomes, which are rendered by the main runtime to the user
  • the wire protocol over the IPC channel is JSON

Example:
wire format communication during testing of a library that exposes a "hello" method that users can call:

  1. main runtime sends:
{
  "command": "runAction",
  "name": "callHello",
  "argument": "world"
}
  1. action runner sends:
{
  "event": "action.start",
  "activity": "calling 'hello' with 'world'"
}
  1. action runner calls "hello" with parameter "world"

  2. action runner sends:

{
  "event": "action.success"
}

minimumSupportedNodeVersion action

Feature: check the minimum supported Node version

  As the author of an NPM module
  I want to be able to specify the supported NodeJS versions
  So that my users know how to install this just from reading the documentation.

  - wrap the supported Node version(s) into a "minimumSupportedNodeVersion" action in your documentation
  - the action looks into .travis.yml and makes sure the listed versions show up there
  - the action warns about versions in .travis.yml that are not listed in the document

  Scenario: providing a matching version
    Given my workspace contains a file 1.md with the content:
      """
      Requires Node version <a class="tutorialRunner_minimumSupportedNodeVersion">4</a> or above
      """
    And my workspace contains a file .travis.yml with the content:
      """
      node:
        - 3
        - 4
        - 5
      """
    When running tut-run
    Then it signals:
      |....

Generator for actions

When building a text suite
I want that missing actions are scaffolded for me on demand
So that I don't waste time copy-and-pasting boilerplate code.

  • when TextRunner finds an unknown action, it asks to create one
  • when the user agrees, it creates the files for the action

Running all files in a subdirectory

Feature: testing all docs in a subfolder

  As a tutorial writer working on a large collection of documentation
  I want to be able to test only the documents in a particular folder
  So that I get my test result quickly without having to test everything.

  - run "tut-run [folder-to-test]" to test all docs in the given folder


  Scenario: testing files in a subfolder
    

Simplify actions

They are too complicated right now

  • extract superclass
  • provide default implementations for tags
  • provide a standardized AST to the step, to let steps pick out the data themselves in one swoop?

Ability to create custom blocks

In order to use custom steps:

  • add a directory "tut-run"
  • create files with the name of the activity, e.g. "tut-run/write-file.ls"
  • the file exports the runner
  • so, to make this work, the CLI just has to load steps in the built-in directory as well as in "#{process.cwd!}/tut-run"

set formatter via command-line parameter

Feature: setting the formatter via the command line

  As a tutorial writer
  I want to be able to set the formatter via a command-line parameter
  So that I can play with different formatters without having to update tut-run.yml.

  - provide the formatter to use via the "--formatter=<FORMATTER NAME>" parameter
  - command-line parameters override the configured values


  Background:
    Given my workspace contains a tutorial

  Scenario: using the iconic formatter via the command line
    When running "tut-run --formatter iconic"
    Then I see "[check]"


  Scenario: providing an unknown formatter via the command line
    When trying to run "tut-run --formatter zonk"
    Then the test fails
    And I see "unknown formatter: zonk"

actions libraries

Feature: action libraries

  As a Tutorial Author documenting a variety of projects
  I want to be able to share custom actions between projects
  So that I don't have to implement them redundantly in every project.

  - actions can be put into dedicated source code repos
  - to use external custom actions, 
    list the address of the repo that contains them in tutorial.yml
  - the address can point to a branch of the repo (when debugging shared steps)
  - Tutorial Runner clones/updates that repo on start 
    and uses the custom actions when running

Separate scenarios for API and CLI usage

Optional separate implementation of the API and CLI version of scenarios.

  • some of the current feature specs are not particularly expressive. Reading them doesn't give one a good idea how to use the product via the CLI or API, because defining Gherkin in a way that works for both is too abstract
  • CLI and API are two different ways of consuming the product. Both should be specified in feature specs.

Example:

Feature: running a single MarkDown file

Scenario:
  Given I am in a directory that contains the "multiple-files" example
  When running Tutorial Runner with only the file 1.md
  Then it runs only the tests in 1.md

This scenario doesn't tell the reader much, because all the interesting parts are buried in the step definitions. It's nice to know that I can run it with only one file, but how exactly am I doing this via the CLI or API?

Feature: running a single MarkDown file

  Background:
    Given I am in a directory that contains the "multiple-files" example

  @clionly
  Scenario Outline: testing a single file via the CLI
    When running "tut-run 1.md"
    Then it runs only the tests in "1.md"

  @clionly
  Scenario: testing a non-existing file via the CLI
    When trying to run "tut-run zonk.md"
    Then the test fails with:
      | ERROR MESSAGE | unknown command: zonk.md |
      | EXIT CODE     | 1                        |


  @apionly
  Scenario Outline: testing a single file via the API
    When executing "tutorialRunner.execute 'run', '1.md', <callback>"
    Then it runs only the tests in "1.md"

  Scenario: testing a non-existing file via the API
    When executing "tutorialRunner.execute 'run', 'zonk.md', <callback>"
    Then it returns the error "unknown command: zonk.md"

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.